direct-io.hg

changeset 13794:ed68ca4368fa

libxc: Domain builder must align initial virtual mapping to 4MB
boundaries.
From: Gerd Hoffmann <kraxel@suse.de>
Signed-off-by: Keir Fraser <keir@xensource.com>
author kfraser@localhost.localdomain
date Fri Feb 02 15:41:45 2007 +0000 (2007-02-02)
parents f9384402bc1e
children 82171212156b
files tools/libxc/xc_dom_core.c tools/libxc/xc_dom_x86.c
line diff
     1.1 --- a/tools/libxc/xc_dom_core.c	Fri Feb 02 15:30:49 2007 +0000
     1.2 +++ b/tools/libxc/xc_dom_core.c	Fri Feb 02 15:41:45 2007 +0000
     1.3 @@ -717,6 +717,9 @@ int xc_dom_build_image(struct xc_dom_ima
     1.4      }
     1.5      page_size = XC_DOM_PAGE_SIZE(dom);
     1.6  
     1.7 +    /* 4MB align virtual base address */
     1.8 +    dom->parms.virt_base &= ~(((uint64_t)1<<22)-1);
     1.9 +
    1.10      /* load kernel */
    1.11      if (0 != xc_dom_alloc_segment(dom, &dom->kernel_seg, "kernel",
    1.12  				  dom->kernel_seg.vstart,
     2.1 --- a/tools/libxc/xc_dom_x86.c	Fri Feb 02 15:30:49 2007 +0000
     2.2 +++ b/tools/libxc/xc_dom_x86.c	Fri Feb 02 15:41:45 2007 +0000
     2.3 @@ -66,11 +66,12 @@ static int count_pgtables(struct xc_dom_
     2.4  
     2.5      extra_pages = dom->alloc_bootstack ? 1 : 0;
     2.6      extra_pages += dom->extra_pages;
     2.7 +    extra_pages += 128; /* 512kB padding */
     2.8      pages = extra_pages;
     2.9      for (;;)
    2.10      {
    2.11  	try_virt_end = round_up(dom->virt_alloc_end + pages * PAGE_SIZE_X86,
    2.12 -				bits_to_mask(l1_bits));
    2.13 +				bits_to_mask(22)); /* 4MB alignment */
    2.14  	dom->pg_l4 =
    2.15  	    nr_page_tables(dom->parms.virt_base, try_virt_end, l4_bits);
    2.16  	dom->pg_l3 =
    2.17 @@ -313,6 +314,7 @@ static int alloc_magic_pages(struct xc_d
    2.18      if (xc_dom_feature_translated(dom))
    2.19  	dom->shared_info_pfn = xc_dom_alloc_page(dom, "shared info");
    2.20      dom->alloc_bootstack = 1;
    2.21 +
    2.22      return 0;
    2.23  }
    2.24