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] [PATCH 1/3] x86: calculate precisely the memory needed b

To: Ian Jackson <Ian.Jackson@xxxxxxxxxxxxx>
Subject: Re: [Xen-devel] [PATCH 1/3] x86: calculate precisely the memory needed by init_memory_mapping
From: Stefano Stabellini <stefano.stabellini@xxxxxxxxxxxxx>
Date: Mon, 20 Jun 2011 20:16:01 +0100
Cc: "xen-devel@xxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxx>, "konrad.wilk@xxxxxxxxxx" <konrad.wilk@xxxxxxxxxx>, Stefano Stabellini <Stefano.Stabellini@xxxxxxxxxxxxx>, "linux-kernel@xxxxxxxxxxxxxxx" <linux-kernel@xxxxxxxxxxxxxxx>, "hpa@xxxxxxxxx" <hpa@xxxxxxxxx>, "mingo@xxxxxxx" <mingo@xxxxxxx>, "hpa@xxxxxxxxxxxxxxx" <hpa@xxxxxxxxxxxxxxx>, "yinghai@xxxxxxxxxx" <yinghai@xxxxxxxxxx>
Delivery-date: Mon, 20 Jun 2011 12:12:48 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <19963.35531.684825.285975@xxxxxxxxxxxxxxxxxxxxxxxx>
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.DEB.2.00.1106071849290.12963@kaball-desktop> <m2n.s.1QU0lc-137774@xxxxxxxxxxxxxxxxxxxxxx> <19963.35531.684825.285975@xxxxxxxxxxxxxxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Alpine 2.00 (DEB 1167 2008-08-23)
On Fri, 17 Jun 2011, Ian Jackson wrote:
> stefano.stabellini@xxxxxxxxxxxxx writes ("[Xen-devel] [PATCH 1/3] x86: 
> calculate precisely the memory needed by init_memory_mapping"):
> > +   if (pgt_buf_end != pgt_buf_top)
> > +           printk(KERN_DEBUG "initial kernel pagetable allocation wasted 
> > %lx"
> > +                           " pages\n", pgt_buf_top - pgt_buf_end);
> 
> If (due to a bug) pgt_buf_end > pgt_buf_top, this will printk a
> message about wasting a negative number of pages, rather than
> crashing.  Is there something else that will catch this case ?

Thanks for reviewing this patch!

Yes, there is something else that catches this case: both the 32 bit
and the 64 bit versions of alloc_low_page contain this code:


unsigned long pfn = pgt_buf_end++;

if (pfn >= pgt_buf_top)
                panic("alloc_low_page: ran out of memory");


so we are safe from that point of view.

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