Commit f5775e0b authored by David Vrabel's avatar David Vrabel

x86/xen: discard RAM regions above the maximum reservation

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: default avatarDavid Vrabel <david.vrabel@citrix.com>
Reviewed-by: default avatarDaniel Kiper <daniel.kiper@oracle.com>
parent f6a6cb1a
...@@ -829,6 +829,8 @@ char * __init xen_memory_setup(void) ...@@ -829,6 +829,8 @@ char * __init xen_memory_setup(void)
addr = xen_e820_map[0].addr; addr = xen_e820_map[0].addr;
size = xen_e820_map[0].size; size = xen_e820_map[0].size;
while (i < xen_e820_map_entries) { while (i < xen_e820_map_entries) {
bool discard = false;
chunk_size = size; chunk_size = size;
type = xen_e820_map[i].type; type = xen_e820_map[i].type;
...@@ -843,9 +845,10 @@ char * __init xen_memory_setup(void) ...@@ -843,9 +845,10 @@ char * __init xen_memory_setup(void)
xen_add_extra_mem(pfn_s, n_pfns); xen_add_extra_mem(pfn_s, n_pfns);
xen_max_p2m_pfn = pfn_s + n_pfns; xen_max_p2m_pfn = pfn_s + n_pfns;
} else } else
type = E820_UNUSABLE; discard = true;
} }
if (!discard)
xen_align_and_add_e820_region(addr, chunk_size, type); xen_align_and_add_e820_region(addr, chunk_size, type);
addr += chunk_size; addr += chunk_size;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment