[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <e1c146e5d43e8b2605af6e1330167d8e18d36f44.1520965380.git.msuchanek@suse.de>
Date: Tue, 13 Mar 2018 19:32:59 +0100
From: Michal Suchanek <msuchanek@...e.de>
To: linuxppc-dev@...ts.ozlabs.org
Cc: Benjamin Herrenschmidt <benh@...nel.crashing.org>,
Paul Mackerras <paulus@...ba.org>,
Michael Ellerman <mpe@...erman.id.au>,
Peter Zijlstra <peterz@...radead.org>,
Michal Suchanek <msuchanek@...e.de>,
Kate Stewart <kstewart@...uxfoundation.org>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Philippe Ombredanne <pombredanne@...b.com>,
Nicholas Piggin <npiggin@...il.com>,
"Tobin C. Harding" <me@...in.cc>,
Mahesh Salgaonkar <mahesh@...ux.vnet.ibm.com>,
David Gibson <david@...son.dropbear.id.au>,
Al Viro <viro@...iv.linux.org.uk>,
Michael Neuling <mikey@...ling.org>,
"Oliver O'Halloran" <oohall@...il.com>,
"Naveen N. Rao" <naveen.n.rao@...ux.vnet.ibm.com>,
Madhavan Srinivasan <maddy@...ux.vnet.ibm.com>,
Masami Hiramatsu <mhiramat@...nel.org>,
Andrew Morton <akpm@...ux-foundation.org>,
Balbir Singh <bsingharora@...il.com>,
Sergey Senozhatsky <sergey.senozhatsky@...il.com>,
Christophe Leroy <christophe.leroy@....fr>,
Andrew Donnellan <andrew.donnellan@....ibm.com>,
Daniel Axtens <dja@...ens.net>,
Russell Currey <ruscur@...sell.cc>,
Joe Perches <joe@...ches.com>,
"Bryant G. Ly" <bryantly@...ux.vnet.ibm.com>,
Cédric Le Goater <clg@...d.org>,
linux-kernel@...r.kernel.org
Subject: [PATCH RFC 1/8] powerpc: Add barrier_nospec
Copypasta from original gmb() and rfi implementation
Signed-off-by: Michal Suchanek <msuchanek@...e.de>
---
arch/powerpc/include/asm/barrier.h | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/arch/powerpc/include/asm/barrier.h b/arch/powerpc/include/asm/barrier.h
index 10daa1d56e0a..8e47b3abe405 100644
--- a/arch/powerpc/include/asm/barrier.h
+++ b/arch/powerpc/include/asm/barrier.h
@@ -75,6 +75,15 @@ do { \
___p1; \
})
+/* TODO: add patching so this can be disabled */
+/* Prevent speculative execution past this barrier. */
+#define barrier_nospec_asm ori 31,31,0
+#ifdef __ASSEMBLY__
+#define barrier_nospec barrier_nospec_asm
+#else
+#define barrier_nospec() __asm__ __volatile__ (stringify_in_c(barrier_nospec_asm) : : :)
+#endif
+
#include <asm-generic/barrier.h>
#endif /* _ASM_POWERPC_BARRIER_H */
--
2.13.6
Powered by blists - more mailing lists