]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
APIC routing fix
authorYinghai Lu <yhlu.kernel@gmail.com>
Fri, 12 Sep 2008 11:08:18 +0000 (13:08 +0200)
committerGreg Kroah-Hartman <gregkh@suse.de>
Thu, 9 Oct 2008 03:22:57 +0000 (20:22 -0700)
commit e0da33646826b66ef933d47ea2fb7a693fd849bf upstream

x86: introduce max_physical_apicid for bigsmp switching

a multi-socket test-system with 3 or 4 ioapics, when 4 dualcore cpus or
2 quadcore cpus installed, needs to switch to bigsmp or physflat.

CPU apic id is [4,11] instead of [0,7], and we need to check max apic
id instead of cpu numbers.

also add check for 32 bit when acpi is not compiled in or acpi=off.

Signed-off-by: Yinghai Lu <yhlu.kernel@gmail.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Cc: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
arch/x86/kernel/apic_32.c
arch/x86/kernel/apic_64.c
arch/x86/kernel/genapic_64.c
arch/x86/kernel/mpparse.c
arch/x86/kernel/setup.c
arch/x86/kernel/setup_32.c
arch/x86/mach-generic/bigsmp.c
include/asm-x86/mpspec.h

index 6815189e8450d6e8ab8cd0bd44a5a803a5e85bba..c17fdb0b70909831a899e222685aa45c627829ba 100644 (file)
@@ -1536,6 +1536,9 @@ void __cpuinit generic_processor_info(int apicid, int version)
                 */
                cpu = 0;
 
+       if (apicid > max_physical_apicid)
+               max_physical_apicid = apicid;
+
        /*
         * Would be preferable to switch to bigsmp when CONFIG_HOTPLUG_CPU=y
         * but we need to work other dependencies like SMP_SUSPEND etc
@@ -1543,7 +1546,7 @@ void __cpuinit generic_processor_info(int apicid, int version)
         * if (CPU_HOTPLUG_ENABLED || num_processors > 8)
         *       - Ashok Raj <ashok.raj@intel.com>
         */
-       if (num_processors > 8) {
+       if (max_physical_apicid >= 8) {
                switch (boot_cpu_data.x86_vendor) {
                case X86_VENDOR_INTEL:
                        if (!APIC_XAPIC(version)) {
index 0633cfd0dc291a1310f0632e1012cf663b5e89a9..8472bdfd5231de266864fb3810a411b7d2362523 100644 (file)
@@ -1090,6 +1090,9 @@ void __cpuinit generic_processor_info(int apicid, int version)
                 */
                cpu = 0;
        }
+       if (apicid > max_physical_apicid)
+               max_physical_apicid = apicid;
+
        /* are we being called early in kernel startup? */
        if (x86_cpu_to_apicid_early_ptr) {
                u16 *cpu_to_apicid = x86_cpu_to_apicid_early_ptr;
index cbaaf69bedb29c92055e2272a12efba7f49f9ee1..1fa8be5bd217b5c45a649e6745b847567a9553f6 100644 (file)
@@ -51,7 +51,7 @@ void __init setup_apic_routing(void)
        else
 #endif
 
-       if (num_possible_cpus() <= 8)
+       if (max_physical_apicid < 8)
                genapic = &apic_flat;
        else
                genapic = &apic_physflat;
index 404683b94e79592c69e04930ed385056f8f5861c..d5b8691fff4db379cf4ee08328fc3a68765919ce 100644 (file)
@@ -402,6 +402,11 @@ static int __init smp_read_mpc(struct mp_config_table *mpc, unsigned early)
                ++mpc_record;
 #endif
        }
+
+#ifdef CONFIG_X86_GENERICARCH
+       generic_bigsmp_probe();
+#endif
+
        setup_apic_routing();
        if (!num_processors)
                printk(KERN_ERR "MPTABLE: no processors registered!\n");
index 6f80b852a1961a6b496bc2404c5194769557d97a..03e357a1954995b6eeb086a18af38b42eb7256ea 100644 (file)
@@ -17,6 +17,7 @@ unsigned int num_processors;
 unsigned disabled_cpus __cpuinitdata;
 /* Processor that is doing the boot up */
 unsigned int boot_cpu_physical_apicid = -1U;
+unsigned int max_physical_apicid;
 EXPORT_SYMBOL(boot_cpu_physical_apicid);
 
 DEFINE_PER_CPU(u16, x86_cpu_to_apicid) = BAD_APICID;
index 5a2f8e0638875a348fcf415bef070fbece342fa5..3bf22f030d7869dbc9dabc4bb2d3077eb3769f47 100644 (file)
@@ -914,6 +914,12 @@ void __init setup_arch(char **cmdline_p)
 
 #ifdef CONFIG_ACPI
        acpi_boot_init();
+#endif
+
+#ifdef CONFIG_X86_LOCAL_APIC
+       if (smp_found_config)
+               get_smp_config();
+#endif
 
 #if defined(CONFIG_SMP) && defined(CONFIG_X86_PC)
        if (def_to_bigsmp)
@@ -921,11 +927,6 @@ void __init setup_arch(char **cmdline_p)
                        "CONFIG_X86_PC cannot handle it.\nUse "
                        "CONFIG_X86_GENERICARCH or CONFIG_X86_BIGSMP.\n");
 #endif
-#endif
-#ifdef CONFIG_X86_LOCAL_APIC
-       if (smp_found_config)
-               get_smp_config();
-#endif
 
        e820_register_memory();
        e820_mark_nosave_regions();
index 95fc463056d0dc92345aaee6cbd0b5ef148add51..2a243019acae830ce08c6688379aa71733c171d3 100644 (file)
@@ -48,7 +48,7 @@ static const struct dmi_system_id bigsmp_dmi_table[] = {
 static int probe_bigsmp(void)
 {
        if (def_to_bigsmp)
-       dmi_bigsmp = 1;
+               dmi_bigsmp = 1;
        else
                dmi_check_system(bigsmp_dmi_table);
        return dmi_bigsmp;
index 57a991b9c0530a0f82268853c74a6feb2411b883..4c7558731a3c73e0c6f04ad5f5c29ae15ae0b8b6 100644 (file)
@@ -35,6 +35,7 @@ extern DECLARE_BITMAP(mp_bus_not_pci, MAX_MP_BUSSES);
 extern int mp_bus_id_to_pci_bus[MAX_MP_BUSSES];
 
 extern unsigned int boot_cpu_physical_apicid;
+extern unsigned int max_physical_apicid;
 extern int smp_found_config;
 extern int mpc_default_type;
 extern unsigned long mp_lapic_addr;