aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86
diff options
context:
space:
mode:
authorYinghai Lu <yhlu.kernel@gmail.com>2008-06-08 21:29:22 -0400
committerIngo Molnar <mingo@elte.hu>2008-06-10 05:32:09 -0400
commite0da33646826b66ef933d47ea2fb7a693fd849bf (patch)
tree398d86b96531e574c4710ea1538806b7e0ae0fef /arch/x86
parentc3ff01672a23fabb40d4b80ff25a845582fd07c2 (diff)
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>
Diffstat (limited to 'arch/x86')
-rw-r--r--arch/x86/kernel/apic_32.c5
-rw-r--r--arch/x86/kernel/apic_64.c3
-rw-r--r--arch/x86/kernel/genapic_64.c2
-rw-r--r--arch/x86/kernel/mpparse.c5
-rw-r--r--arch/x86/kernel/setup.c1
-rw-r--r--arch/x86/kernel/setup_32.c11
-rw-r--r--arch/x86/mach-generic/bigsmp.c2
7 files changed, 20 insertions, 9 deletions
diff --git a/arch/x86/kernel/apic_32.c b/arch/x86/kernel/apic_32.c
index c304759f0834..954d67931a50 100644
--- a/arch/x86/kernel/apic_32.c
+++ b/arch/x86/kernel/apic_32.c
@@ -1518,6 +1518,9 @@ void __cpuinit generic_processor_info(int apicid, int version)
1518 */ 1518 */
1519 cpu = 0; 1519 cpu = 0;
1520 1520
1521 if (apicid > max_physical_apicid)
1522 max_physical_apicid = apicid;
1523
1521 /* 1524 /*
1522 * Would be preferable to switch to bigsmp when CONFIG_HOTPLUG_CPU=y 1525 * Would be preferable to switch to bigsmp when CONFIG_HOTPLUG_CPU=y
1523 * but we need to work other dependencies like SMP_SUSPEND etc 1526 * but we need to work other dependencies like SMP_SUSPEND etc
@@ -1525,7 +1528,7 @@ void __cpuinit generic_processor_info(int apicid, int version)
1525 * if (CPU_HOTPLUG_ENABLED || num_processors > 8) 1528 * if (CPU_HOTPLUG_ENABLED || num_processors > 8)
1526 * - Ashok Raj <ashok.raj@intel.com> 1529 * - Ashok Raj <ashok.raj@intel.com>
1527 */ 1530 */
1528 if (num_processors > 8) { 1531 if (max_physical_apicid >= 8) {
1529 switch (boot_cpu_data.x86_vendor) { 1532 switch (boot_cpu_data.x86_vendor) {
1530 case X86_VENDOR_INTEL: 1533 case X86_VENDOR_INTEL:
1531 if (!APIC_XAPIC(version)) { 1534 if (!APIC_XAPIC(version)) {
diff --git a/arch/x86/kernel/apic_64.c b/arch/x86/kernel/apic_64.c
index 54087f920f2f..1872555b98a3 100644
--- a/arch/x86/kernel/apic_64.c
+++ b/arch/x86/kernel/apic_64.c
@@ -1093,6 +1093,9 @@ void __cpuinit generic_processor_info(int apicid, int version)
1093 */ 1093 */
1094 cpu = 0; 1094 cpu = 0;
1095 } 1095 }
1096 if (apicid > max_physical_apicid)
1097 max_physical_apicid = apicid;
1098
1096 /* are we being called early in kernel startup? */ 1099 /* are we being called early in kernel startup? */
1097 if (x86_cpu_to_apicid_early_ptr) { 1100 if (x86_cpu_to_apicid_early_ptr) {
1098 u16 *cpu_to_apicid = x86_cpu_to_apicid_early_ptr; 1101 u16 *cpu_to_apicid = x86_cpu_to_apicid_early_ptr;
diff --git a/arch/x86/kernel/genapic_64.c b/arch/x86/kernel/genapic_64.c
index cbaaf69bedb2..1fa8be5bd217 100644
--- a/arch/x86/kernel/genapic_64.c
+++ b/arch/x86/kernel/genapic_64.c
@@ -51,7 +51,7 @@ void __init setup_apic_routing(void)
51 else 51 else
52#endif 52#endif
53 53
54 if (num_possible_cpus() <= 8) 54 if (max_physical_apicid < 8)
55 genapic = &apic_flat; 55 genapic = &apic_flat;
56 else 56 else
57 genapic = &apic_physflat; 57 genapic = &apic_physflat;
diff --git a/arch/x86/kernel/mpparse.c b/arch/x86/kernel/mpparse.c
index b4a950da2f97..7591325e616d 100644
--- a/arch/x86/kernel/mpparse.c
+++ b/arch/x86/kernel/mpparse.c
@@ -473,6 +473,11 @@ static int __init smp_read_mpc(struct mp_config_table *mpc, unsigned early)
473 ++mpc_record; 473 ++mpc_record;
474#endif 474#endif
475 } 475 }
476
477#ifdef CONFIG_X86_GENERICARCH
478 generic_bigsmp_probe();
479#endif
480
476 setup_apic_routing(); 481 setup_apic_routing();
477 if (!num_processors) 482 if (!num_processors)
478 printk(KERN_ERR "MPTABLE: no processors registered!\n"); 483 printk(KERN_ERR "MPTABLE: no processors registered!\n");
diff --git a/arch/x86/kernel/setup.c b/arch/x86/kernel/setup.c
index 0a281f2c7157..45a5e247d450 100644
--- a/arch/x86/kernel/setup.c
+++ b/arch/x86/kernel/setup.c
@@ -17,6 +17,7 @@ unsigned int num_processors;
17unsigned disabled_cpus __cpuinitdata; 17unsigned disabled_cpus __cpuinitdata;
18/* Processor that is doing the boot up */ 18/* Processor that is doing the boot up */
19unsigned int boot_cpu_physical_apicid = -1U; 19unsigned int boot_cpu_physical_apicid = -1U;
20unsigned int max_physical_apicid;
20EXPORT_SYMBOL(boot_cpu_physical_apicid); 21EXPORT_SYMBOL(boot_cpu_physical_apicid);
21 22
22DEFINE_PER_CPU(u16, x86_cpu_to_apicid) = BAD_APICID; 23DEFINE_PER_CPU(u16, x86_cpu_to_apicid) = BAD_APICID;
diff --git a/arch/x86/kernel/setup_32.c b/arch/x86/kernel/setup_32.c
index ee1ccdbd7100..be1a99003677 100644
--- a/arch/x86/kernel/setup_32.c
+++ b/arch/x86/kernel/setup_32.c
@@ -838,18 +838,17 @@ void __init setup_arch(char **cmdline_p)
838 838
839#ifdef CONFIG_ACPI 839#ifdef CONFIG_ACPI
840 acpi_boot_init(); 840 acpi_boot_init();
841 841#endif
842#if defined(CONFIG_X86_MPPARSE) || defined(CONFIG_X86_VISWS)
843 if (smp_found_config)
844 get_smp_config();
845#endif
842#if defined(CONFIG_SMP) && defined(CONFIG_X86_PC) 846#if defined(CONFIG_SMP) && defined(CONFIG_X86_PC)
843 if (def_to_bigsmp) 847 if (def_to_bigsmp)
844 printk(KERN_WARNING "More than 8 CPUs detected and " 848 printk(KERN_WARNING "More than 8 CPUs detected and "
845 "CONFIG_X86_PC cannot handle it.\nUse " 849 "CONFIG_X86_PC cannot handle it.\nUse "
846 "CONFIG_X86_GENERICARCH or CONFIG_X86_BIGSMP.\n"); 850 "CONFIG_X86_GENERICARCH or CONFIG_X86_BIGSMP.\n");
847#endif 851#endif
848#endif
849#if defined(CONFIG_X86_MPPARSE) || defined(CONFIG_X86_VISWS)
850 if (smp_found_config)
851 get_smp_config();
852#endif
853 852
854 e820_setup_gap(); 853 e820_setup_gap();
855 e820_mark_nosave_regions(max_low_pfn); 854 e820_mark_nosave_regions(max_low_pfn);
diff --git a/arch/x86/mach-generic/bigsmp.c b/arch/x86/mach-generic/bigsmp.c
index 95fc463056d0..2a243019acae 100644
--- a/arch/x86/mach-generic/bigsmp.c
+++ b/arch/x86/mach-generic/bigsmp.c
@@ -48,7 +48,7 @@ static const struct dmi_system_id bigsmp_dmi_table[] = {
48static int probe_bigsmp(void) 48static int probe_bigsmp(void)
49{ 49{
50 if (def_to_bigsmp) 50 if (def_to_bigsmp)
51 dmi_bigsmp = 1; 51 dmi_bigsmp = 1;
52 else 52 else
53 dmi_check_system(bigsmp_dmi_table); 53 dmi_check_system(bigsmp_dmi_table);
54 return dmi_bigsmp; 54 return dmi_bigsmp;