Skip to content

Commit 0309059

Browse files
rnavmpe
authored andcommitted
powerpc/security: Add a helper to query stf_barrier type
Add a helper to return the stf_barrier type for the current processor. Signed-off-by: Naveen N. Rao <[email protected]> Signed-off-by: Michael Ellerman <[email protected]> Link: https://lore.kernel.org/r/3bd5d7f96ea1547991ac2ce3137dc2b220bae285.1633464148.git.naveen.n.rao@linux.vnet.ibm.com
1 parent 5855c4c commit 0309059

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

arch/powerpc/include/asm/security_features.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,11 @@ static inline bool security_ftr_enabled(u64 feature)
3939
return !!(powerpc_security_features & feature);
4040
}
4141

42+
#ifdef CONFIG_PPC_BOOK3S_64
43+
enum stf_barrier_type stf_barrier_type_get(void);
44+
#else
45+
static inline enum stf_barrier_type stf_barrier_type_get(void) { return STF_BARRIER_NONE; }
46+
#endif
4247

4348
// Features indicating support for Spectre/Meltdown mitigations
4449

arch/powerpc/kernel/security.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -263,6 +263,11 @@ static int __init handle_no_stf_barrier(char *p)
263263

264264
early_param("no_stf_barrier", handle_no_stf_barrier);
265265

266+
enum stf_barrier_type stf_barrier_type_get(void)
267+
{
268+
return stf_enabled_flush_types;
269+
}
270+
266271
/* This is the generic flag used by other architectures */
267272
static int __init handle_ssbd(char *p)
268273
{

0 commit comments

Comments
 (0)