diff options
Diffstat (limited to 'arch/x86/kernel/smpboot_64.c')
-rw-r--r-- | arch/x86/kernel/smpboot_64.c | 24 |
1 files changed, 10 insertions, 14 deletions
diff --git a/arch/x86/kernel/smpboot_64.c b/arch/x86/kernel/smpboot_64.c index f4363a38d079..6679ac502160 100644 --- a/arch/x86/kernel/smpboot_64.c +++ b/arch/x86/kernel/smpboot_64.c | |||
@@ -71,6 +71,7 @@ int smp_threads_ready; | |||
71 | cycles_t cacheflush_time; | 71 | cycles_t cacheflush_time; |
72 | unsigned long cache_decay_ticks; | 72 | unsigned long cache_decay_ticks; |
73 | 73 | ||
74 | static int boot_cpu_logical_apicid; | ||
74 | /* | 75 | /* |
75 | * Fall back to non SMP mode after errors. | 76 | * Fall back to non SMP mode after errors. |
76 | * | 77 | * |
@@ -167,7 +168,11 @@ void __init native_smp_prepare_cpus(unsigned int max_cpus) | |||
167 | { | 168 | { |
168 | nmi_watchdog_default(); | 169 | nmi_watchdog_default(); |
169 | smp_cpu_index_default(); | 170 | smp_cpu_index_default(); |
171 | cpu_callin_map = cpumask_of_cpu(0); | ||
172 | mb(); | ||
173 | |||
170 | current_cpu_data = boot_cpu_data; | 174 | current_cpu_data = boot_cpu_data; |
175 | boot_cpu_logical_apicid = logical_smp_processor_id(); | ||
171 | current_thread_info()->cpu = 0; /* needed? */ | 176 | current_thread_info()->cpu = 0; /* needed? */ |
172 | set_cpu_sibling_map(0); | 177 | set_cpu_sibling_map(0); |
173 | 178 | ||
@@ -177,6 +182,11 @@ void __init native_smp_prepare_cpus(unsigned int max_cpus) | |||
177 | return; | 182 | return; |
178 | } | 183 | } |
179 | 184 | ||
185 | if (GET_APIC_ID(apic_read(APIC_ID)) != boot_cpu_physical_apicid) { | ||
186 | panic("Boot APIC ID in local APIC unexpected (%d vs %d)", | ||
187 | GET_APIC_ID(apic_read(APIC_ID)), boot_cpu_physical_apicid); | ||
188 | /* Or can we switch back to PIC here? */ | ||
189 | } | ||
180 | 190 | ||
181 | /* | 191 | /* |
182 | * Switch from PIC to APIC mode. | 192 | * Switch from PIC to APIC mode. |
@@ -190,20 +200,6 @@ void __init native_smp_prepare_cpus(unsigned int max_cpus) | |||
190 | enable_IO_APIC(); | 200 | enable_IO_APIC(); |
191 | end_local_APIC_setup(); | 201 | end_local_APIC_setup(); |
192 | 202 | ||
193 | if (GET_APIC_ID(apic_read(APIC_ID)) != boot_cpu_physical_apicid) { | ||
194 | panic("Boot APIC ID in local APIC unexpected (%d vs %d)", | ||
195 | GET_APIC_ID(apic_read(APIC_ID)), boot_cpu_physical_apicid); | ||
196 | /* Or can we switch back to PIC here? */ | ||
197 | } | ||
198 | |||
199 | /* | ||
200 | * Now start the IO-APICs | ||
201 | */ | ||
202 | if (!skip_ioapic_setup && nr_ioapics) | ||
203 | setup_IO_APIC(); | ||
204 | else | ||
205 | nr_ioapics = 0; | ||
206 | |||
207 | /* | 203 | /* |
208 | * Set up local APIC timer on boot CPU. | 204 | * Set up local APIC timer on boot CPU. |
209 | */ | 205 | */ |