Commit 911a62d4 authored by Venkatesh Pallipadi's avatar Venkatesh Pallipadi Committed by Linus Torvalds

[PATCH] x86: sutomatically enable bigsmp when we have more than 8 CPUs

i386 generic subarchitecture requires explicit dmi strings or command line
to enable bigsmp mode.  The patch below removes that restriction, and uses
bigsmp as soon as it finds more than 8 logical CPUs, Intel processors and
xAPIC support.
Signed-off-by: default avatarVenkatesh Pallipadi <venkatesh.pallipadi@intel.com>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 484b90c4
...@@ -833,6 +833,9 @@ acpi_process_madt(void) ...@@ -833,6 +833,9 @@ acpi_process_madt(void)
if (!error) { if (!error) {
acpi_lapic = 1; acpi_lapic = 1;
#ifdef CONFIG_X86_GENERICARCH
generic_bigsmp_probe();
#endif
/* /*
* Parse MADT IO-APIC entries * Parse MADT IO-APIC entries
*/ */
......
...@@ -65,6 +65,8 @@ int nr_ioapics; ...@@ -65,6 +65,8 @@ int nr_ioapics;
int pic_mode; int pic_mode;
unsigned long mp_lapic_addr; unsigned long mp_lapic_addr;
unsigned int def_to_bigsmp = 0;
/* Processor that is doing the boot up */ /* Processor that is doing the boot up */
unsigned int boot_cpu_physical_apicid = -1U; unsigned int boot_cpu_physical_apicid = -1U;
/* Internal processor count */ /* Internal processor count */
...@@ -213,6 +215,13 @@ static void __init MP_processor_info (struct mpc_config_processor *m) ...@@ -213,6 +215,13 @@ static void __init MP_processor_info (struct mpc_config_processor *m)
ver = 0x10; ver = 0x10;
} }
apic_version[m->mpc_apicid] = ver; apic_version[m->mpc_apicid] = ver;
if ((num_processors > 8) &&
APIC_XAPIC(ver) &&
(boot_cpu_data.x86_vendor == X86_VENDOR_INTEL))
def_to_bigsmp = 1;
else
def_to_bigsmp = 0;
bios_cpu_apicid[num_processors - 1] = m->mpc_apicid; bios_cpu_apicid[num_processors - 1] = m->mpc_apicid;
} }
......
...@@ -1585,8 +1585,14 @@ void __init setup_arch(char **cmdline_p) ...@@ -1585,8 +1585,14 @@ void __init setup_arch(char **cmdline_p)
*/ */
acpi_boot_table_init(); acpi_boot_table_init();
acpi_boot_init(); acpi_boot_init();
#endif
#if defined(CONFIG_SMP) && defined(CONFIG_X86_PC)
if (def_to_bigsmp)
printk(KERN_WARNING "More than 8 CPUs detected and "
"CONFIG_X86_PC cannot handle it.\nUse "
"CONFIG_X86_GENERICARCH or CONFIG_X86_BIGSMP.\n");
#endif
#endif
#ifdef CONFIG_X86_LOCAL_APIC #ifdef CONFIG_X86_LOCAL_APIC
if (smp_found_config) if (smp_found_config)
get_smp_config(); get_smp_config();
......
...@@ -47,6 +47,9 @@ static struct dmi_system_id __initdata bigsmp_dmi_table[] = { ...@@ -47,6 +47,9 @@ static struct dmi_system_id __initdata bigsmp_dmi_table[] = {
static __init int probe_bigsmp(void) static __init int probe_bigsmp(void)
{ {
if (def_to_bigsmp)
dmi_bigsmp = 1;
else
dmi_check_system(bigsmp_dmi_table); dmi_check_system(bigsmp_dmi_table);
return dmi_bigsmp; return dmi_bigsmp;
} }
......
...@@ -30,6 +30,25 @@ struct genapic *apic_probe[] __initdata = { ...@@ -30,6 +30,25 @@ struct genapic *apic_probe[] __initdata = {
NULL, NULL,
}; };
static int cmdline_apic;
void __init generic_bigsmp_probe(void)
{
/*
* This routine is used to switch to bigsmp mode when
* - There is no apic= option specified by the user
* - generic_apic_probe() has choosen apic_default as the sub_arch
* - we find more than 8 CPUs in acpi LAPIC listing with xAPIC support
*/
if (!cmdline_apic && genapic == &apic_default)
if (apic_bigsmp.probe()) {
genapic = &apic_bigsmp;
printk(KERN_INFO "Overriding APIC driver with %s\n",
genapic->name);
}
}
void __init generic_apic_probe(char *command_line) void __init generic_apic_probe(char *command_line)
{ {
char *s; char *s;
...@@ -52,6 +71,7 @@ void __init generic_apic_probe(char *command_line) ...@@ -52,6 +71,7 @@ void __init generic_apic_probe(char *command_line)
if (!changed) if (!changed)
printk(KERN_ERR "Unknown genapic `%s' specified.\n", s); printk(KERN_ERR "Unknown genapic `%s' specified.\n", s);
*p = old; *p = old;
cmdline_apic = changed;
} }
for (i = 0; !changed && apic_probe[i]; i++) { for (i = 0; !changed && apic_probe[i]; i++) {
if (apic_probe[i]->probe()) { if (apic_probe[i]->probe()) {
......
...@@ -16,6 +16,7 @@ ...@@ -16,6 +16,7 @@
#define GET_APIC_VERSION(x) ((x)&0xFF) #define GET_APIC_VERSION(x) ((x)&0xFF)
#define GET_APIC_MAXLVT(x) (((x)>>16)&0xFF) #define GET_APIC_MAXLVT(x) (((x)>>16)&0xFF)
#define APIC_INTEGRATED(x) ((x)&0xF0) #define APIC_INTEGRATED(x) ((x)&0xF0)
#define APIC_XAPIC(x) ((x) >= 0x14)
#define APIC_TASKPRI 0x80 #define APIC_TASKPRI 0x80
#define APIC_TPRI_MASK 0xFF #define APIC_TPRI_MASK 0xFF
#define APIC_ARBPRI 0x90 #define APIC_ARBPRI 0x90
......
...@@ -28,4 +28,6 @@ ...@@ -28,4 +28,6 @@
#define enable_apic_mode (genapic->enable_apic_mode) #define enable_apic_mode (genapic->enable_apic_mode)
#define phys_pkg_id (genapic->phys_pkg_id) #define phys_pkg_id (genapic->phys_pkg_id)
extern void generic_bigsmp_probe(void);
#endif /* __ASM_MACH_APIC_H */ #endif /* __ASM_MACH_APIC_H */
...@@ -11,6 +11,7 @@ extern int mp_bus_id_to_local [MAX_MP_BUSSES]; ...@@ -11,6 +11,7 @@ extern int mp_bus_id_to_local [MAX_MP_BUSSES];
extern int quad_local_to_mp_bus_id [NR_CPUS/4][4]; extern int quad_local_to_mp_bus_id [NR_CPUS/4][4];
extern int mp_bus_id_to_pci_bus [MAX_MP_BUSSES]; extern int mp_bus_id_to_pci_bus [MAX_MP_BUSSES];
extern unsigned int def_to_bigsmp;
extern unsigned int boot_cpu_physical_apicid; extern unsigned int boot_cpu_physical_apicid;
extern int smp_found_config; extern int smp_found_config;
extern void find_smp_config (void); extern void find_smp_config (void);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment