Commit da631f7f authored by Daniel Axtens's avatar Daniel Axtens Committed by Michael Ellerman

powerpc/64s: rename pnv|pseries_setup_rfi_flush to _setup_security_mitigations

pseries|pnv_setup_rfi_flush already does the count cache flush setup, and
we just added entry and uaccess flushes. So the name is not very accurate
any more. In both platforms we then also immediately setup the STF flush.

Rename them to _setup_security_mitigations and fold the STF flush in.
Signed-off-by: default avatarDaniel Axtens <dja@axtens.net>
Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
parent 0d239f3b
...@@ -98,7 +98,7 @@ static void init_fw_feat_flags(struct device_node *np) ...@@ -98,7 +98,7 @@ static void init_fw_feat_flags(struct device_node *np)
security_ftr_clear(SEC_FTR_BNDS_CHK_SPEC_BAR); security_ftr_clear(SEC_FTR_BNDS_CHK_SPEC_BAR);
} }
static void pnv_setup_rfi_flush(void) static void pnv_setup_security_mitigations(void)
{ {
struct device_node *np, *fw_features; struct device_node *np, *fw_features;
enum l1d_flush_type type; enum l1d_flush_type type;
...@@ -145,6 +145,8 @@ static void pnv_setup_rfi_flush(void) ...@@ -145,6 +145,8 @@ static void pnv_setup_rfi_flush(void)
enable = security_ftr_enabled(SEC_FTR_FAVOUR_SECURITY) && enable = security_ftr_enabled(SEC_FTR_FAVOUR_SECURITY) &&
security_ftr_enabled(SEC_FTR_L1D_FLUSH_UACCESS); security_ftr_enabled(SEC_FTR_L1D_FLUSH_UACCESS);
setup_uaccess_flush(enable); setup_uaccess_flush(enable);
setup_stf_barrier();
} }
static void __init pnv_check_guarded_cores(void) static void __init pnv_check_guarded_cores(void)
...@@ -173,8 +175,7 @@ static void __init pnv_setup_arch(void) ...@@ -173,8 +175,7 @@ static void __init pnv_setup_arch(void)
{ {
set_arch_panic_timeout(10, ARCH_PANIC_TIMEOUT); set_arch_panic_timeout(10, ARCH_PANIC_TIMEOUT);
pnv_setup_rfi_flush(); pnv_setup_security_mitigations();
setup_stf_barrier();
/* Initialize SMP */ /* Initialize SMP */
pnv_smp_init(); pnv_smp_init();
......
...@@ -349,8 +349,8 @@ void post_mobility_fixup(void) ...@@ -349,8 +349,8 @@ void post_mobility_fixup(void)
cpus_read_unlock(); cpus_read_unlock();
/* Possibly switch to a new RFI flush type */ /* Possibly switch to a new L1 flush type */
pseries_setup_rfi_flush(); pseries_setup_security_mitigations();
/* Reinitialise system information for hv-24x7 */ /* Reinitialise system information for hv-24x7 */
read_24x7_sys_info(); read_24x7_sys_info();
......
...@@ -111,7 +111,7 @@ static inline unsigned long cmo_get_page_size(void) ...@@ -111,7 +111,7 @@ static inline unsigned long cmo_get_page_size(void)
int dlpar_workqueue_init(void); int dlpar_workqueue_init(void);
void pseries_setup_rfi_flush(void); void pseries_setup_security_mitigations(void);
void pseries_lpar_read_hblkrm_characteristics(void); void pseries_lpar_read_hblkrm_characteristics(void);
#endif /* _PSERIES_PSERIES_H */ #endif /* _PSERIES_PSERIES_H */
...@@ -542,7 +542,7 @@ static void init_cpu_char_feature_flags(struct h_cpu_char_result *result) ...@@ -542,7 +542,7 @@ static void init_cpu_char_feature_flags(struct h_cpu_char_result *result)
security_ftr_clear(SEC_FTR_BNDS_CHK_SPEC_BAR); security_ftr_clear(SEC_FTR_BNDS_CHK_SPEC_BAR);
} }
void pseries_setup_rfi_flush(void) void pseries_setup_security_mitigations(void)
{ {
struct h_cpu_char_result result; struct h_cpu_char_result result;
enum l1d_flush_type types; enum l1d_flush_type types;
...@@ -587,6 +587,8 @@ void pseries_setup_rfi_flush(void) ...@@ -587,6 +587,8 @@ void pseries_setup_rfi_flush(void)
enable = security_ftr_enabled(SEC_FTR_FAVOUR_SECURITY) && enable = security_ftr_enabled(SEC_FTR_FAVOUR_SECURITY) &&
security_ftr_enabled(SEC_FTR_L1D_FLUSH_UACCESS); security_ftr_enabled(SEC_FTR_L1D_FLUSH_UACCESS);
setup_uaccess_flush(enable); setup_uaccess_flush(enable);
setup_stf_barrier();
} }
#ifdef CONFIG_PCI_IOV #ifdef CONFIG_PCI_IOV
...@@ -776,8 +778,7 @@ static void __init pSeries_setup_arch(void) ...@@ -776,8 +778,7 @@ static void __init pSeries_setup_arch(void)
fwnmi_init(); fwnmi_init();
pseries_setup_rfi_flush(); pseries_setup_security_mitigations();
setup_stf_barrier();
pseries_lpar_read_hblkrm_characteristics(); pseries_lpar_read_hblkrm_characteristics();
/* By default, only probe PCI (can be overridden by rtas_pci) */ /* By default, only probe PCI (can be overridden by rtas_pci) */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment