diff options
author | Will Deacon <will@kernel.org> | 2019-08-27 15:36:38 +0200 |
---|---|---|
committer | Will Deacon <will@kernel.org> | 2019-08-27 18:37:02 +0200 |
commit | 5b1cfe3a0ba74c1f2b83b607712a217b9f9463a2 (patch) | |
tree | fa5c90257088a8c00e134e3dbe1a14dc5ee1447e /arch/arm64/kernel/smp.c | |
parent | arm64: smp: Increase secondary CPU boot timeout value (diff) | |
download | linux-5b1cfe3a0ba74c1f2b83b607712a217b9f9463a2.tar.xz linux-5b1cfe3a0ba74c1f2b83b607712a217b9f9463a2.zip |
arm64: smp: Don't enter kernel with NULL stack pointer or task struct
Although SMP bringup is inherently racy, we can significantly reduce
the window during which secondary CPUs can unexpectedly enter the
kernel by sanity checking the 'stack' and 'task' fields of the
'secondary_data' structure. If the booting CPU gave up waiting for us,
then they will have been cleared to NULL and we should spin in a WFE; WFI
loop instead.
Reviewed-by: Mark Rutland <mark.rutland@arm.com>
Signed-off-by: Will Deacon <will@kernel.org>
Diffstat (limited to 'arch/arm64/kernel/smp.c')
-rw-r--r-- | arch/arm64/kernel/smp.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/arch/arm64/kernel/smp.c b/arch/arm64/kernel/smp.c index 63c7a7682e93..1f8aeb77cba5 100644 --- a/arch/arm64/kernel/smp.c +++ b/arch/arm64/kernel/smp.c @@ -136,6 +136,7 @@ int __cpu_up(unsigned int cpu, struct task_struct *idle) secondary_data.task = NULL; secondary_data.stack = NULL; + __flush_dcache_area(&secondary_data, sizeof(secondary_data)); status = READ_ONCE(secondary_data.status); if (ret && status) { |