]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commitdiff
powerpc/64: Call setup_barrier_nospec() from setup_arch()
authorMichael Ellerman <mpe@ellerman.id.au>
Fri, 27 Jul 2018 23:06:35 +0000 (09:06 +1000)
committerKleber Sacilotto de Souza <kleber.souza@canonical.com>
Tue, 23 Apr 2019 15:48:54 +0000 (17:48 +0200)
Currently we require platform code to call setup_barrier_nospec(). But
if we add an empty definition for the !CONFIG_PPC_BARRIER_NOSPEC case
then we can call it in setup_arch().

BugLink: https://bugs.launchpad.net/bugs/1822870
Signed-off-by: Diana Craciun <diana.craciun@nxp.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
(cherry picked from commit af375eefbfb27cbb5b831984e66d724a40d26b5c)
Signed-off-by: Manoj Iyer <manoj.iyer@canonical.com>
Acked-by: Stefan Bader <stefan.bader@canonical.com>
Acked-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
arch/powerpc/include/asm/setup.h
arch/powerpc/kernel/setup-common.c
arch/powerpc/platforms/powernv/setup.c
arch/powerpc/platforms/pseries/setup.c

index 4daea2f2a4a4277fda46c0ce5ab23bd0eb50c33a..0c78fc08f11a7adb2cd9dcd13d6585405d3f4116 100644 (file)
@@ -51,7 +51,11 @@ enum l1d_flush_type {
 
 void setup_rfi_flush(enum l1d_flush_type, bool enable);
 void do_rfi_flush_fixups(enum l1d_flush_type types);
+#ifdef CONFIG_PPC_BARRIER_NOSPEC
 void setup_barrier_nospec(void);
+#else
+static inline void setup_barrier_nospec(void) { };
+#endif
 void do_barrier_nospec_fixups(bool enable);
 extern bool barrier_nospec_enabled;
 
index d293c7d22b6d0ea0cc5da435d52ed03dac3f5986..981ecafd2bee3373b36ba1db51b5c9cbb61135b3 100644 (file)
@@ -963,6 +963,8 @@ void __init setup_arch(char **cmdline_p)
        if (ppc_md.setup_arch)
                ppc_md.setup_arch();
 
+       setup_barrier_nospec();
+
        paging_init();
 
        /* Initialize the MMU context management stuff. */
index 3b9fee1ad1e7a5ccff8df154ba29ef2a6b2380f2..be7eac602402102309f9103186a2a75eb8e4676f 100644 (file)
@@ -124,7 +124,6 @@ static void pnv_setup_rfi_flush(void)
                  security_ftr_enabled(SEC_FTR_L1D_FLUSH_HV));
 
        setup_rfi_flush(type, enable);
-       setup_barrier_nospec();
 }
 
 static void __init pnv_setup_arch(void)
index ac12ec4d839db42aa7dae69eda7bf86d82af5917..45f814041448c56100debd01be0d7f909bff7e11 100644 (file)
@@ -534,7 +534,6 @@ void pseries_setup_rfi_flush(void)
                 security_ftr_enabled(SEC_FTR_L1D_FLUSH_PR);
 
        setup_rfi_flush(types, enable);
-       setup_barrier_nospec();
 }
 
 static void __init pSeries_setup_arch(void)