aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kernel/reboot.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/x86/kernel/reboot.c')
-rw-r--r--arch/x86/kernel/reboot.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/arch/x86/kernel/reboot.c b/arch/x86/kernel/reboot.c
index f8a62160e151..214bbdfc851e 100644
--- a/arch/x86/kernel/reboot.c
+++ b/arch/x86/kernel/reboot.c
@@ -403,24 +403,28 @@ void native_machine_shutdown(void)
403{ 403{
404 /* Stop the cpus and apics */ 404 /* Stop the cpus and apics */
405#ifdef CONFIG_SMP 405#ifdef CONFIG_SMP
406 int reboot_cpu_id;
407 406
408 /* The boot cpu is always logical cpu 0 */ 407 /* The boot cpu is always logical cpu 0 */
409 reboot_cpu_id = 0; 408 int reboot_cpu_id = 0;
409 cpumask_of_cpu_ptr(newmask, reboot_cpu_id);
410 410
411#ifdef CONFIG_X86_32 411#ifdef CONFIG_X86_32
412 /* See if there has been given a command line override */ 412 /* See if there has been given a command line override */
413 if ((reboot_cpu != -1) && (reboot_cpu < NR_CPUS) && 413 if ((reboot_cpu != -1) && (reboot_cpu < NR_CPUS) &&
414 cpu_online(reboot_cpu)) 414 cpu_online(reboot_cpu)) {
415 reboot_cpu_id = reboot_cpu; 415 reboot_cpu_id = reboot_cpu;
416 cpumask_of_cpu_ptr_next(newmask, reboot_cpu_id);
417 }
416#endif 418#endif
417 419
418 /* Make certain the cpu I'm about to reboot on is online */ 420 /* Make certain the cpu I'm about to reboot on is online */
419 if (!cpu_online(reboot_cpu_id)) 421 if (!cpu_online(reboot_cpu_id)) {
420 reboot_cpu_id = smp_processor_id(); 422 reboot_cpu_id = smp_processor_id();
423 cpumask_of_cpu_ptr_next(newmask, reboot_cpu_id);
424 }
421 425
422 /* Make certain I only run on the appropriate processor */ 426 /* Make certain I only run on the appropriate processor */
423 set_cpus_allowed_ptr(current, &cpumask_of_cpu(reboot_cpu_id)); 427 set_cpus_allowed_ptr(current, newmask);
424 428
425 /* O.K Now that I'm on the appropriate processor, 429 /* O.K Now that I'm on the appropriate processor,
426 * stop all of the others. 430 * stop all of the others.