]> xenbits.xensource.com Git - people/pauldu/xen.git/commitdiff
xen/page_alloc: statically allocate bootmem_region_list
authorHongyan Xia <hongyax@amazon.com>
Tue, 1 Oct 2019 09:13:20 +0000 (10:13 +0100)
committerPaul Durrant <pdurrant@amazon.com>
Mon, 2 Dec 2019 10:22:36 +0000 (10:22 +0000)
This is to avoid all sorts of bootstrapping problems, especially when
we do not have a direct map.

Signed-off-by: Hongyan Xia <hongyax@amazon.com>
xen/common/page_alloc.c

index 7cb1bd368b6c2d96d3f8fcf4de15e54dda2ede16..7b478acbbd36d360dbd43def4194cb8774d52cd0 100644 (file)
@@ -244,9 +244,10 @@ PAGE_LIST_HEAD(page_broken_list);
  */
 mfn_t first_valid_mfn = INVALID_MFN_INITIALIZER;
 
+static char __initdata bootmem_page[PAGE_SIZE];
 static struct bootmem_region {
     unsigned long s, e; /* MFNs @s through @e-1 inclusive are free */
-} *__initdata bootmem_region_list;
+} *__initdata bootmem_region_list = (struct bootmem_region *)bootmem_page;
 static unsigned int __initdata nr_bootmem_regions;
 
 struct scrub_region {
@@ -263,9 +264,6 @@ static void __init bootmem_region_add(unsigned long s, unsigned long e)
 {
     unsigned int i;
 
-    if ( (bootmem_region_list == NULL) && (s < e) )
-        bootmem_region_list = mfn_to_virt(s++);
-
     if ( s >= e )
         return;
 
@@ -1869,7 +1867,6 @@ void __init end_boot_allocator(void)
             init_heap_pages(mfn_to_page(_mfn(r->s)), r->e - r->s);
     }
     nr_bootmem_regions = 0;
-    init_heap_pages(virt_to_page(bootmem_region_list), 1);
 
     if ( !dma_bitsize && (num_online_nodes() > 1) )
         dma_bitsize = arch_get_dma_bitsize();