[patch 0/2] cpu/hotplug: Prevent damage with SMP=y and HOTPLUG_CPU=n

From: Thomas Gleixner
Date: Tue Mar 26 2019 - 12:40:05 EST


Tianyu reported a crash with SMP=y and HOTPLUG_CPU=n plus 'nosmt' on the
kernel command line.

https://lkml.kernel.org/r/1553521883-20868-1-git-send-email-Tianyu.Lan@xxxxxxxxxxxxx

The reason is a bug in the hotplug code which does not handle the fact,
that HOTPLUG_CPU=n cannot tear down a CPU completely.

Unfortunately HOTPLUG_CPU cannot be enforced as some architectures do not
support it at all.

The fix is only a workaround because a full solution is not possible due to
the limitations of HOTPLUG_CPU=n. So the CPU stays around in an undead state.

As 'nosmt' has become popular recently, the proper solution for X86 is to
enforce HOTPLUG_CPU when SMP is enabled.

Thanks,

tglx
----
arch/x86/Kconfig | 8 +-------
kernel/cpu.c | 20 ++++++++++++++++++--
2 files changed, 19 insertions(+), 9 deletions(-)