]> git.proxmox.com Git - mirror_ubuntu-bionic-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)
committerKhalid Elmously <khalid.elmously@canonical.com>
Fri, 13 Mar 2020 04:31:00 +0000 (00:31 -0400)
commit47d31180cc309b6cb2313eaa77bd9267ff4540f8
tree49440706aa87cec8c8f00aabbdadbb5e3e3c9d0d
parent2be6f03c4486d4ef4bd3274f2da314734b906132
arm64: ssbs: Fix context-switch when SSBS is present on all CPUs

BugLink: https://bugs.launchpad.net/bugs/1867194
commit fca3d33d8ad61eb53eca3ee4cac476d1e31b9008 upstream.

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: cbdf8a189a66 ("arm64: Force SSBS on context switch")
Reviewed-by: Marc Zyngier <maz@kernel.org>
Signed-off-by: Will Deacon <will@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Khalid Elmously <khalid.elmously@canonical.com>
arch/arm64/kernel/process.c