Skip to content

Commit

Permalink
xen: limit memory to architectural maximum
Browse files Browse the repository at this point in the history
When a pv-domain (including dom0) is started it tries to size it's
p2m list according to the maximum possible memory amount it ever can
achieve. Limit the initial maximum memory size to the architectural
limit of the hardware in order to avoid overflows during remapping
of memory.

This problem will occur when dom0 is started with an initial memory
size being a multiple of 1GB, but without specifying it's maximum
memory size. The kernel must be configured without
CONFIG_XEN_BALLOON_MEMORY_HOTPLUG for the problem to happen.

Reported-by: Roger Pau Monné <[email protected]>
Tested-by: Roger Pau Monné <[email protected]>
Signed-off-by: Juergen Gross <[email protected]>
Signed-off-by: David Vrabel <[email protected]>
  • Loading branch information
jgross1 authored and David Vrabel committed Sep 8, 2015
1 parent ab24507 commit cb9e444
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion arch/x86/xen/setup.c
Original file line number Diff line number Diff line change
Expand Up @@ -531,7 +531,7 @@ static unsigned long __init xen_get_pages_limit(void)
#ifdef CONFIG_X86_32
limit = GB(64) / PAGE_SIZE;
#else
limit = ~0ul;
limit = MAXMEM / PAGE_SIZE;
if (!xen_initial_domain() && xen_512gb_limit)
limit = GB(512) / PAGE_SIZE;
#endif
Expand Down

0 comments on commit cb9e444

Please sign in to comment.