]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blob - queue-4.4/powerpc-64-call-setup_barrier_nospec-from-setup_arch.patch
4.4-stable patches
[thirdparty/kernel/stable-queue.git] / queue-4.4 / powerpc-64-call-setup_barrier_nospec-from-setup_arch.patch
1 From foo@baz Mon 29 Apr 2019 11:38:37 AM CEST
2 From: Michael Ellerman <mpe@ellerman.id.au>
3 Date: Mon, 22 Apr 2019 00:20:21 +1000
4 Subject: powerpc/64: Call setup_barrier_nospec() from setup_arch()
5 To: stable@vger.kernel.org, gregkh@linuxfoundation.org
6 Cc: linuxppc-dev@ozlabs.org, diana.craciun@nxp.com, msuchanek@suse.de, npiggin@gmail.com, christophe.leroy@c-s.fr
7 Message-ID: <20190421142037.21881-37-mpe@ellerman.id.au>
8
9 From: Michael Ellerman <mpe@ellerman.id.au>
10
11 commit af375eefbfb27cbb5b831984e66d724a40d26b5c upstream.
12
13 Currently we require platform code to call setup_barrier_nospec(). But
14 if we add an empty definition for the !CONFIG_PPC_BARRIER_NOSPEC case
15 then we can call it in setup_arch().
16
17 Signed-off-by: Diana Craciun <diana.craciun@nxp.com>
18 Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
19 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
20 ---
21 arch/powerpc/include/asm/setup.h | 4 ++++
22 arch/powerpc/kernel/setup_32.c | 2 ++
23 arch/powerpc/kernel/setup_64.c | 2 ++
24 arch/powerpc/platforms/powernv/setup.c | 1 -
25 arch/powerpc/platforms/pseries/setup.c | 1 -
26 5 files changed, 8 insertions(+), 2 deletions(-)
27
28 --- a/arch/powerpc/include/asm/setup.h
29 +++ b/arch/powerpc/include/asm/setup.h
30 @@ -38,7 +38,11 @@ enum l1d_flush_type {
31
32 void setup_rfi_flush(enum l1d_flush_type, bool enable);
33 void do_rfi_flush_fixups(enum l1d_flush_type types);
34 +#ifdef CONFIG_PPC_BARRIER_NOSPEC
35 void setup_barrier_nospec(void);
36 +#else
37 +static inline void setup_barrier_nospec(void) { };
38 +#endif
39 void do_barrier_nospec_fixups(bool enable);
40 extern bool barrier_nospec_enabled;
41
42 --- a/arch/powerpc/kernel/setup_32.c
43 +++ b/arch/powerpc/kernel/setup_32.c
44 @@ -322,6 +322,8 @@ void __init setup_arch(char **cmdline_p)
45 ppc_md.setup_arch();
46 if ( ppc_md.progress ) ppc_md.progress("arch: exit", 0x3eab);
47
48 + setup_barrier_nospec();
49 +
50 paging_init();
51
52 /* Initialize the MMU context management stuff */
53 --- a/arch/powerpc/kernel/setup_64.c
54 +++ b/arch/powerpc/kernel/setup_64.c
55 @@ -736,6 +736,8 @@ void __init setup_arch(char **cmdline_p)
56 if (ppc_md.setup_arch)
57 ppc_md.setup_arch();
58
59 + setup_barrier_nospec();
60 +
61 paging_init();
62
63 /* Initialize the MMU context management stuff */
64 --- a/arch/powerpc/platforms/powernv/setup.c
65 +++ b/arch/powerpc/platforms/powernv/setup.c
66 @@ -123,7 +123,6 @@ static void pnv_setup_rfi_flush(void)
67 security_ftr_enabled(SEC_FTR_L1D_FLUSH_HV));
68
69 setup_rfi_flush(type, enable);
70 - setup_barrier_nospec();
71 }
72
73 static void __init pnv_setup_arch(void)
74 --- a/arch/powerpc/platforms/pseries/setup.c
75 +++ b/arch/powerpc/platforms/pseries/setup.c
76 @@ -574,7 +574,6 @@ void pseries_setup_rfi_flush(void)
77 security_ftr_enabled(SEC_FTR_L1D_FLUSH_PR);
78
79 setup_rfi_flush(types, enable);
80 - setup_barrier_nospec();
81 }
82
83 static void __init pSeries_setup_arch(void)