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:18 +1000
4 Subject: powerpc/64: Disable the speculation barrier from the command line
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-34-mpe@ellerman.id.au>
9 From: Diana Craciun <diana.craciun@nxp.com>
11 commit cf175dc315f90185128fb061dc05b6fbb211aa2f upstream.
13 The speculation barrier can be disabled from the command line
14 with the parameter: "nospectre_v1".
16 Signed-off-by: Diana Craciun <diana.craciun@nxp.com>
17 Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
18 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
20 arch/powerpc/kernel/security.c | 12 +++++++++++-
21 1 file changed, 11 insertions(+), 1 deletion(-)
23 --- a/arch/powerpc/kernel/security.c
24 +++ b/arch/powerpc/kernel/security.c
26 unsigned long powerpc_security_features __read_mostly = SEC_FTR_DEFAULT;
28 bool barrier_nospec_enabled;
29 +static bool no_nospec;
31 static void enable_barrier_nospec(bool enable)
33 @@ -43,9 +44,18 @@ void setup_barrier_nospec(void)
34 enable = security_ftr_enabled(SEC_FTR_FAVOUR_SECURITY) &&
35 security_ftr_enabled(SEC_FTR_BNDS_CHK_SPEC_BAR);
37 - enable_barrier_nospec(enable);
39 + enable_barrier_nospec(enable);
42 +static int __init handle_nospectre_v1(char *p)
48 +early_param("nospectre_v1", handle_nospectre_v1);
50 #ifdef CONFIG_DEBUG_FS
51 static int barrier_nospec_set(void *data, u64 val)