powerpc/64s: rename pnv|pseries_setup_rfi_flush to _setup_security_mitigations
authorDaniel Axtens <dja@axtens.net>
Tue, 17 Nov 2020 05:59:16 +0000 (16:59 +1100)
committerMichael Ellerman <mpe@ellerman.id.au>
Thu, 19 Nov 2020 12:47:25 +0000 (23:47 +1100)
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: Daniel Axtens <dja@axtens.net>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
arch/powerpc/platforms/powernv/setup.c
arch/powerpc/platforms/pseries/mobility.c
arch/powerpc/platforms/pseries/pseries.h
arch/powerpc/platforms/pseries/setup.c

index 087ec92acfc4686332d133af3db23fb64a76c5d1..46115231a3b2b516bf27d465bf7b161095a967ab 100644 (file)
@@ -98,7 +98,7 @@ static void init_fw_feat_flags(struct device_node *np)
                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;
        enum l1d_flush_type type;
@@ -145,6 +145,8 @@ static void pnv_setup_rfi_flush(void)
        enable = security_ftr_enabled(SEC_FTR_FAVOUR_SECURITY) &&
                 security_ftr_enabled(SEC_FTR_L1D_FLUSH_UACCESS);
        setup_uaccess_flush(enable);
+
+       setup_stf_barrier();
 }
 
 static void __init pnv_check_guarded_cores(void)
@@ -173,8 +175,7 @@ static void __init pnv_setup_arch(void)
 {
        set_arch_panic_timeout(10, ARCH_PANIC_TIMEOUT);
 
-       pnv_setup_rfi_flush();
-       setup_stf_barrier();
+       pnv_setup_security_mitigations();
 
        /* Initialize SMP */
        pnv_smp_init();
index d6f4162478a505448acfac6d64907f3a7824fc1d..2f73cb5bf12d5635f81a63a5fdb7ab7e53dda0d3 100644 (file)
@@ -349,8 +349,8 @@ void post_mobility_fixup(void)
 
        cpus_read_unlock();
 
-       /* Possibly switch to a new RFI flush type */
-       pseries_setup_rfi_flush();
+       /* Possibly switch to a new L1 flush type */
+       pseries_setup_security_mitigations();
 
        /* Reinitialise system information for hv-24x7 */
        read_24x7_sys_info();
index 13fa370a87e4eb0d660482060a3b3d424483b559..593840847cd3dc83324ee4c157c1afaeff3efe16 100644 (file)
@@ -111,7 +111,7 @@ static inline unsigned long cmo_get_page_size(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);
 
 #endif /* _PSERIES_PSERIES_H */
index 3617cdb079f6d5c74929d9d093571c76efd6de13..090c13f6c8815c67992f8f55dec929faac3bbfb2 100644 (file)
@@ -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);
 }
 
-void pseries_setup_rfi_flush(void)
+void pseries_setup_security_mitigations(void)
 {
        struct h_cpu_char_result result;
        enum l1d_flush_type types;
@@ -587,6 +587,8 @@ void pseries_setup_rfi_flush(void)
        enable = security_ftr_enabled(SEC_FTR_FAVOUR_SECURITY) &&
                 security_ftr_enabled(SEC_FTR_L1D_FLUSH_UACCESS);
        setup_uaccess_flush(enable);
+
+       setup_stf_barrier();
 }
 
 #ifdef CONFIG_PCI_IOV
@@ -776,8 +778,7 @@ static void __init pSeries_setup_arch(void)
 
        fwnmi_init();
 
-       pseries_setup_rfi_flush();
-       setup_stf_barrier();
+       pseries_setup_security_mitigations();
        pseries_lpar_read_hblkrm_characteristics();
 
        /* By default, only probe PCI (can be overridden by rtas_pci) */