arm/traps: fix bug in dump_guest_s1_walk L1 page table offset computation
authorJonathan Daugherty <jtd@galois.com>
Wed, 20 Jul 2016 16:10:16 +0000 (09:10 -0700)
committerStefano Stabellini <sstabellini@kernel.org>
Wed, 20 Jul 2016 17:32:31 +0000 (10:32 -0700)
The dump_guest_s1_walk function was incorrectly using the top 10 bits of
the virtual address to select the L1 page table index.  The correct
amount is 12 bits, resulting in a shift of 20 bits rather than 22.

For more details, see the ARMv7-A ARM DDI 0406C.b, section B3.5,
"Short-descriptor translation table format."

Signed-off-by: Jonathan Daugherty <jtd@galois.com>
Reviewed-by: Julien Grall <julien.grall@arm.com>
Acked-by: Stefano Stabellini <sstabellini@kernel.org>
xen/arch/arm/traps.c

index a2eb1da7cd99906e30fc9af6bb8333163dabddcc..0c10c4d1235133aa2a1aeb66a8cefc3700b924f8 100644 (file)
@@ -2346,7 +2346,7 @@ void dump_guest_s1_walk(struct domain *d, vaddr_t addr)
     }
     first = map_domain_page(mfn);
 
-    offset = addr >> (12+10);
+    offset = addr >> (12+8);
     printk("1ST[0x%"PRIx32"] (0x%"PRIpaddr") = 0x%08"PRIx32"\n",
            offset, pfn_to_paddr(mfn_x(mfn)), first[offset]);
     if ( !(first[offset] & 0x1) ||