summaryrefslogtreecommitdiffstats
path: root/arch/powerpc/kernel/security.c
diff options
context:
space:
mode:
authorNicholas Piggin <npiggin@gmail.com>2021-05-03 23:02:41 +1000
committerMichael Ellerman <mpe@ellerman.id.au>2021-06-21 21:13:19 +1000
commit84ed26fd00c514da57cd46aa3728a48f1f9b35cd (patch)
treec57be6639b730d5a84d556460bc92319e1085816 /arch/powerpc/kernel/security.c
parent65c7d070850e109a8a75a431f5a7f6eb4c007b77 (diff)
downloadlinux-84ed26fd00c514da57cd46aa3728a48f1f9b35cd.tar.gz
linux-84ed26fd00c514da57cd46aa3728a48f1f9b35cd.tar.bz2
linux-84ed26fd00c514da57cd46aa3728a48f1f9b35cd.zip
powerpc/security: Add a security feature for STF barrier
Rather than tying this mitigation to RFI L1D flush requirement, add a new bit for it. Signed-off-by: Nicholas Piggin <npiggin@gmail.com> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au> Link: https://lore.kernel.org/r/20210503130243.891868-3-npiggin@gmail.com
Diffstat (limited to 'arch/powerpc/kernel/security.c')
-rw-r--r--arch/powerpc/kernel/security.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/arch/powerpc/kernel/security.c b/arch/powerpc/kernel/security.c
index 9c2f7b909911..cc51fa52e783 100644
--- a/arch/powerpc/kernel/security.c
+++ b/arch/powerpc/kernel/security.c
@@ -300,9 +300,7 @@ static void stf_barrier_enable(bool enable)
void setup_stf_barrier(void)
{
enum stf_barrier_type type;
- bool enable, hv;
-
- hv = cpu_has_feature(CPU_FTR_HVMODE);
+ bool enable;
/* Default to fallback in case fw-features are not available */
if (cpu_has_feature(CPU_FTR_ARCH_300))
@@ -315,8 +313,7 @@ void setup_stf_barrier(void)
type = STF_BARRIER_NONE;
enable = security_ftr_enabled(SEC_FTR_FAVOUR_SECURITY) &&
- (security_ftr_enabled(SEC_FTR_L1D_FLUSH_PR) ||
- (security_ftr_enabled(SEC_FTR_L1D_FLUSH_HV) && hv));
+ security_ftr_enabled(SEC_FTR_STF_BARRIER);
if (type == STF_BARRIER_FALLBACK) {
pr_info("stf-barrier: fallback barrier available\n");