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: Ian Campbell <Ian.Campbell@xxxxxxxxxx>
Date: Tue, 25 Jan 2011 13:24:38 +0000
Cc: "xen-devel@xxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxx>, Konrad Rzeszutek Wilk <konrad.wilk@xxxxxxxxxx>, M A Young <m.a.young@xxxxxxxxxxxx>
Delivery-date: Tue, 25 Jan 2011 05:25:35 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <alpine.DEB.2.00.1101251152330.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>
Organization: Citrix Systems, Inc.
References: <alpine.LFD.2.02.1101072034080.9613@xxxxxxxxxxxxxxx> <20110107212359.GA22976@xxxxxxxxxxxx> <alpine.LFD.2.02.1101080007020.8723@xxxxxxxxxxxxxxx> <20110110184225.GB9837@xxxxxxxxxxxx> <alpine.LFD.2.02.1101180027120.16611@xxxxxxxxxxxxxxx> <alpine.LFD.2.02.1101192249200.30335@xxxxxxxxxxxxxxx> <20110120192434.GA10001@xxxxxxxxxxxx> <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>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
On Tue, 2011-01-25 at 12:03 +0000, Stefano Stabellini wrote:
> On Mon, 24 Jan 2011, M A Young wrote:
> > On Mon, 24 Jan 2011, Konrad Rzeszutek Wilk wrote:
> > 
> > > We can fix how the E820 is done.
> > > Look in arch/x86/xen/setup.c for 'xen_memory_setup' function.
> > > Try to wrap make map[i].size be = map[i].szie & ~(PAGE_SIZE-1)
> > > that should trim off the last 2048 bytes.
> > 
> > The attached patch works for me, though it does assume the memory region 
> > starts on a page boundary.
> 
> It turns out that it is me having the same issue you have and not the
> other way around :)
> 
> Your patch (in addition to my previous patch) makes my testbox boot, no
> matter what dom0_mem parameter I choose.
> 
> Appended is a version of the patch that doesn't assume that the memory
> region starts on a page boundary.
> 
> ---
> 
> 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;

The more normal idiom to round down to a page boundary in the kernel is:
        map[i].size &= ~(PAGE_SIZE-1);

Do you also need to page align map[i].addr upwards for maximum safety?

Ian.

> +             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



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