Revert "x86, apic: Use logical flat on intel with <= 8 logical cpus"

Revert commit 2fbd07a5f5d1295fa9b0c0564ec27da7c276a75a, as this commit
breaks an IBM platform with quad-core Xeon cpu's.

According to Suresh, this might be an IBM platform issue, as on other
Intel platforms with <= 8 logical cpu's, logical flat mode works fine
irespective of physical apic id values (inline with the xapic
architecture).

Revert this for now because of the IBM platform breakage.

Another version will be re-submitted after the complete analysis.

Signed-off-by: Ananth N Mavinakayanahalli <ananth@in.ibm.com>
Acked-by: Suresh Siddha <suresh.b.siddha@intel.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

authored by Ananth N Mavinakayanahalli and committed by Linus Torvalds 066000dd 1b4d40a5

+22 -19
+18 -8
arch/x86/kernel/apic/apic.c
··· 62 /* 63 * The highest APIC ID seen during enumeration. 64 * 65 - * On AMD, 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 * ··· 1898 max_physical_apicid = apicid; 1899 1900 #ifdef CONFIG_X86_32 1901 - switch (boot_cpu_data.x86_vendor) { 1902 - case X86_VENDOR_INTEL: 1903 - if (num_processors > 8) 1904 def_to_bigsmp = 1; 1905 - break; 1906 - case X86_VENDOR_AMD: 1907 - if (max_physical_apicid >= 8) 1908 - def_to_bigsmp = 1; 1909 } 1910 #endif 1911
··· 62 /* 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 * ··· 1898 max_physical_apicid = apicid; 1899 1900 #ifdef CONFIG_X86_32 1901 + /* 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) { 1910 + case X86_VENDOR_INTEL: 1911 + if (!APIC_XAPIC(version)) { 1912 + def_to_bigsmp = 0; 1913 + break; 1914 + } 1915 + /* If P4 and above fall through */ 1916 + case X86_VENDOR_AMD: 1917 def_to_bigsmp = 1; 1918 + } 1919 } 1920 #endif 1921
+4 -11
arch/x86/kernel/apic/probe_64.c
··· 64 apic = &apic_x2apic_phys; 65 else 66 apic = &apic_x2apic_cluster; 67 } 68 #endif 69 70 if (apic == &apic_flat) { 71 - switch (boot_cpu_data.x86_vendor) { 72 - case X86_VENDOR_INTEL: 73 - if (num_processors > 8) 74 - apic = &apic_physflat; 75 - break; 76 - case X86_VENDOR_AMD: 77 - if (max_physical_apicid >= 8) 78 - apic = &apic_physflat; 79 - } 80 } 81 - 82 - printk(KERN_INFO "Setting APIC routing to %s\n", apic->name); 83 84 if (is_vsmp_box()) { 85 /* need to update phys_pkg_id */
··· 64 apic = &apic_x2apic_phys; 65 else 66 apic = &apic_x2apic_cluster; 67 + printk(KERN_INFO "Setting APIC routing to %s\n", apic->name); 68 } 69 #endif 70 71 if (apic == &apic_flat) { 72 + if (max_physical_apicid >= 8) 73 + apic = &apic_physflat; 74 + printk(KERN_INFO "Setting APIC routing to %s\n", apic->name); 75 } 76 77 if (is_vsmp_box()) { 78 /* need to update phys_pkg_id */