xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Ian Campbell <ian.campbell@citrix.com>
To: xen-devel@lists.xen.org
Cc: keir@xen.org, Ian Campbell <ian.campbell@citrix.com>,
	stefano.stabellini@eu.citrix.com, julien.grall@linaro.org,
	tim@xen.org, andre.przywara@linaro.org
Subject: [PATCH 5/7] xen: support RAM at addresses 0 and 4096
Date: Thu, 12 Sep 2013 13:42:53 +0100	[thread overview]
Message-ID: <1378989775-28294-5-git-send-email-ian.campbell@citrix.com> (raw)
In-Reply-To: <1378989755.10076.53.camel@kazak.uk.xensource.com>

Currently the mapping from pages to zones causes the page at zero to go into
zone -1 and the page at 4096 to go into zone 0, which is the Xen zone
(confusing various assertions).

Arrange instead for the mapping to be such that zone 0 is always reserved for
Xen and all other pages map to a zone >= 1.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Cc: keir@xen.org
---
 xen/common/page_alloc.c |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/xen/common/page_alloc.c b/xen/common/page_alloc.c
index 41251b2..e2cd139 100644
--- 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 + 1)
 
-#define bits_to_zone(b) (((b) < (PAGE_SHIFT + 1)) ? 0 : ((b) - PAGE_SHIFT - 1))
+#define bits_to_zone(b) (((b) < PAGE_SHIFT) ? 1 : ((b) - PAGE_SHIFT + 1 + 1))
 #define page_to_zone(pg) (is_xen_heap_page(pg) ? MEMZONE_XEN :  \
-                          (fls(page_to_mfn(pg)) - 1))
+                          (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];
-- 
1.7.10.4

  parent reply	other threads:[~2013-09-12 12:42 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-09-12 12:42 [PATCH 0/7] xen: arm: memory mangement fixes / improvements Ian Campbell
2013-09-12 12:42 ` [PATCH 1/7] xen/arm: ensure the xenheap is 32MB aligned Ian Campbell
2013-09-12 12:42 ` [PATCH 2/7] xen/arm: DOMHEAP_SECOND_PAGES is arm32 specific Ian Campbell
2013-09-12 12:42 ` [PATCH 3/7] xen/arm: Reserve FDT via early module mechanism Ian Campbell
2013-09-12 13:39   ` Julien Grall
2013-09-12 13:56     ` Ian Campbell
2013-09-12 12:42 ` [PATCH 4/7] xen/arm: cope with modules outside of "visible" RAM Ian Campbell
2013-09-12 12:42 ` Ian Campbell [this message]
2013-09-12 13:25   ` [PATCH 5/7] xen: support RAM at addresses 0 and 4096 Jan Beulich
2013-09-12 13:54     ` Ian Campbell
2013-09-13 11:20     ` Ian Campbell
2013-09-13 11:28       ` Keir Fraser
2013-09-12 12:42 ` [PATCH 6/7] xen/arm: Support dtb /memreserve/ regions Ian Campbell
2013-09-12 13:03   ` Julien Grall
2013-09-12 13:47     ` Ian Campbell
2013-09-12 12:42 ` [PATCH 7/7] xen/arm: rename boot misc region to boot reloc now it has a single purpose Ian Campbell

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1378989775-28294-5-git-send-email-ian.campbell@citrix.com \
    --to=ian.campbell@citrix.com \
    --cc=andre.przywara@linaro.org \
    --cc=julien.grall@linaro.org \
    --cc=keir@xen.org \
    --cc=stefano.stabellini@eu.citrix.com \
    --cc=tim@xen.org \
    --cc=xen-devel@lists.xen.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).