diff options
author | Diana Craciun <diana.craciun@nxp.com> | 2019-04-21 17:20:18 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2019-05-16 20:44:48 +0300 |
commit | 58dbc8def9497015169807849bed6a542e651d41 (patch) | |
tree | ea1922ad74de0625d76b7a56718548ff5266cf68 /arch/powerpc | |
parent | d000015f628306b3aa4433e5b60d244dc9334dcd (diff) | |
download | linux-58dbc8def9497015169807849bed6a542e651d41.tar.xz |
powerpc/64: Disable the speculation barrier from the command line
commit cf175dc315f90185128fb061dc05b6fbb211aa2f upstream.
The speculation barrier can be disabled from the command line
with the parameter: "nospectre_v1".
Signed-off-by: Diana Craciun <diana.craciun@nxp.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'arch/powerpc')
-rw-r--r-- | arch/powerpc/kernel/security.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/arch/powerpc/kernel/security.c b/arch/powerpc/kernel/security.c index e74057ba2e36..acfb11853d29 100644 --- a/arch/powerpc/kernel/security.c +++ b/arch/powerpc/kernel/security.c @@ -17,6 +17,7 @@ unsigned long powerpc_security_features __read_mostly = SEC_FTR_DEFAULT; bool barrier_nospec_enabled; +static bool no_nospec; static void enable_barrier_nospec(bool enable) { @@ -43,9 +44,18 @@ void setup_barrier_nospec(void) enable = security_ftr_enabled(SEC_FTR_FAVOUR_SECURITY) && security_ftr_enabled(SEC_FTR_BNDS_CHK_SPEC_BAR); - enable_barrier_nospec(enable); + if (!no_nospec) + enable_barrier_nospec(enable); } +static int __init handle_nospectre_v1(char *p) +{ + no_nospec = true; + + return 0; +} +early_param("nospectre_v1", handle_nospectre_v1); + #ifdef CONFIG_DEBUG_FS static int barrier_nospec_set(void *data, u64 val) { |