]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
powerpc/64: Call setup_barrier_nospec() from setup_arch()
authorMichael Ellerman <mpe@ellerman.id.au>
Thu, 11 Apr 2019 11:46:09 +0000 (21:46 +1000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 17 Apr 2019 06:36:41 +0000 (08:36 +0200)
commit af375eefbfb27cbb5b831984e66d724a40d26b5c upstream.

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().

Signed-off-by: Diana Craciun <diana.craciun@nxp.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Signed-off-by: Sasha Levin <sashal@kernel.org>
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 38525bd2ed6566505c5f8ad002ec248b6a8a8d4f..d3e9da62d0292b0bf27932000254a8c33aabdd03 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 bf0f712ac0e0def3bb804cee0d98abac33025b8c..d5a128f5453778b915b63b2c3656cf926c6e9c7f 100644 (file)
@@ -918,6 +918,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 eb5464648810ebcc431233b0a74072b73a56059e..17203abf38e85b8840a6fbd4d2e4b6500ae00f80 100644 (file)
@@ -123,7 +123,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 2b2759c98c7ed2156b3b2f98c85ef59adbc184a9..91ade77558239e119b9e3d545ebf702eefb66c98 100644 (file)
@@ -525,7 +525,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)