aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kernel/apic_32.c
diff options
context:
space:
mode:
authorCyrill Gorcunov <gorcunov@gmail.com>2008-08-18 12:45:57 -0400
committerIngo Molnar <mingo@elte.hu>2008-08-18 20:07:16 -0400
commit1b313f4a6d7bee7b2c034b3f1e203bc360a71cca (patch)
treeeaa380aef78b7aff26194ce5e37e23f6d28a66dd /arch/x86/kernel/apic_32.c
parentc177b0bc03e0e11623e2099db42903fb0caf0fd3 (diff)
x86: apic - generic_processor_info
- use physid_set instead of phys_cpu and physids_or - set phys_cpu_present_map bit AFTER check for allowed number of processors - add checking for APIC valid version in 64bit mode (mostly not needed but added for merging purpose) - add apic_version definition for 64bit mode which is used now Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com> 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.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/arch/x86/kernel/apic_32.c b/arch/x86/kernel/apic_32.c
index 3095bb71eaed..c3a252b1a8be 100644
--- a/arch/x86/kernel/apic_32.c
+++ b/arch/x86/kernel/apic_32.c
@@ -1480,7 +1480,6 @@ void __cpuinit generic_processor_info(int apicid, int version)
1480{ 1480{
1481 int cpu; 1481 int cpu;
1482 cpumask_t tmp_map; 1482 cpumask_t tmp_map;
1483 physid_mask_t phys_cpu;
1484 1483
1485 /* 1484 /*
1486 * Validate version 1485 * Validate version
@@ -1493,9 +1492,6 @@ void __cpuinit generic_processor_info(int apicid, int version)
1493 } 1492 }
1494 apic_version[apicid] = version; 1493 apic_version[apicid] = version;
1495 1494
1496 phys_cpu = apicid_to_cpu_present(apicid);
1497 physids_or(phys_cpu_present_map, phys_cpu_present_map, phys_cpu);
1498
1499 if (num_processors >= NR_CPUS) { 1495 if (num_processors >= NR_CPUS) {
1500 printk(KERN_WARNING "WARNING: NR_CPUS limit of %i reached." 1496 printk(KERN_WARNING "WARNING: NR_CPUS limit of %i reached."
1501 " Processor ignored.\n", NR_CPUS); 1497 " Processor ignored.\n", NR_CPUS);
@@ -1512,17 +1508,19 @@ void __cpuinit generic_processor_info(int apicid, int version)
1512 cpus_complement(tmp_map, cpu_present_map); 1508 cpus_complement(tmp_map, cpu_present_map);
1513 cpu = first_cpu(tmp_map); 1509 cpu = first_cpu(tmp_map);
1514 1510
1515 if (apicid == boot_cpu_physical_apicid) 1511 physid_set(apicid, phys_cpu_present_map);
1512 if (apicid == boot_cpu_physical_apicid) {
1516 /* 1513 /*
1517 * x86_bios_cpu_apicid is required to have processors listed 1514 * x86_bios_cpu_apicid is required to have processors listed
1518 * in same order as logical cpu numbers. Hence the first 1515 * in same order as logical cpu numbers. Hence the first
1519 * entry is BSP, and so on. 1516 * entry is BSP, and so on.
1520 */ 1517 */
1521 cpu = 0; 1518 cpu = 0;
1522 1519 }
1523 if (apicid > max_physical_apicid) 1520 if (apicid > max_physical_apicid)
1524 max_physical_apicid = apicid; 1521 max_physical_apicid = apicid;
1525 1522
1523#ifdef CONFIG_X86_32
1526 /* 1524 /*
1527 * 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
1528 * but we need to work other dependencies like SMP_SUSPEND etc 1526 * but we need to work other dependencies like SMP_SUSPEND etc
@@ -1542,7 +1540,9 @@ void __cpuinit generic_processor_info(int apicid, int version)
1542 def_to_bigsmp = 1; 1540 def_to_bigsmp = 1;
1543 } 1541 }
1544 } 1542 }
1545#ifdef CONFIG_SMP 1543#endif
1544
1545#if defined(CONFIG_X86_SMP) || defined(CONFIG_X86_64)
1546 /* are we being called early in kernel startup? */ 1546 /* are we being called early in kernel startup? */
1547 if (early_per_cpu_ptr(x86_cpu_to_apicid)) { 1547 if (early_per_cpu_ptr(x86_cpu_to_apicid)) {
1548 u16 *cpu_to_apicid = early_per_cpu_ptr(x86_cpu_to_apicid); 1548 u16 *cpu_to_apicid = early_per_cpu_ptr(x86_cpu_to_apicid);
@@ -1555,6 +1555,7 @@ void __cpuinit generic_processor_info(int apicid, int version)
1555 per_cpu(x86_bios_cpu_apicid, cpu) = apicid; 1555 per_cpu(x86_bios_cpu_apicid, cpu) = apicid;
1556 } 1556 }
1557#endif 1557#endif
1558
1558 cpu_set(cpu, cpu_possible_map); 1559 cpu_set(cpu, cpu_possible_map);
1559 cpu_set(cpu, cpu_present_map); 1560 cpu_set(cpu, cpu_present_map);
1560} 1561}