]> git.baikalelectronics.ru Git - kernel.git/commit
arm64: smp: Don't enter kernel with NULL stack pointer or task struct
authorWill Deacon <will@kernel.org>
Tue, 27 Aug 2019 13:36:38 +0000 (14:36 +0100)
committerWill Deacon <will@kernel.org>
Tue, 27 Aug 2019 16:37:02 +0000 (17:37 +0100)
commit6ebdd7015ae2ac56fab93489401527d29a57999b
treefa5c90257088a8c00e134e3dbe1a14dc5ee1447e
parenta37e2e1a04414247feac11a6147b862eb7ed4a6c
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>
arch/arm64/kernel/head.S
arch/arm64/kernel/smp.c