Skip to contentSkip to conversation

xen: limit memory to architectural maximum

PATCH Applied Juergen Gross 3 participants 3 messages Sep 4, 2015

Subsystems (2)
lore
Share & tools
lore

Juergen Gross

author maintainer
#0 lore raw

PATCH 1/1 xen: limit memory to architectural maximum

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.

---
 arch/x86/xen/setup.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/x86/xen/setup.c +1 -1
index 4765285..f5ef674 100644
@@ -537,7 +537,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
Signature · 1 line
2.1.4
Tested-by on v1 1/1
#1 lore raw

El 04/09/15 a les 14.18, Juergen Gross ha escrit:

Quoted 6 lines

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.

Quoted 7 lines

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.

Applied
#2 lore raw
In reply to Juergen Gross
Quoted 10 lines · Juergen Gross

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.

Applied to for-linus-4.3, thanks.

David