aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kernel/apic_32.c
diff options
context:
space:
mode:
authorAlexey Starikovskiy <astarikovskiy@suse.de>2008-03-27 16:55:22 -0400
committerIngo Molnar <mingo@elte.hu>2008-04-17 11:41:31 -0400
commit903dcb5a1bd0ef2b09d756f646e367cd12659b6f (patch)
tree393e4d0a10d183406e3d68a28045462cb611b45d /arch/x86/kernel/apic_32.c
parentacff5a768935f7f39e4e3be03940d70c005ffe96 (diff)
x86: move generic_processor_info to apic_32.c
Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de> Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'arch/x86/kernel/apic_32.c')
-rw-r--r--arch/x86/kernel/apic_32.c82
1 files changed, 82 insertions, 0 deletions
diff --git a/arch/x86/kernel/apic_32.c b/arch/x86/kernel/apic_32.c
index 65036bbaf058..a99398f71234 100644
--- a/arch/x86/kernel/apic_32.c
+++ b/arch/x86/kernel/apic_32.c
@@ -1469,6 +1469,88 @@ void disconnect_bsp_APIC(int virt_wire_setup)
1469 } 1469 }
1470} 1470}
1471 1471
1472unsigned int __cpuinitdata maxcpus = NR_CPUS;
1473
1474void __cpuinit generic_processor_info(int apicid, int version)
1475{
1476 int cpu;
1477 cpumask_t tmp_map;
1478 physid_mask_t phys_cpu;
1479
1480 /*
1481 * Validate version
1482 */
1483 if (version == 0x0) {
1484 printk(KERN_WARNING "BIOS bug, APIC version is 0 for CPU#%d! "
1485 "fixing up to 0x10. (tell your hw vendor)\n",
1486 version);
1487 version = 0x10;
1488 }
1489 apic_version[apicid] = version;
1490
1491 phys_cpu = apicid_to_cpu_present(apicid);
1492 physids_or(phys_cpu_present_map, phys_cpu_present_map, phys_cpu);
1493
1494 if (num_processors >= NR_CPUS) {
1495 printk(KERN_WARNING "WARNING: NR_CPUS limit of %i reached."
1496 " Processor ignored.\n", NR_CPUS);
1497 return;
1498 }
1499
1500 if (num_processors >= maxcpus) {
1501 printk(KERN_WARNING "WARNING: maxcpus limit of %i reached."
1502 " Processor ignored.\n", maxcpus);
1503 return;
1504 }
1505
1506 num_processors++;
1507 cpus_complement(tmp_map, cpu_present_map);
1508 cpu = first_cpu(tmp_map);
1509
1510 if (apicid == boot_cpu_physical_apicid)
1511 /*
1512 * x86_bios_cpu_apicid is required to have processors listed
1513 * in same order as logical cpu numbers. Hence the first
1514 * entry is BSP, and so on.
1515 */
1516 cpu = 0;
1517
1518 /*
1519 * Would be preferable to switch to bigsmp when CONFIG_HOTPLUG_CPU=y
1520 * but we need to work other dependencies like SMP_SUSPEND etc
1521 * before this can be done without some confusion.
1522 * if (CPU_HOTPLUG_ENABLED || num_processors > 8)
1523 * - Ashok Raj <ashok.raj@intel.com>
1524 */
1525 if (num_processors > 8) {
1526 switch (boot_cpu_data.x86_vendor) {
1527 case X86_VENDOR_INTEL:
1528 if (!APIC_XAPIC(version)) {
1529 def_to_bigsmp = 0;
1530 break;
1531 }
1532 /* If P4 and above fall through */
1533 case X86_VENDOR_AMD:
1534 def_to_bigsmp = 1;
1535 }
1536 }
1537#ifdef CONFIG_SMP
1538 /* are we being called early in kernel startup? */
1539 if (x86_cpu_to_apicid_early_ptr) {
1540 u16 *cpu_to_apicid = x86_cpu_to_apicid_early_ptr;
1541 u16 *bios_cpu_apicid = x86_bios_cpu_apicid_early_ptr;
1542
1543 cpu_to_apicid[cpu] = apicid;
1544 bios_cpu_apicid[cpu] = apicid;
1545 } else {
1546 per_cpu(x86_cpu_to_apicid, cpu) = apicid;
1547 per_cpu(x86_bios_cpu_apicid, cpu) = apicid;
1548 }
1549#endif
1550 cpu_set(cpu, cpu_possible_map);
1551 cpu_set(cpu, cpu_present_map);
1552}
1553
1472/* 1554/*
1473 * Power management 1555 * Power management
1474 */ 1556 */