This repository was archived by the owner on Nov 8, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +6
-5
lines changed Expand file tree Collapse file tree 2 files changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -92,13 +92,17 @@ static inline bool security_ftr_enabled(u64 feature)
92
92
// The L1-D cache should be flushed after user accesses from the kernel
93
93
#define SEC_FTR_L1D_FLUSH_UACCESS 0x0000000000008000ull
94
94
95
+ // The STF flush should be executed on privilege state switch
96
+ #define SEC_FTR_STF_BARRIER 0x0000000000010000ull
97
+
95
98
// Features enabled by default
96
99
#define SEC_FTR_DEFAULT \
97
100
(SEC_FTR_L1D_FLUSH_HV | \
98
101
SEC_FTR_L1D_FLUSH_PR | \
99
102
SEC_FTR_BNDS_CHK_SPEC_BAR | \
100
103
SEC_FTR_L1D_FLUSH_ENTRY | \
101
104
SEC_FTR_L1D_FLUSH_UACCESS | \
105
+ SEC_FTR_STF_BARRIER | \
102
106
SEC_FTR_FAVOUR_SECURITY)
103
107
104
108
#endif /* _ASM_POWERPC_SECURITY_FEATURES_H */
Original file line number Diff line number Diff line change @@ -300,9 +300,7 @@ static void stf_barrier_enable(bool enable)
300
300
void setup_stf_barrier (void )
301
301
{
302
302
enum stf_barrier_type type ;
303
- bool enable , hv ;
304
-
305
- hv = cpu_has_feature (CPU_FTR_HVMODE );
303
+ bool enable ;
306
304
307
305
/* Default to fallback in case fw-features are not available */
308
306
if (cpu_has_feature (CPU_FTR_ARCH_300 ))
@@ -315,8 +313,7 @@ void setup_stf_barrier(void)
315
313
type = STF_BARRIER_NONE ;
316
314
317
315
enable = security_ftr_enabled (SEC_FTR_FAVOUR_SECURITY ) &&
318
- (security_ftr_enabled (SEC_FTR_L1D_FLUSH_PR ) ||
319
- (security_ftr_enabled (SEC_FTR_L1D_FLUSH_HV ) && hv ));
316
+ security_ftr_enabled (SEC_FTR_STF_BARRIER );
320
317
321
318
if (type == STF_BARRIER_FALLBACK ) {
322
319
pr_info ("stf-barrier: fallback barrier available\n" );
You can’t perform that action at this time.
0 commit comments