]> git.baikalelectronics.ru Git - kernel.git/commit
arm64: smp: Add function to determine if cpus are stuck in the kernel
authorJames Morse <james.morse@arm.com>
Wed, 22 Jun 2016 09:06:12 +0000 (10:06 +0100)
committerCatalin Marinas <catalin.marinas@arm.com>
Mon, 27 Jun 2016 15:24:51 +0000 (16:24 +0100)
commitd9506f185a630d5573d7477d541a7159187b4398
treea3ef54f76d88dfd7632f2a6504ef4aeb7242b5fd
parent2b0044d82db1b0e3ddb166c936a484e6cc3e82fc
arm64: smp: Add function to determine if cpus are stuck in the kernel

kernel/smp.c has a fancy counter that keeps track of the number of CPUs
it marked as not-present and left in cpu_park_loop(). If there are any
CPUs spinning in here, features like kexec or hibernate may release them
by overwriting this memory.

This problem also occurs on machines using spin-tables to release
secondary cores.
After commit 1870de7afa5e ("arm64: Fix behavior of maxcpus=N")
we bring all known cpus into the secondary holding pen, meaning this
memory can't be re-used by kexec or hibernate.

Add a function cpus_are_stuck_in_kernel() to determine if either of these
cases have occurred.

Signed-off-by: James Morse <james.morse@arm.com>
Acked-by: Mark Rutland <mark.rutland@arm.com>
Reviewed-by: Suzuki K Poulose <suzuki.poulose@arm.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
[catalin.marinas@arm.com: cherry-picked from mainline for kexec dependency]
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
arch/arm64/include/asm/smp.h
arch/arm64/kernel/smp.c