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] Crash on boot with 2.6.37-rc8-git3

To: Stefano Stabellini <stefano.stabellini@xxxxxxxxxxxxx>
Subject: Re: [Xen-devel] Crash on boot with 2.6.37-rc8-git3
From: M A Young <m.a.young@xxxxxxxxxxxx>
Date: Tue, 25 Jan 2011 16:05:25 +0000 (GMT)
Cc: Ian Campbell <Ian.Campbell@xxxxxxxxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxx>, Konrad Rzeszutek Wilk <konrad.wilk@xxxxxxxxxx>
Delivery-date: Tue, 25 Jan 2011 08:06:45 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <alpine.DEB.2.00.1101251555150.7277@kaball-desktop>
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/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <alpine.LFD.2.02.1101202223370.13928@xxxxxxxxxxxxxxx> <20110121152751.GA4156@xxxxxxxxxxxx> <alpine.LFD.2.02.1101212024460.7991@xxxxxxxxxxxxxxx> <20110124141453.GA6511@xxxxxxxxxxxx> <alpine.LFD.2.02.1101242309450.20626@xxxxxxxxxxxxxxx> <alpine.DEB.2.00.1101251152330.7277@kaball-desktop> <1295961878.14780.6063.camel@xxxxxxxxxxxxxxxxxxxxxx> <alpine.DEB.2.00.1101251328010.7277@kaball-desktop> <1295963130.14780.6105.camel@xxxxxxxxxxxxxxxxxxxxxx> <alpine.DEB.2.00.1101251502540.7277@kaball-desktop> <20110125155201.GA25076@xxxxxxxxxxxx> <alpine.DEB.2.00.1101251555150.7277@kaball-desktop>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Alpine 2.00 (GSO 1167 2008-08-23)
On Tue, 25 Jan 2011, Stefano Stabellini wrote:

I think you need the slightly improved version I posted before that can
handle map[i].addr not page aligned (I silently added a s-o-b Young, I
hope he's OK with this).

Yes and yes. My version doesn't work if map[i].addr is not page aligned. The aim is to make sure the end address is page aligned, and avoid ending with a partial page which won't have a PFN and might also require different treatment if there is reserved content in the rest of the page (which is true in my case).

        Michael Young

commit b84683ad1e704c2a296d08ff0cbe29db936f94a7
Author: Stefano Stabellini <stefano.stabellini@xxxxxxxxxxxxx>
Date:   Tue Jan 25 12:03:42 2011 +0000

   xen: make sure the e820 memory regions end at page boundary

   Signed-off-by: M A Young <m.a.young@xxxxxxxxxxxx>
   Signed-off-by: Stefano Stabellini <stefano.stabellini@xxxxxxxxxxxxx>

diff --git a/arch/x86/xen/setup.c b/arch/x86/xen/setup.c
index b5a7f92..a3d28a1 100644
--- a/arch/x86/xen/setup.c
+++ b/arch/x86/xen/setup.c
@@ -179,7 +179,10 @@ char * __init xen_memory_setup(void)
        e820.nr_map = 0;
        xen_extra_mem_start = mem_end;
        for (i = 0; i < memmap.nr_entries; i++) {
-               unsigned long long end = map[i].addr + map[i].size;
+               unsigned long long end;
+               if (map[i].type == E820_RAM)
+                       map[i].size -= (map[i].size + map[i].addr) % PAGE_SIZE;
+               end = map[i].addr + map[i].size;

                if (map[i].type == E820_RAM && end > mem_end) {
                        /* RAM off the end - may be partially included */


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