Skip to content

Commit f5775e0

Browse files
author
David Vrabel
committed
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: David Vrabel <[email protected]> Reviewed-by: Daniel Kiper <[email protected]>
1 parent f6a6cb1 commit f5775e0

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

arch/x86/xen/setup.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -829,6 +829,8 @@ char * __init xen_memory_setup(void)
829829
addr = xen_e820_map[0].addr;
830830
size = xen_e820_map[0].size;
831831
while (i < xen_e820_map_entries) {
832+
bool discard = false;
833+
832834
chunk_size = size;
833835
type = xen_e820_map[i].type;
834836

@@ -843,10 +845,11 @@ char * __init xen_memory_setup(void)
843845
xen_add_extra_mem(pfn_s, n_pfns);
844846
xen_max_p2m_pfn = pfn_s + n_pfns;
845847
} else
846-
type = E820_UNUSABLE;
848+
discard = true;
847849
}
848850

849-
xen_align_and_add_e820_region(addr, chunk_size, type);
851+
if (!discard)
852+
xen_align_and_add_e820_region(addr, chunk_size, type);
850853

851854
addr += chunk_size;
852855
size -= chunk_size;

0 commit comments

Comments
 (0)