From mboxrd@z Thu Jan 1 00:00:00 1970 From: Konrad Rzeszutek Wilk Subject: Re: fix for "xen: use maximum reservation to limit amount of usable RAM" - patch titled: "xen/e820: if there is not dom0_mem, don't tweak extra_pages." Date: Tue, 13 Sep 2011 10:16:21 -0400 Message-ID: <20110913141621.GA25628@phenom.oracle.com> References: <20110912201319.GA11900@oracle.com> <4E6F2A0E.6040208@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Content-Disposition: inline In-Reply-To: <4E6F2A0E.6040208@citrix.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: David Vrabel Cc: "xen-devel@lists.xensource.com" List-Id: xen-devel@lists.xenproject.org On Tue, Sep 13, 2011 at 11:01:50AM +0100, David Vrabel wrote: > On 12/09/11 21:13, Konrad Rzeszutek Wilk wrote: > > .breaks one of my boxes (Core i3-2100), with Xen 4.1.1 (with and w/out the > > 23790 changset in it). > > > > I've traced it down to the fact that I booted my dom0 without > > dom0_mem=X flag with a machine that has more than 8GB. Weirdly enough > > I can only reproduce this under Intel boxes. > > > > Anyhow this patch fixes it for me. > > I think this patch is simpler. Does it fix the issue? Yes. Let me use that instead. > > diff --git a/arch/x86/xen/setup.c b/arch/x86/xen/setup.c > index c3b8d44..46d6d21 100644 > --- a/arch/x86/xen/setup.c > +++ b/arch/x86/xen/setup.c > @@ -306,10 +306,12 @@ char * __init xen_memory_setup(void) > sanitize_e820_map(e820.map, ARRAY_SIZE(e820.map), &e820.nr_map); > > extra_limit = xen_get_max_pages(); > - if (extra_limit >= max_pfn) > - extra_pages = extra_limit - max_pfn; > - else > - extra_pages = 0; > + if (max_pfn + extra_pages > extra_limit) { > + if (extra_limit > max_pfn) > + extra_pages = extra_limit - max_pfn; > + else > + extra_pages = 0; > + } > > extra_pages += xen_return_unused_memory(xen_start_info->nr_pages, &e820); > > David