summaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorMarc Zyngier <marc.zyngier@arm.com>2018-05-29 13:11:10 +0100
committerCatalin Marinas <catalin.marinas@arm.com>2018-05-31 17:34:57 +0100
commitc32e1736ca03904c03de0e4459a673be194f56fd (patch)
tree8b29040c2abc5ac9b0fec8624a264b1883fc9ff5 /arch
parenta43ae4dfe56a01f5b98ba0cb2f784b6a43bafcc6 (diff)
downloadlinux-c32e1736ca03904c03de0e4459a673be194f56fd.tar.gz
linux-c32e1736ca03904c03de0e4459a673be194f56fd.tar.bz2
linux-c32e1736ca03904c03de0e4459a673be194f56fd.zip
arm64: ssbd: Add global mitigation state accessor
We're about to need the mitigation state in various parts of the kernel in order to do the right thing for userspace and guests. Let's expose an accessor that will let other subsystems know about the state. Reviewed-by: Julien Grall <julien.grall@arm.com> Reviewed-by: Mark Rutland <mark.rutland@arm.com> 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>
Diffstat (limited to 'arch')
-rw-r--r--arch/arm64/include/asm/cpufeature.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/arch/arm64/include/asm/cpufeature.h b/arch/arm64/include/asm/cpufeature.h
index b50650f3e496..b0fc3224ce8a 100644
--- a/arch/arm64/include/asm/cpufeature.h
+++ b/arch/arm64/include/asm/cpufeature.h
@@ -543,6 +543,16 @@ static inline u64 read_zcr_features(void)
#define ARM64_SSBD_FORCE_ENABLE 2
#define ARM64_SSBD_MITIGATED 3
+static inline int arm64_get_ssbd_state(void)
+{
+#ifdef CONFIG_ARM64_SSBD
+ extern int ssbd_state;
+ return ssbd_state;
+#else
+ return ARM64_SSBD_UNKNOWN;
+#endif
+}
+
#endif /* __ASSEMBLY__ */
#endif