From: Konrad Rzeszutek Wilk Date: Tue, 5 Jul 2016 16:54:55 +0000 (-0400) Subject: xen/acpi: Disable ACPI memory hotplug when running under Xen. X-Git-Tag: v4.1.12-92~117^2 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=358d3785b54a464a62d07d4ece2b4d7df05aa381;p=users%2Fjedix%2Flinux-maple.git xen/acpi: Disable ACPI memory hotplug when running under Xen. This came about as we back-ported f5775e0b6116b7e2425ccf535243b21768566d87 "x86/xen: discard RAM regions above the maximum reservation". where on certain very specific Intel platforms (which can do memory hotplug) we would crash during bootup. The reason for the failure is that we use the baremetal mechanism to do memory hotplug - which is not appropiate. We should use the xen-acpi-memory.c one, but .. config XEN_ACPI_HOTPLUG_MEMORY tristate "Xen ACPI memory hotplug" depends on XEN_DOM0 && XEN_STUB && ACPI and config XEN_STUB bool "Xen stub drivers" depends on XEN && X86_64 && BROKEN See the 'BROKEN'? That came about 76fc253723add627cf28c09c79fb67e71f9e4782 "xen/acpi-stub: Disable it b/c the acpi_processor_add is no longer called.": With the Xen ACPI stub code (CONFIG_XEN_STUB=y) enabled, the power C and P states are no longer uploaded to the hypervisor. .. Fixing 76fc253723add627cf28c09c79fb67e71f9e4782 would be nice, but that is some upstream work to get done and we don't have the time. In the meantime we can: 1) Revert f5775e0b6116b7e2425ccf535243b21768566d87 I would prefer not as we would diverge from upstream when it comes to backporting features. 2) Simulate acpi_no_memhotplug being passed on the Linux command line. That is much easier, and we can carry this patch until upstream gets a proper fix. The patch "solves" the regression be implementing 2). Reported-and-Tested-by: Deepak Patel Signed-off-by: Konrad Rzeszutek Wilk OraBug:23735125 --- diff --git a/arch/x86/xen/setup.c b/arch/x86/xen/setup.c index d1fac0e53d570..cbd4a9111bcb9 100644 --- a/arch/x86/xen/setup.c +++ b/arch/x86/xen/setup.c @@ -1050,6 +1050,9 @@ void __init xen_pvmmu_arch_setup(void) xen_enable_syscall(); } +#ifdef CONFIG_ACPI_HOTPLUG_MEMORY +extern bool acpi_no_memhotplug; +#endif /* This function is not called for HVM domains */ void __init xen_arch_setup(void) { @@ -1076,4 +1079,7 @@ void __init xen_arch_setup(void) #ifdef CONFIG_NUMA numa_off = 1; #endif +#ifdef CONFIG_ACPI_HOTPLUG_MEMORY + acpi_no_memhotplug = true; +#endif } diff --git a/drivers/acpi/acpi_memhotplug.c b/drivers/acpi/acpi_memhotplug.c index ee28f4d15625f..2cd89f41c17c3 100644 --- a/drivers/acpi/acpi_memhotplug.c +++ b/drivers/acpi/acpi_memhotplug.c @@ -362,7 +362,7 @@ static void acpi_memory_device_remove(struct acpi_device *device) acpi_memory_device_free(mem_device); } -static bool __initdata acpi_no_memhotplug; +bool __initdata acpi_no_memhotplug; void __init acpi_memory_hotplug_init(void) {