arm64: Prevent offlining first CPU with 32-bit EL0 on mismatched system
authorWill Deacon <will@kernel.org>
Fri, 30 Jul 2021 11:24:39 +0000 (12:24 +0100)
committerPeter Zijlstra <peterz@infradead.org>
Fri, 20 Aug 2021 10:33:07 +0000 (12:33 +0200)
commitdf950811f4a884d08f05e22a8e0089d54bb4ba70
tree693da5f1837cc38bcb60a4e516fd0ce29df1894b
parent08cd8f4112dbd33bbfe1112dd6e9f0a228a8e132
arm64: Prevent offlining first CPU with 32-bit EL0 on mismatched system

If we want to support 32-bit applications, then when we identify a CPU
with mismatched 32-bit EL0 support we must ensure that we will always
have an active 32-bit CPU available to us from then on. This is important
for the scheduler, because is_cpu_allowed() will be constrained to 32-bit
CPUs for compat tasks and forced migration due to a hotplug event will
hang if no 32-bit CPUs are available.

On detecting a mismatch, prevent offlining of either the mismatching CPU
if it is 32-bit capable, or find the first active 32-bit capable CPU
otherwise.

Signed-off-by: Will Deacon <will@kernel.org>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Reviewed-by: Catalin Marinas <catalin.marinas@arm.com>
Link: https://lore.kernel.org/r/20210730112443.23245-13-will@kernel.org
arch/arm64/kernel/cpufeature.c