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

[Xen-changelog] [xen-unstable] libxc: Domain builder must align initial virtual mapping to 4MB



# HG changeset patch
# User kfraser@xxxxxxxxxxxxxxxxxxxxx
# Date 1170430905 0
# Node ID ed68ca4368fa043039563d3a2c7e2685d447203c
# Parent  f9384402bc1e03dd13520011b4929141ee5bcad0
libxc: Domain builder must align initial virtual mapping to 4MB
boundaries.
From: Gerd Hoffmann <kraxel@xxxxxxx>
Signed-off-by: Keir Fraser <keir@xxxxxxxxxxxxx>
---
 tools/libxc/xc_dom_core.c |    3 +++
 tools/libxc/xc_dom_x86.c  |    4 +++-
 2 files changed, 6 insertions(+), 1 deletion(-)

diff -r f9384402bc1e -r ed68ca4368fa tools/libxc/xc_dom_core.c
--- a/tools/libxc/xc_dom_core.c Fri Feb 02 15:30:49 2007 +0000
+++ b/tools/libxc/xc_dom_core.c Fri Feb 02 15:41:45 2007 +0000
@@ -717,6 +717,9 @@ int xc_dom_build_image(struct xc_dom_ima
     }
     page_size = XC_DOM_PAGE_SIZE(dom);
 
+    /* 4MB align virtual base address */
+    dom->parms.virt_base &= ~(((uint64_t)1<<22)-1);
+
     /* load kernel */
     if (0 != xc_dom_alloc_segment(dom, &dom->kernel_seg, "kernel",
                                  dom->kernel_seg.vstart,
diff -r f9384402bc1e -r ed68ca4368fa tools/libxc/xc_dom_x86.c
--- a/tools/libxc/xc_dom_x86.c  Fri Feb 02 15:30:49 2007 +0000
+++ b/tools/libxc/xc_dom_x86.c  Fri Feb 02 15:41:45 2007 +0000
@@ -66,11 +66,12 @@ static int count_pgtables(struct xc_dom_
 
     extra_pages = dom->alloc_bootstack ? 1 : 0;
     extra_pages += dom->extra_pages;
+    extra_pages += 128; /* 512kB padding */
     pages = extra_pages;
     for (;;)
     {
        try_virt_end = round_up(dom->virt_alloc_end + pages * PAGE_SIZE_X86,
-                               bits_to_mask(l1_bits));
+                               bits_to_mask(22)); /* 4MB alignment */
        dom->pg_l4 =
            nr_page_tables(dom->parms.virt_base, try_virt_end, l4_bits);
        dom->pg_l3 =
@@ -313,6 +314,7 @@ static int alloc_magic_pages(struct xc_d
     if (xc_dom_feature_translated(dom))
        dom->shared_info_pfn = xc_dom_alloc_page(dom, "shared info");
     dom->alloc_bootstack = 1;
+
     return 0;
 }
 

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

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