]> xenbits.xensource.com Git - xen.git/commitdiff
libxl: arm: ensure DTB is page aligned
authorIan Campbell <ian.campbell@citrix.com>
Wed, 20 Nov 2013 09:45:32 +0000 (09:45 +0000)
committerIan Campbell <ian.campbell@citrix.com>
Thu, 21 Nov 2013 10:45:29 +0000 (10:45 +0000)
xc_dom_alloc_segment requires this. Since rambase and ramend are both page
aligned, rounding up the DTB is sufficient.

Reported-by: Julien Grall <julien.grall@linaro.org>
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Julien Grall <julien.grall@linaro.org>
tools/libxc/xc_dom_arm.c

index ffe575b4fdd34eb0fbfb837ef842d206f8e1aa9d..a40e04ddfe6953bed5bb603b85a668777139794e 100644 (file)
@@ -282,7 +282,7 @@ int arch_setup_meminit(struct xc_dom_image *dom)
     {
         const uint64_t rambase = dom->rambase_pfn << XC_PAGE_SHIFT;
         const uint64_t ramend = rambase + ( dom->total_pages << XC_PAGE_SHIFT );
-        const uint64_t dtbsize = ( dom->devicetree_size + 3 ) & ~0x3;
+        const uint64_t dtbsize = ROUNDUP(dom->devicetree_size, XC_PAGE_SHIFT);
 
         /* Place at 128MB if there is sufficient RAM */
         if ( ramend >= rambase + 128*1024*1024 + dtbsize )