All of lore.kernel.org
 help / color / mirror / Atom feed
From: Gerd Hoffmann <kraxel@suse.de>
To: Keir Fraser <Keir.Fraser@cl.cam.ac.uk>
Cc: xen-devel@lists.xensource.com, John Levon <levon@movementarian.org>
Subject: Re: new domain builder breaks compatibility
Date: Fri, 02 Feb 2007 16:13:54 +0100	[thread overview]
Message-ID: <45C35532.8090506@suse.de> (raw)
In-Reply-To: <C1E90459.8C67%Keir.Fraser@cl.cam.ac.uk>

[-- Attachment #1: Type: text/plain, Size: 645 bytes --]

Keir Fraser wrote:
> On 2/2/07 07:59, "Gerd Hoffmann" <kraxel@suse.de> wrote:
> 
>>> 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).
> 
> I suppose it is nice to stick with the guarantees described in xen.h, since
> it is so easy to do so.

Slightly updated version of the patch, the previous one did fixup
virt_base too late.  This one should work in theory.  It's not really
tested though, the VIRT_BASE specified by linux kernels is at a 4MB
border anyway, so the fixup is a no-op ...

cheers,
  Gerd

-- 
Gerd Hoffmann <kraxel@suse.de>

[-- Attachment #2: fix-builder-4mb-align.diff --]
[-- Type: text/x-patch, Size: 1635 bytes --]

---
 tools/libxc/xc_dom_core.c |    3 +++
 tools/libxc/xc_dom_x86.c  |    4 +++-
 2 files changed, 6 insertions(+), 1 deletion(-)

Index: build-32-unstable-13788/tools/libxc/xc_dom_x86.c
===================================================================
--- build-32-unstable-13788.orig/tools/libxc/xc_dom_x86.c
+++ build-32-unstable-13788/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,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;
 }
 
Index: build-32-unstable-13788/tools/libxc/xc_dom_core.c
===================================================================
--- build-32-unstable-13788.orig/tools/libxc/xc_dom_core.c
+++ build-32-unstable-13788/tools/libxc/xc_dom_core.c
@@ -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,

[-- Attachment #3: Type: text/plain, Size: 138 bytes --]

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

  reply	other threads:[~2007-02-02 15:13 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-01-31 21:48 new domain builder breaks compatibility John Levon
2007-02-01  9:04 ` Gerd Hoffmann
2007-02-01 14:55   ` John Levon
2007-02-01 15:15     ` Gerd Hoffmann
2007-02-01 16:22       ` John Levon
2007-02-01 16:33         ` Gerd Hoffmann
2007-02-01 16:38           ` John Levon
2007-02-01 19:17   ` John Levon
2007-02-01 23:13     ` Keir Fraser
2007-02-02  7:59       ` Gerd Hoffmann
2007-02-02 15:08         ` Keir Fraser
2007-02-02 15:13           ` Gerd Hoffmann [this message]
2007-02-02 15:22             ` John Levon
2007-02-02  8:02     ` Gerd Hoffmann

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=45C35532.8090506@suse.de \
    --to=kraxel@suse.de \
    --cc=Keir.Fraser@cl.cam.ac.uk \
    --cc=levon@movementarian.org \
    --cc=xen-devel@lists.xensource.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.