diff mbox series

[v2,1/3] powerpc/fsl: Disable the speculation barrier from the command line

Message ID 1528721608-15443-2-git-send-email-diana.craciun@nxp.com (mailing list archive)
State Changes Requested
Headers show
Series powerpc/fsl: Speculation barrier for NXP PowerPC Book3E | expand

Commit Message

Diana Craciun June 11, 2018, 12:53 p.m. UTC
The speculation barrier can be disabled from the command line
with the parameter: "nospectre_v1".

Signed-off-by: Diana Craciun <diana.craciun@nxp.com>
---
 arch/powerpc/kernel/security.c | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

Comments

Michael Ellerman July 3, 2018, 7:25 a.m. UTC | #1
Diana Craciun <diana.craciun@nxp.com> writes:

> The speculation barrier can be disabled from the command line
> with the parameter: "nospectre_v1".

Can you please send another patch adding it to Documentation/admin-guide/kernel-parameters.txt

You should mark it as "PPC" only for now.

cheers
diff mbox series

Patch

diff --git a/arch/powerpc/kernel/security.c b/arch/powerpc/kernel/security.c
index 3eb9c45..c55e102 100644
--- a/arch/powerpc/kernel/security.c
+++ b/arch/powerpc/kernel/security.c
@@ -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)
 {