aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorSuresh Siddha <suresh.b.siddha@intel.com>2010-01-18 15:10:49 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2010-01-18 17:15:28 -0500
commitbb668da6d6f2bec8a63838c098d9515eccb22cc4 (patch)
treed41b25f7f9a8dcfcfeea13be8035799f3e154216 /arch
parentdfea91d5a7c795fd6f4e1a97489a98e4e767463e (diff)
x86, apic: use logical flat for systems with <= 8 logical cpus
We can use logical flat mode if there are <= 8 logical cpu's (irrespective of physical apic id values). This will enable simplified and efficient IPI and device interrupt routing on such platforms. This has been tested to work on both Intel and AMD platforms. Exceptions like IBM summit platform which can't use logical flat mode are addressed by using OEM platform checks. Signed-off-by: Suresh Siddha <suresh.b.siddha@intel.com> Signed-off-by: Yinghai Lu <yinghai@kernel.org> Cc: Ananth N Mavinakayanahalli <ananth@in.ibm.com> Cc: Chris McDermott <lcm@linux.vnet.ibm.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'arch')
-rw-r--r--arch/x86/kernel/apic/apic.c15
-rw-r--r--arch/x86/kernel/apic/probe_64.c8
2 files changed, 4 insertions, 19 deletions
diff --git a/arch/x86/kernel/apic/apic.c b/arch/x86/kernel/apic/apic.c
index e80f291472a4..3987e4408f75 100644
--- a/arch/x86/kernel/apic/apic.c
+++ b/arch/x86/kernel/apic/apic.c
@@ -61,12 +61,6 @@ unsigned int boot_cpu_physical_apicid = -1U;
61 61
62/* 62/*
63 * The highest APIC ID seen during enumeration. 63 * The highest APIC ID seen during enumeration.
64 *
65 * This determines the messaging protocol we can use: if all APIC IDs
66 * are in the 0 ... 7 range, then we can use logical addressing which
67 * has some performance advantages (better broadcasting).
68 *
69 * If there's an APIC ID above 8, we use physical addressing.
70 */ 64 */
71unsigned int max_physical_apicid; 65unsigned int max_physical_apicid;
72 66
@@ -1898,14 +1892,7 @@ void __cpuinit generic_processor_info(int apicid, int version)
1898 max_physical_apicid = apicid; 1892 max_physical_apicid = apicid;
1899 1893
1900#ifdef CONFIG_X86_32 1894#ifdef CONFIG_X86_32
1901 /* 1895 if (num_processors > 8) {
1902 * Would be preferable to switch to bigsmp when CONFIG_HOTPLUG_CPU=y
1903 * but we need to work other dependencies like SMP_SUSPEND etc
1904 * before this can be done without some confusion.
1905 * if (CPU_HOTPLUG_ENABLED || num_processors > 8)
1906 * - Ashok Raj <ashok.raj@intel.com>
1907 */
1908 if (max_physical_apicid >= 8) {
1909 switch (boot_cpu_data.x86_vendor) { 1896 switch (boot_cpu_data.x86_vendor) {
1910 case X86_VENDOR_INTEL: 1897 case X86_VENDOR_INTEL:
1911 if (!APIC_XAPIC(version)) { 1898 if (!APIC_XAPIC(version)) {
diff --git a/arch/x86/kernel/apic/probe_64.c b/arch/x86/kernel/apic/probe_64.c
index 65edc180fc82..450fe2064a14 100644
--- a/arch/x86/kernel/apic/probe_64.c
+++ b/arch/x86/kernel/apic/probe_64.c
@@ -64,15 +64,13 @@ void __init default_setup_apic_routing(void)
64 apic = &apic_x2apic_phys; 64 apic = &apic_x2apic_phys;
65 else 65 else
66 apic = &apic_x2apic_cluster; 66 apic = &apic_x2apic_cluster;
67 printk(KERN_INFO "Setting APIC routing to %s\n", apic->name);
68 } 67 }
69#endif 68#endif
70 69
71 if (apic == &apic_flat) { 70 if (apic == &apic_flat && num_processors > 8)
72 if (max_physical_apicid >= 8)
73 apic = &apic_physflat; 71 apic = &apic_physflat;
74 printk(KERN_INFO "Setting APIC routing to %s\n", apic->name); 72
75 } 73 printk(KERN_INFO "Setting APIC routing to %s\n", apic->name);
76 74
77 if (is_vsmp_box()) { 75 if (is_vsmp_box()) {
78 /* need to update phys_pkg_id */ 76 /* need to update phys_pkg_id */