|author||James Morse <email@example.com>||2016-06-22 10:06:12 +0100|
|committer||Will Deacon <firstname.lastname@example.org>||2016-06-22 15:48:09 +0100|
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 44dbcc93ab67 ("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 <email@example.com> Acked-by: Mark Rutland <firstname.lastname@example.org> Reviewed-by: Suzuki K Poulose <email@example.com> Signed-off-by: Will Deacon <firstname.lastname@example.org>
Diffstat (limited to 'arch/arm64/include')
1 files changed, 12 insertions, 0 deletions
diff --git a/arch/arm64/include/asm/smp.h b/arch/arm64/include/asm/smp.h
index 433e50405274..022644704a93 100644
@@ -124,6 +124,18 @@ static inline void cpu_panic_kernel(void)
+ * If a secondary CPU enters the kernel but fails to come online,
+ * (e.g. due to mismatched features), and cannot exit the kernel,
+ * we increment cpus_stuck_in_kernel and leave the CPU in a
+ * quiesecent loop within the kernel text. The memory containing
+ * this loop must not be re-used for anything else as the 'stuck'
+ * core is executing it.
+ * This function is used to inhibit features like kexec and hibernate.
#endif /* ifndef __ASSEMBLY__ */
#endif /* ifndef __ASM_SMP_H */