aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/cpu.c
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/cpu.c')
-rw-r--r--kernel/cpu.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/kernel/cpu.c b/kernel/cpu.c
index 8ce10043e4ac..ff071e022a85 100644
--- a/kernel/cpu.c
+++ b/kernel/cpu.c
@@ -14,6 +14,7 @@
14#include <linux/kthread.h> 14#include <linux/kthread.h>
15#include <linux/stop_machine.h> 15#include <linux/stop_machine.h>
16#include <linux/mutex.h> 16#include <linux/mutex.h>
17#include <asm/tboot.h>
17 18
18#ifdef CONFIG_SMP 19#ifdef CONFIG_SMP
19/* Serializes the updates to cpu_online_mask, cpu_present_mask */ 20/* Serializes the updates to cpu_online_mask, cpu_present_mask */
@@ -376,7 +377,7 @@ static cpumask_var_t frozen_cpus;
376 377
377int disable_nonboot_cpus(void) 378int disable_nonboot_cpus(void)
378{ 379{
379 int cpu, first_cpu, error; 380 int cpu, first_cpu, error, num_cpus = 0;
380 381
381 error = stop_machine_create(); 382 error = stop_machine_create();
382 if (error) 383 if (error)
@@ -391,6 +392,7 @@ int disable_nonboot_cpus(void)
391 for_each_online_cpu(cpu) { 392 for_each_online_cpu(cpu) {
392 if (cpu == first_cpu) 393 if (cpu == first_cpu)
393 continue; 394 continue;
395 num_cpus++;
394 error = _cpu_down(cpu, 1); 396 error = _cpu_down(cpu, 1);
395 if (!error) { 397 if (!error) {
396 cpumask_set_cpu(cpu, frozen_cpus); 398 cpumask_set_cpu(cpu, frozen_cpus);
@@ -401,6 +403,9 @@ int disable_nonboot_cpus(void)
401 break; 403 break;
402 } 404 }
403 } 405 }
406 /* ensure all CPUs have gone into wait-for-SIPI */
407 error |= tboot_wait_for_aps(num_cpus);
408
404 if (!error) { 409 if (!error) {
405 BUG_ON(num_online_cpus() > 1); 410 BUG_ON(num_online_cpus() > 1);
406 /* Make sure the CPUs won't be enabled by someone else */ 411 /* Make sure the CPUs won't be enabled by someone else */