WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

Re: [Xen-devel] new domain builder breaks compatibility

To: Keir Fraser <Keir.Fraser@xxxxxxxxxxxx>
Subject: Re: [Xen-devel] new domain builder breaks compatibility
From: Gerd Hoffmann <kraxel@xxxxxxx>
Date: Fri, 02 Feb 2007 08:59:06 +0100
Cc: xen-devel@xxxxxxxxxxxxxxxxxxx, John Levon <levon@xxxxxxxxxxxxxxxxx>
Delivery-date: Thu, 01 Feb 2007 23:58:40 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
In-reply-to: <C1E824AE.8BA1%Keir.Fraser@xxxxxxxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <C1E824AE.8BA1%Keir.Fraser@xxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Thunderbird 1.5.0.9 (X11/20060911)
Keir Fraser wrote:
> On 1/2/07 19:17, "John Levon" <levon@xxxxxxxxxxxxxxxxx> wrote:
> 
>>> --- tools/libxc/xc_dom_x86.c~ 2007-01-31 18:07:56.000000000 +0100
>>> +++ tools/libxc/xc_dom_x86.c 2007-02-01 10:02:08.000000000 +0100
>>> @@ -66,6 +66,7 @@
>>>  
>>>      extra_pages = dom->alloc_bootstack ? 1 : 0;
>>>      extra_pages += dom->extra_pages;
>>> +    extra_pages += 128; /* 512kB padding */
>> I've tested this along with a kernel change to only assume 2Mb
>> alignment, and it works on PAE and 64-bit now. Could you send a patch
>> upstream please? And update xen.h to clarify things?
> 
> I'll handle this and update xen.h.

Restoring the 4MB alignment is easy too, see attached patch (which also
fixes the 4MB alignment for virt_base).

cheers,
  Gerd

-- 
Gerd Hoffmann <kraxel@xxxxxxx>
---
 tools/libxc/xc_dom_x86.c |    6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

Index: build-64-unstable-13762/tools/libxc/xc_dom_x86.c
===================================================================
--- build-64-unstable-13762.orig/tools/libxc/xc_dom_x86.c
+++ build-64-unstable-13762/tools/libxc/xc_dom_x86.c
@@ -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,9 @@ 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;
+
+    /* 4MB align start address */
+    dom->parms.virt_base &= ~(((uint64_t)1<<22)-1);
     return 0;
 }
 
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel