aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kernel/apic_64.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/x86/kernel/apic_64.c')
-rw-r--r--arch/x86/kernel/apic_64.c41
1 files changed, 39 insertions, 2 deletions
diff --git a/arch/x86/kernel/apic_64.c b/arch/x86/kernel/apic_64.c
index 0d969103fce7..76c20773bedf 100644
--- a/arch/x86/kernel/apic_64.c
+++ b/arch/x86/kernel/apic_64.c
@@ -1215,6 +1215,8 @@ void __init init_apic_mappings(void)
1215 * This initializes the IO-APIC and APIC hardware if this is 1215 * This initializes the IO-APIC and APIC hardware if this is
1216 * a UP kernel. 1216 * a UP kernel.
1217 */ 1217 */
1218int apic_version[MAX_APICS];
1219
1218int __init APIC_init_uniprocessor(void) 1220int __init APIC_init_uniprocessor(void)
1219{ 1221{
1220 if (disable_apic) { 1222 if (disable_apic) {
@@ -1409,15 +1411,26 @@ void __cpuinit generic_processor_info(int apicid, int version)
1409 int cpu; 1411 int cpu;
1410 cpumask_t tmp_map; 1412 cpumask_t tmp_map;
1411 1413
1414 /*
1415 * Validate version
1416 */
1417 if (version == 0x0) {
1418 printk(KERN_WARNING "BIOS bug, APIC version is 0 for CPU#%d! "
1419 "fixing up to 0x10. (tell your hw vendor)\n",
1420 version);
1421 version = 0x10;
1422 }
1423 apic_version[apicid] = version;
1424
1412 if (num_processors >= NR_CPUS) { 1425 if (num_processors >= NR_CPUS) {
1413 printk(KERN_WARNING "WARNING: NR_CPUS limit of %i reached." 1426 printk(KERN_WARNING "WARNING: NR_CPUS limit of %i reached."
1414 " Processor ignored.\n", NR_CPUS); 1427 " Processor ignored.\n", NR_CPUS);
1415 return; 1428 return;
1416 } 1429 }
1417 1430
1418 if (num_processors >= maxcpus) { 1431 if (num_processors >= maxcpus) {
1419 printk(KERN_WARNING "WARNING: maxcpus limit of %i reached." 1432 printk(KERN_WARNING "WARNING: maxcpus limit of %i reached."
1420 " Processor ignored.\n", maxcpus); 1433 " Processor ignored.\n", maxcpus);
1421 return; 1434 return;
1422 } 1435 }
1423 1436
@@ -1437,6 +1450,29 @@ void __cpuinit generic_processor_info(int apicid, int version)
1437 if (apicid > max_physical_apicid) 1450 if (apicid > max_physical_apicid)
1438 max_physical_apicid = apicid; 1451 max_physical_apicid = apicid;
1439 1452
1453#ifdef CONFIG_X86_32
1454 /*
1455 * Would be preferable to switch to bigsmp when CONFIG_HOTPLUG_CPU=y
1456 * but we need to work other dependencies like SMP_SUSPEND etc
1457 * before this can be done without some confusion.
1458 * if (CPU_HOTPLUG_ENABLED || num_processors > 8)
1459 * - Ashok Raj <ashok.raj@intel.com>
1460 */
1461 if (max_physical_apicid >= 8) {
1462 switch (boot_cpu_data.x86_vendor) {
1463 case X86_VENDOR_INTEL:
1464 if (!APIC_XAPIC(version)) {
1465 def_to_bigsmp = 0;
1466 break;
1467 }
1468 /* If P4 and above fall through */
1469 case X86_VENDOR_AMD:
1470 def_to_bigsmp = 1;
1471 }
1472 }
1473#endif
1474
1475#if defined(CONFIG_X86_SMP) || defined(CONFIG_X86_64)
1440 /* are we being called early in kernel startup? */ 1476 /* are we being called early in kernel startup? */
1441 if (early_per_cpu_ptr(x86_cpu_to_apicid)) { 1477 if (early_per_cpu_ptr(x86_cpu_to_apicid)) {
1442 u16 *cpu_to_apicid = early_per_cpu_ptr(x86_cpu_to_apicid); 1478 u16 *cpu_to_apicid = early_per_cpu_ptr(x86_cpu_to_apicid);
@@ -1448,6 +1484,7 @@ void __cpuinit generic_processor_info(int apicid, int version)
1448 per_cpu(x86_cpu_to_apicid, cpu) = apicid; 1484 per_cpu(x86_cpu_to_apicid, cpu) = apicid;
1449 per_cpu(x86_bios_cpu_apicid, cpu) = apicid; 1485 per_cpu(x86_bios_cpu_apicid, cpu) = apicid;
1450 } 1486 }
1487#endif
1451 1488
1452 cpu_set(cpu, cpu_possible_map); 1489 cpu_set(cpu, cpu_possible_map);
1453 cpu_set(cpu, cpu_present_map); 1490 cpu_set(cpu, cpu_present_map);