x86, topology: Debug CPU0 hotplug
authorFenghua Yu <fenghua.yu@intel.com>
Tue, 13 Nov 2012 19:32:51 +0000 (11:32 -0800)
committerH. Peter Anvin <hpa@linux.intel.com>
Wed, 14 Nov 2012 23:28:11 +0000 (15:28 -0800)
commita71c8bc5dfefbbf80ef90739791554ef7ea4401b
treec45ca6284652a848876b2b2636c30a36111ec0b1
parent6f5298c2139b06925037490367906f3d73955b86
x86, topology: Debug CPU0 hotplug

CONFIG_DEBUG_HOTPLUG_CPU0 is for debugging the CPU0 hotplug feature. The switch
offlines CPU0 as soon as possible and boots userspace up with CPU0 offlined.
User can online CPU0 back after boot time. The default value of the switch is
off.

To debug CPU0 hotplug, you need to enable CPU0 offline/online feature by either
turning on CONFIG_BOOTPARAM_HOTPLUG_CPU0 during compilation or giving
cpu0_hotplug kernel parameter at boot.

It's safe and early place to take down CPU0 after all hotplug notifiers
are installed and SMP is booted.

Please note that some applications or drivers, e.g. some versions of udevd,
during boot time may put CPU0 online again in this CPU0 hotplug debug mode.

In this debug mode, setup_local_APIC() may report a warning on max_loops<=0
when CPU0 is onlined back after boot time. This is because pending interrupt in
IRR can not move to ISR. The warning is not CPU0 specfic and it can happen on
other CPUs as well. It is harmless except the first CPU0 online takes a bit
longer time. And so this debug mode is useful to expose this issue. I'll send
a seperate patch to fix this generic warning issue.

Signed-off-by: Fenghua Yu <fenghua.yu@intel.com>
Link: http://lkml.kernel.org/r/1352835171-3958-15-git-send-email-fenghua.yu@intel.com
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
arch/x86/Kconfig
arch/x86/include/asm/cpu.h
arch/x86/kernel/topology.c
arch/x86/power/cpu.c