Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

powerpc/64: Call setup_barrier_nospec() from setup_arch()

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>

+6 -2
+4
arch/powerpc/include/asm/setup.h
··· 52 52 53 53 void setup_rfi_flush(enum l1d_flush_type, bool enable); 54 54 void do_rfi_flush_fixups(enum l1d_flush_type types); 55 + #ifdef CONFIG_PPC_BARRIER_NOSPEC 55 56 void setup_barrier_nospec(void); 57 + #else 58 + static inline void setup_barrier_nospec(void) { }; 59 + #endif 56 60 void do_barrier_nospec_fixups(bool enable); 57 61 extern bool barrier_nospec_enabled; 58 62
+2
arch/powerpc/kernel/setup-common.c
··· 972 972 if (ppc_md.setup_arch) 973 973 ppc_md.setup_arch(); 974 974 975 + setup_barrier_nospec(); 976 + 975 977 paging_init(); 976 978 977 979 /* Initialize the MMU context management stuff. */
-1
arch/powerpc/platforms/powernv/setup.c
··· 124 124 security_ftr_enabled(SEC_FTR_L1D_FLUSH_HV)); 125 125 126 126 setup_rfi_flush(type, enable); 127 - setup_barrier_nospec(); 128 127 } 129 128 130 129 static void __init pnv_setup_arch(void)
-1
arch/powerpc/platforms/pseries/setup.c
··· 551 551 security_ftr_enabled(SEC_FTR_L1D_FLUSH_PR); 552 552 553 553 setup_rfi_flush(types, enable); 554 - setup_barrier_nospec(); 555 554 } 556 555 557 556 #ifdef CONFIG_PCI_IOV