xen: arm: correctly round down MFN to 1GB boundary make sure pagetable mask macros...
authorIan Campbell <ian.campbell@citrix.com>
Thu, 10 Oct 2013 14:43:44 +0000 (15:43 +0100)
committerIan Campbell <ian.campbell@citrix.com>
Thu, 24 Oct 2013 13:24:37 +0000 (14:24 +0100)
~FIRST_MASK is nothing like correct for rounding down an MFN. It is the
inverse *and* an address not a framenumber so wrong in every dimension! We
cannot use FIRST_MASK since that would mask off any zeroeth level bits.
Instead calculate the correct value from FIRST_SIZE.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Julien Grall <julien.grall@linaro.org>
xen/arch/arm/mm.c

index 1773ffe3b5959cb92c78e21590e6a61889bb8d14..123280e82657bf569aed5a37eece8c481b9cd033 100644 (file)
@@ -639,7 +639,7 @@ void __init setup_xenheap_mappings(unsigned long base_mfn,
     end_mfn = base_mfn + nr_mfns;
 
     /* Align to previous 1GB boundary */
-    base_mfn &= ~FIRST_MASK;
+    base_mfn &= ~((FIRST_SIZE>>PAGE_SHIFT)-1);
 
     offset = base_mfn - xenheap_mfn_start;
     vaddr = DIRECTMAP_VIRT_START + offset*PAGE_SIZE;