[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH v7 00/14] arm/mem_access: Walk guest page tables in SW if mem_access is active





On 08/08/17 13:17, Sergej Proskurin wrote:
diff --git a/xen/arch/arm/traps.c b/xen/arch/arm/traps.c
index c07999b518..904abafcae 100644
--- a/xen/arch/arm/traps.c
+++ b/xen/arch/arm/traps.c
@@ -2688,6 +2688,8 @@ static bool try_map_mmio(gfn_t gfn)
     return !map_regions_p2mt(d, gfn, 1, mfn, p2m_mmio_direct_c);
 }

+#include <asm/guest_walk.h>
+
 static void do_trap_data_abort_guest(struct cpu_user_regs *regs,
                                      const union hsr hsr)
 {
@@ -2725,6 +2727,17 @@ static void do_trap_data_abort_guest(struct 
cpu_user_regs *regs,
             return; /* Try again */
     }

+    {
+        paddr_t ipa, pipa;
+        rc = gva_to_ipa(info.gva, &info.ipa, GV2M_READ);

There is no ipa field in mmio_info_t. But even if you used info.gpa
instead, the test that you have provided is unfortunately flawed:

Well, I copied the wrong code... info.ipa should be replaced by pipa.

+        BUG_ON(rc);
+        printk("guest_walk_tables: gva 0x%x pipa 0x%llx\n",
+               info.gva, pipa);
+        rc = guest_walk_tables(current, info.gva, &ipa, NULL);
+        BUG_ON(rc);
+        BUG_ON(ipa != pipa);

In your test-case you don't initialize pipa at all, however you test for
it in BUG_ON, which is the reason why it fails. I have adopted your test
case and it runs on ARMv7 (non-LPAE guest) and ARMv8 (LPAE guest)
without any issues. It would be great if you would verify this behaviour
by applying the following patch to the arm-gpt-walk-v7 patch [0] as before:

I am afraid that whilst there was a bug in the code to compare ipa != pipa. If you looked at the log I provided, it was failing before:

d0: guestcopy: failed to get table entry.

And this does not even involve pipa... If you wonder your patch below does not help it also.

Cheers,

--
Julien Grall

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
https://lists.xen.org/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.