diff options
author | Ian Campbell <ian.campbell@citrix.com> | 2013-09-26 12:35:42 +0100 |
---|---|---|
committer | Ian Campbell <ian.campbell@citrix.com> | 2013-09-26 16:21:53 +0100 |
commit | 1aac966e24e92d664089cfa075f21bbb570a7d58 (patch) | |
tree | 4a5ef8a8fef3827f3b7a5aeef2c28df795848318 /xen | |
parent | 41208de9b1f52a1d865649ed3d4ba0cfe74f9f9f (diff) | |
download | xen-1aac966e24e92d664089cfa075f21bbb570a7d58.tar.gz xen-1aac966e24e92d664089cfa075f21bbb570a7d58.tar.bz2 xen-1aac966e24e92d664089cfa075f21bbb570a7d58.zip |
xen: support RAM at addresses 0 and 4096
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>
Acked-by: Keir Fraser <keir@xen.org>
Cc: jbeulich@suse.com
Acked-by: Tim Deegan <tim@xen.org>
Diffstat (limited to 'xen')
-rw-r--r-- | xen/common/page_alloc.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/xen/common/page_alloc.c b/xen/common/page_alloc.c index 41251b2c0c..fb8187bb35 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) -#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)) 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]; |