]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commitdiff
powerpc/64: Disable the speculation barrier from the command line
authorDiana Craciun <diana.craciun@nxp.com>
Fri, 27 Jul 2018 23:06:32 +0000 (09:06 +1000)
committerKleber Sacilotto de Souza <kleber.souza@canonical.com>
Tue, 23 Apr 2019 15:48:54 +0000 (17:48 +0200)
The speculation barrier can be disabled from the command line
with the parameter: "nospectre_v1".

BugLink: https://bugs.launchpad.net/bugs/1822870
Signed-off-by: Diana Craciun <diana.craciun@nxp.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
(cherry picked from commit cf175dc315f90185128fb061dc05b6fbb211aa2f)
Signed-off-by: Manoj Iyer <manoj.iyer@canonical.com>
Acked-by: Stefan Bader <stefan.bader@canonical.com>
Acked-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
arch/powerpc/kernel/security.c

index 4cb8f1f7b5935178894596cb2870b785a5972c18..79f9397998ed4b7458d5b4cc227fc83bf703520f 100644 (file)
@@ -16,6 +16,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)
 {
@@ -42,9 +43,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)
 {