summaryrefslogtreecommitdiff
path: root/arch/arm64/kernel/ssbd.c
AgeCommit message (Collapse)Author
2020-01-08Return ENODEV when the selected speculation misfeature is unsupportedAnthony Steinhauser
When the control of the selected speculation misbehavior is unsupported, the kernel should return ENODEV according to the documentation: https://www.kernel.org/doc/html/v4.17/userspace-api/spec_ctrl.html Current aarch64 implementation of SSB control sometimes returns EINVAL which is reserved for unimplemented prctl and for violations of reserved arguments. This change makes the aarch64 implementation consistent with the x86 implementation and with the documentation. Signed-off-by: Anthony Steinhauser <asteinhauser@google.com> Signed-off-by: Will Deacon <will@kernel.org>
2019-06-17arm64: ssbd: explicitly depend on <linux/prctl.h>Anisse Astier
Fix ssbd.c which depends implicitly on asm/ptrace.h including linux/prctl.h (through for example linux/compat.h, then linux/time.h, linux/seqlock.h, linux/spinlock.h and linux/irqflags.h), and uses PR_SPEC* defines. This is an issue since we'll soon be removing the include from asm/ptrace.h. Fixes: 9cdc0108baa8 ("arm64: ssbd: Add prctl interface for per-thread mitigation") Cc: stable@vger.kernel.org Signed-off-by: Anisse Astier <aastier@freebox.fr> Signed-off-by: Will Deacon <will.deacon@arm.com>
2018-09-14arm64: ssbd: Add support for PSTATE.SSBS rather than trapping to EL3Will Deacon
On CPUs with support for PSTATE.SSBS, the kernel can toggle the SSBD state without needing to call into firmware. This patch hooks into the existing SSBD infrastructure so that SSBS is used on CPUs that support it, but it's all made horribly complicated by the very real possibility of big/little systems that don't uniformly provide the new capability. Signed-off-by: Will Deacon <will.deacon@arm.com> Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
2018-09-14arm64: ssbd: Drop #ifdefs for PR_SPEC_STORE_BYPASSWill Deacon
Now that we're all merged nicely into mainline, there's no need to check to see if PR_SPEC_STORE_BYPASS is defined. Signed-off-by: Will Deacon <will.deacon@arm.com> Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
2018-05-31arm64: ssbd: Add prctl interface for per-thread mitigationMarc Zyngier
If running on a system that performs dynamic SSBD mitigation, allow userspace to request the mitigation for itself. This is implemented as a prctl call, allowing the mitigation to be enabled or disabled at will for this particular thread. Acked-by: Will Deacon <will.deacon@arm.com> Signed-off-by: Marc Zyngier <marc.zyngier@arm.com> Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>