]> git.baikalelectronics.ru Git - kernel.git/commit
arm64: Restore forced disabling of KPTI on ThunderX
authordann frazier <dann.frazier@canonical.com>
Thu, 23 Sep 2021 14:50:02 +0000 (08:50 -0600)
committerCatalin Marinas <catalin.marinas@arm.com>
Thu, 23 Sep 2021 14:59:15 +0000 (15:59 +0100)
commit2f48b192e3b9dd8d8fe1030e2add953a5bf2229f
treebbd4e04dcf32a7db7296e56a6d1905389d2c9288
parent096f35b975c7bb62517c503123ffd9e1cd17c74f
arm64: Restore forced disabling of KPTI on ThunderX

A noted side-effect of commit 09c756b32b6c ("arm64: Generate cpucaps.h")
is that cpucaps are now sorted, changing the enumeration order. This
assumed no dependencies between cpucaps, which turned out not to be true
in one case. UNMAP_KERNEL_AT_EL0 currently needs to be processed after
WORKAROUND_CAVIUM_27456. ThunderX systems are incompatible with KPTI, so
unmap_kernel_at_el0() bails if WORKAROUND_CAVIUM_27456 is set. But because
of the sorting, WORKAROUND_CAVIUM_27456 will not yet have been considered
when unmap_kernel_at_el0() checks for it, so the kernel tries to
run w/ KPTI - and quickly falls over.

Because all ThunderX implementations have homogeneous CPUs, we can remove
this dependency by just checking the current CPU for the erratum.

Fixes: 09c756b32b6c ("arm64: Generate cpucaps.h")
Cc: <stable@vger.kernel.org> # 5.13.x
Signed-off-by: dann frazier <dann.frazier@canonical.com>
Suggested-by: Suzuki K Poulose <suzuki.poulose@arm.com>
Reviewed-by: Suzuki K Poulose <suzuki.poulose@arm.com>
Reviewed-by: Mark Brown <broonie@kernel.org>
Acked-by: Marc Zyngier <maz@kernel.org>
Link: https://lore.kernel.org/r/20210923145002.3394558-1-dann.frazier@canonical.com
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
arch/arm64/kernel/cpufeature.c