x86, apic: Don't use logical-flat mode when CPU hotplug may exceed 8 CPUs
commit681ee44d40d7c93b42118320e4620d07d8704fd6
authorSuresh Siddha <suresh.b.siddha@intel.com>
Wed, 10 Feb 2010 02:01:44 +0000 (9 18:01 -0800)
committerH. Peter Anvin <hpa@zytor.com>
Wed, 10 Feb 2010 04:51:11 +0000 (9 20:51 -0800)
treea6bbec20a6310b8ead96807b2e7f381873b6443b
parentcf9db6c41f739a294286847aab1e85f39aef1781
x86, apic: Don't use logical-flat mode when CPU hotplug may exceed 8 CPUs

We need to fall back from logical-flat APIC mode to physical-flat mode
when we have more than 8 CPUs.  However, in the presence of CPU
hotplug(with bios listing not enabled but possible cpus as disabled cpus in
MADT), we have to consider the number of possible CPUs rather than
the number of current CPUs; otherwise we may cross the 8-CPU boundary
when CPUs are added later.

32bit apic code can use more cleanups (like the removal of vendor checks in
32bit default_setup_apic_routing()) and more unifications with 64bit code.
Yinghai has some patches in works already. This patch addresses the boot issue
that is reported in the virtualization guest context.

[ hpa: incorporated function annotation feedback from Yinghai Lu ]

Signed-off-by: Suresh Siddha <suresh.b.siddha@intel.com>
LKML-Reference: <1265767304.2833.19.camel@sbs-t61.sc.intel.com>
Acked-by: Shaohui Zheng <shaohui.zheng@intel.com>
Reviewed-by: Yinghai Lu <yinghai@kernel.org>
Cc: <stable@kernel.org>
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
arch/x86/kernel/acpi/boot.c
arch/x86/kernel/apic/apic.c
arch/x86/kernel/apic/probe_32.c
arch/x86/kernel/apic/probe_64.c
arch/x86/kernel/mpparse.c
arch/x86/kernel/smpboot.c