From: Ian Campbell Subject: Re: [PATCH v2 9/9] xen: support RAM at addresses 0 and 4096 Date: Fri, 13 Sep 2013 13:23:18 +0100 Message-ID: <1379074998.19256.58.camel@kazak.uk.xensource.com> References: <1379072409.19256.40.camel@kazak.uk.xensource.com> <1379072437-28099-9-git-send-email-ian.campbell@citrix.com> <523319B802000078000F3160@nat28.tlf.novell.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1VKSPD-0000LU-9j for xen-devel@lists.xenproject.org; Fri, 13 Sep 2013 12:23:23 +0000 In-Reply-To: <523319B802000078000F3160@nat28.tlf.novell.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Jan Beulich Cc: keir@xen.org, stefano.stabellini@eu.citrix.com, julien.grall@linaro.org, tim@xen.org, andre.przywara@linaro.org, xen-devel List-Id: xen-devel@lists.xenproject.org On Fri, 2013-09-13 at 12:57 +0100, Jan Beulich wrote: > >>> On 13.09.13 at 13:40, Ian Campbell wrote: > > --- a/xen/common/page_alloc.c > > +++ b/xen/common/page_alloc.c > > @@ -257,11 +257,11 @@ unsigned long __init alloc_boot_pages( > > */ > > > > #define MEMZONE_XEN 0 > > -#define NR_ZONES (PADDR_BITS - PAGE_SHIFT) > > +#define NR_ZONES (PADDR_BITS - PAGE_SHIFT + 1) > > > > -#define bits_to_zone(b) (((b) < (PAGE_SHIFT + 1)) ? 0 : ((b) - PAGE_SHIFT - 1)) > > +#define bits_to_zone(b) (((b) < (PAGE_SHIFT + 1)) ? 1 : ((b) - PAGE_SHIFT)) > > #define page_to_zone(pg) (is_xen_heap_page(pg) ? MEMZONE_XEN : \ > > - (fls(page_to_mfn(pg)) - 1)) > > + (fls(page_to_mfn(pg)) ? : 1)) > > So this puts both $subject pages into zone 1. If that's intended, > and you verified that it's consistent (namely in that zone 1 now > will have twice as many pages as one would expect), Yes, they both end up in zone 1, I figured it was a minor quirk which was unlikely to make any difference in practice. Ian.