diff options
author | Cyrill Gorcunov <gorcunov@gmail.com> | 2008-08-18 12:45:57 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-08-18 20:07:16 -0400 |
commit | 1b313f4a6d7bee7b2c034b3f1e203bc360a71cca (patch) | |
tree | eaa380aef78b7aff26194ce5e37e23f6d28a66dd /arch/x86/kernel/apic_64.c | |
parent | c177b0bc03e0e11623e2099db42903fb0caf0fd3 (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_64.c')
-rw-r--r-- | arch/x86/kernel/apic_64.c | 41 |
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 | */ |
1218 | int apic_version[MAX_APICS]; | ||
1219 | |||
1218 | int __init APIC_init_uniprocessor(void) | 1220 | int __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); |