]> git.baikalelectronics.ru Git - kernel.git/commit
arm64: ssbs: Fix context-switch when SSBS is present on all CPUs
authorWill Deacon <will@kernel.org>
Thu, 6 Feb 2020 10:42:58 +0000 (10:42 +0000)
committerWill Deacon <will@kernel.org>
Mon, 10 Feb 2020 11:29:02 +0000 (11:29 +0000)
commitec577bd54838a998d714b236f745158d29a1f4d4
treee0e63ad4e8ec217f8c15829d84da1b2bcbbd8ff7
parenta8083f00fbd95ebdc4e0fd38899d1d65fac2420d
arm64: ssbs: Fix context-switch when SSBS is present on all CPUs

When all CPUs in the system implement the SSBS extension, the SSBS field
in PSTATE is the definitive indication of the mitigation state. Further,
when the CPUs implement the SSBS manipulation instructions (advertised
to userspace via an HWCAP), EL0 can toggle the SSBS field directly and
so we cannot rely on any shadow state such as TIF_SSBD at all.

Avoid forcing the SSBS field in context-switch on such a system, and
simply rely on the PSTATE register instead.

Cc: <stable@vger.kernel.org>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Srinivas Ramana <sramana@codeaurora.org>
Fixes: 78535d2a936e ("arm64: Force SSBS on context switch")
Reviewed-by: Marc Zyngier <maz@kernel.org>
Signed-off-by: Will Deacon <will@kernel.org>
arch/arm64/kernel/process.c