From: kaf24@firebug.cl.cam.ac.uk Date: Fri, 9 Jun 2006 15:18:40 +0000 (+0100) Subject: [LINUX][X86/64] Initialise pages outside initial allocation so that X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~15972^2~25 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=876b2167795dec7a3f51a458ef8359e62cff1bc8;p=xen.git [LINUX][X86/64] Initialise pages outside initial allocation so that they are picked up by the balloon driver. From: Jan Beulich Signed-off-by: Keir Fraser --- diff --git a/linux-2.6-xen-sparse/arch/x86_64/mm/init-xen.c b/linux-2.6-xen-sparse/arch/x86_64/mm/init-xen.c index fe41bfacc3..4ee3b3b1df 100644 --- a/linux-2.6-xen-sparse/arch/x86_64/mm/init-xen.c +++ b/linux-2.6-xen-sparse/arch/x86_64/mm/init-xen.c @@ -882,6 +882,7 @@ static struct kcore_list kcore_mem, kcore_vmalloc, kcore_kernel, kcore_modules, void __init mem_init(void) { long codesize, reservedpages, datasize, initsize; + unsigned long pfn; contiguous_bitmap = alloc_bootmem_low_pages( (end_pfn + 2*BITS_PER_LONG) >> 3); @@ -910,6 +911,12 @@ void __init mem_init(void) #else totalram_pages = free_all_bootmem(); #endif + /* XEN: init and count pages outside initial allocation. */ + for (pfn = xen_start_info->nr_pages; pfn < max_pfn; pfn++) { + ClearPageReserved(&mem_map[pfn]); + set_page_count(&mem_map[pfn], 1); + totalram_pages++; + } reservedpages = end_pfn - totalram_pages - e820_hole_size(0, end_pfn); after_bootmem = 1;