Skip to content

Commit

Permalink
powerpc/64: Call setup_barrier_nospec() from setup_arch()
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Michael Ellerman committed Aug 7, 2018
1 parent 179ab1c commit af375ee
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 2 deletions.
4 changes: 4 additions & 0 deletions arch/powerpc/include/asm/setup.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,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;

Expand Down
2 changes: 2 additions & 0 deletions arch/powerpc/kernel/setup-common.c
Original file line number Diff line number Diff line change
Expand Up @@ -972,6 +972,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. */
Expand Down
1 change: 0 additions & 1 deletion arch/powerpc/platforms/powernv/setup.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
1 change: 0 additions & 1 deletion arch/powerpc/platforms/pseries/setup.c
Original file line number Diff line number Diff line change
Expand Up @@ -551,7 +551,6 @@ void pseries_setup_rfi_flush(void)
security_ftr_enabled(SEC_FTR_L1D_FLUSH_PR);

setup_rfi_flush(types, enable);
setup_barrier_nospec();
}

#ifdef CONFIG_PCI_IOV
Expand Down

0 comments on commit af375ee

Please sign in to comment.