]> git.baikalelectronics.ru Git - kernel.git/commitdiff
powerpc/security: Add a helper to query stf_barrier type
authorNaveen N. Rao <naveen.n.rao@linux.vnet.ibm.com>
Tue, 5 Oct 2021 20:25:24 +0000 (01:55 +0530)
committerMichael Ellerman <mpe@ellerman.id.au>
Thu, 7 Oct 2021 08:52:58 +0000 (19:52 +1100)
Add a helper to return the stf_barrier type for the current processor.

Signed-off-by: Naveen N. Rao <naveen.n.rao@linux.vnet.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/3bd5d7f96ea1547991ac2ce3137dc2b220bae285.1633464148.git.naveen.n.rao@linux.vnet.ibm.com
arch/powerpc/include/asm/security_features.h
arch/powerpc/kernel/security.c

index 792eefaf230b80b52aaac7d54ae5ca71e2ced11c..27574f218b371f3f42ce98bb69821a1eaa723fe7 100644 (file)
@@ -39,6 +39,11 @@ static inline bool security_ftr_enabled(u64 feature)
        return !!(powerpc_security_features & feature);
 }
 
+#ifdef CONFIG_PPC_BOOK3S_64
+enum stf_barrier_type stf_barrier_type_get(void);
+#else
+static inline enum stf_barrier_type stf_barrier_type_get(void) { return STF_BARRIER_NONE; }
+#endif
 
 // Features indicating support for Spectre/Meltdown mitigations
 
index 1a998490fe60f04555c1a95422eb47a6d7c0e39a..15fb5ea1b9eafa7eae3a2e2eb0ba8cc61909b3a5 100644 (file)
@@ -263,6 +263,11 @@ static int __init handle_no_stf_barrier(char *p)
 
 early_param("no_stf_barrier", handle_no_stf_barrier);
 
+enum stf_barrier_type stf_barrier_type_get(void)
+{
+       return stf_enabled_flush_types;
+}
+
 /* This is the generic flag used by other architectures */
 static int __init handle_ssbd(char *p)
 {