From mboxrd@z Thu Jan 1 00:00:00 1970 From: Keir Fraser Subject: Re: [PATCH 5/7] xen: support RAM at addresses 0 and 4096 Date: Fri, 13 Sep 2013 04:28:51 -0700 Message-ID: References: <1379071244.19256.34.camel@kazak.uk.xensource.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta4.messagelabs.com ([85.158.143.247]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1VKRYd-0004HY-ML for xen-devel@lists.xenproject.org; Fri, 13 Sep 2013 11:29:03 +0000 Received: by mail-pd0-f181.google.com with SMTP id g10so1124682pdj.26 for ; Fri, 13 Sep 2013 04:29:00 -0700 (PDT) In-Reply-To: <1379071244.19256.34.camel@kazak.uk.xensource.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: Ian Campbell , Jan Beulich Cc: xen-devel , julien.grall@linaro.org, tim@xen.org, andre.przywara@linaro.org, stefano.stabellini@eu.citrix.com List-Id: xen-devel@lists.xenproject.org On 13/09/2013 04:20, "Ian Campbell" wrote: > Actually, if I don't make a mess of my arithmetic then I don't think > this is needed, at least not for correctness. > > page_to_zone() is still wrong for page 0, but that was true with the > previous version too, hence the checks to avoid adding page 0 to any > heap. > > The difference is that it now ends up in zone 0 (Xen, bad) instead of > zone -1 (even worse!). Even that could be solved with this extra hunk > (which would mean we could drop all the checks in init_*_pages from > below too): > > @@ -268,7 +267,7 @@ unsigned long __init alloc_boot_pages( > > #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)))) > + (fls(page_to_mfn(pg)) ? : 1)) > > typedef struct page_list_head > heap_by_zone_and_order_t[NR_ZONES][MAX_ORDER+1]; > static heap_by_zone_and_order_t *_heap[MAX_NUMNODES]; > > What do you think? Yeah, looks good! -- Keir