diff options
Diffstat (limited to 'arch/x86/kernel/apic.c')
-rw-r--r-- | arch/x86/kernel/apic.c | 40 |
1 files changed, 28 insertions, 12 deletions
diff --git a/arch/x86/kernel/apic.c b/arch/x86/kernel/apic.c index 115449f869e..383d827eef8 100644 --- a/arch/x86/kernel/apic.c +++ b/arch/x86/kernel/apic.c | |||
@@ -60,6 +60,24 @@ | |||
60 | # error SPURIOUS_APIC_VECTOR definition error | 60 | # error SPURIOUS_APIC_VECTOR definition error |
61 | #endif | 61 | #endif |
62 | 62 | ||
63 | unsigned int num_processors; | ||
64 | unsigned disabled_cpus __cpuinitdata; | ||
65 | /* Processor that is doing the boot up */ | ||
66 | unsigned int boot_cpu_physical_apicid = -1U; | ||
67 | EXPORT_SYMBOL(boot_cpu_physical_apicid); | ||
68 | unsigned int max_physical_apicid; | ||
69 | |||
70 | /* Bitmask of physically existing CPUs */ | ||
71 | physid_mask_t phys_cpu_present_map; | ||
72 | |||
73 | /* | ||
74 | * Map cpu index to physical APIC ID | ||
75 | */ | ||
76 | DEFINE_EARLY_PER_CPU(u16, x86_cpu_to_apicid, BAD_APICID); | ||
77 | DEFINE_EARLY_PER_CPU(u16, x86_bios_cpu_apicid, BAD_APICID); | ||
78 | EXPORT_EARLY_PER_CPU_SYMBOL(x86_cpu_to_apicid); | ||
79 | EXPORT_EARLY_PER_CPU_SYMBOL(x86_bios_cpu_apicid); | ||
80 | |||
63 | #ifdef CONFIG_X86_32 | 81 | #ifdef CONFIG_X86_32 |
64 | /* | 82 | /* |
65 | * Knob to control our willingness to enable the local APIC. | 83 | * Knob to control our willingness to enable the local APIC. |
@@ -1130,6 +1148,13 @@ void __cpuinit setup_local_APIC(void) | |||
1130 | unsigned int value; | 1148 | unsigned int value; |
1131 | int i, j; | 1149 | int i, j; |
1132 | 1150 | ||
1151 | if (disable_apic) { | ||
1152 | #ifdef CONFIG_X86_IO_APIC | ||
1153 | disable_ioapic_setup(); | ||
1154 | #endif | ||
1155 | return; | ||
1156 | } | ||
1157 | |||
1133 | #ifdef CONFIG_X86_32 | 1158 | #ifdef CONFIG_X86_32 |
1134 | /* Pound the ESR really hard over the head with a big hammer - mbligh */ | 1159 | /* Pound the ESR really hard over the head with a big hammer - mbligh */ |
1135 | if (lapic_is_integrated() && esr_disable) { | 1160 | if (lapic_is_integrated() && esr_disable) { |
@@ -1570,11 +1595,11 @@ int apic_version[MAX_APICS]; | |||
1570 | 1595 | ||
1571 | int __init APIC_init_uniprocessor(void) | 1596 | int __init APIC_init_uniprocessor(void) |
1572 | { | 1597 | { |
1573 | #ifdef CONFIG_X86_64 | ||
1574 | if (disable_apic) { | 1598 | if (disable_apic) { |
1575 | pr_info("Apic disabled\n"); | 1599 | pr_info("Apic disabled\n"); |
1576 | return -1; | 1600 | return -1; |
1577 | } | 1601 | } |
1602 | #ifdef CONFIG_X86_64 | ||
1578 | if (!cpu_has_apic) { | 1603 | if (!cpu_has_apic) { |
1579 | disable_apic = 1; | 1604 | disable_apic = 1; |
1580 | pr_info("Apic disabled by BIOS\n"); | 1605 | pr_info("Apic disabled by BIOS\n"); |
@@ -1877,17 +1902,8 @@ void __cpuinit generic_processor_info(int apicid, int version) | |||
1877 | #endif | 1902 | #endif |
1878 | 1903 | ||
1879 | #if defined(CONFIG_X86_SMP) || defined(CONFIG_X86_64) | 1904 | #if defined(CONFIG_X86_SMP) || defined(CONFIG_X86_64) |
1880 | /* are we being called early in kernel startup? */ | 1905 | early_per_cpu(x86_cpu_to_apicid, cpu) = apicid; |
1881 | if (early_per_cpu_ptr(x86_cpu_to_apicid)) { | 1906 | early_per_cpu(x86_bios_cpu_apicid, cpu) = apicid; |
1882 | u16 *cpu_to_apicid = early_per_cpu_ptr(x86_cpu_to_apicid); | ||
1883 | u16 *bios_cpu_apicid = early_per_cpu_ptr(x86_bios_cpu_apicid); | ||
1884 | |||
1885 | cpu_to_apicid[cpu] = apicid; | ||
1886 | bios_cpu_apicid[cpu] = apicid; | ||
1887 | } else { | ||
1888 | per_cpu(x86_cpu_to_apicid, cpu) = apicid; | ||
1889 | per_cpu(x86_bios_cpu_apicid, cpu) = apicid; | ||
1890 | } | ||
1891 | #endif | 1907 | #endif |
1892 | 1908 | ||
1893 | set_cpu_possible(cpu, true); | 1909 | set_cpu_possible(cpu, true); |