]> xenbits.xensource.com Git - people/julieng/linux-arm.git/commitdiff
x86/xen: discard RAM regions above the maximum reservation
authorDavid Vrabel <david.vrabel@citrix.com>
Mon, 19 Jan 2015 11:08:05 +0000 (11:08 +0000)
committerDavid Vrabel <david.vrabel@citrix.com>
Tue, 29 Sep 2015 16:00:01 +0000 (17:00 +0100)
During setup, discard RAM regions that are above the maximum
reservation (instead of marking them as E820_UNUSABLE).  This allows
hotplug memory to be placed at these addresses.

Signed-off-by: David Vrabel <david.vrabel@citrix.com>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
arch/x86/xen/setup.c

index f5ef6746d47a0ee36f6b0a11edd0c49cbcf3590a..e1a6bc42fe9cc5e8be65198f9cafa96628f7d29c 100644 (file)
@@ -829,6 +829,8 @@ char * __init xen_memory_setup(void)
        addr = xen_e820_map[0].addr;
        size = xen_e820_map[0].size;
        while (i < xen_e820_map_entries) {
+               bool discard = false;
+
                chunk_size = size;
                type = xen_e820_map[i].type;
 
@@ -843,10 +845,11 @@ char * __init xen_memory_setup(void)
                                xen_add_extra_mem(pfn_s, n_pfns);
                                xen_max_p2m_pfn = pfn_s + n_pfns;
                        } else
-                               type = E820_UNUSABLE;
+                               discard = true;
                }
 
-               xen_align_and_add_e820_region(addr, chunk_size, type);
+               if (!discard)
+                       xen_align_and_add_e820_region(addr, chunk_size, type);
 
                addr += chunk_size;
                size -= chunk_size;