* [PATCH for 5.2 10/12] rseq/selftests: powerpc code signature: generate valid instructions
[not found] <20190429152803.7719-1-mathieu.desnoyers@efficios.com>
@ 2019-04-29 15:28 ` Mathieu Desnoyers
0 siblings, 0 replies; only message in thread
From: Mathieu Desnoyers @ 2019-04-29 15:28 UTC (permalink / raw)
To: Shuah Khan
Cc: Joel Fernandes, Peter Zijlstra, Catalin Marinas, Dave Watson,
Will Deacon, Andi Kleen, Paul Mackerras, H . Peter Anvin,
Chris Lameter, Russell King, Ingo Molnar, Michael Kerrisk,
Paul E . McKenney, Paul Turner, Alan Modra, Boqun Feng,
Josh Triplett, Steven Rostedt, Ben Maurer, Mathieu Desnoyers,
Thomas Gleixner, linux-api, linuxppc-dev, linux-kernel,
Andy Lutomirski, Andrew Morton, Linus Torvalds
Use "twui" as the guard instruction for the restartable sequence abort
handler.
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
CC: Benjamin Herrenschmidt <benh@kernel.crashing.org>
CC: Paul Mackerras <paulus@samba.org>
CC: Michael Ellerman <mpe@ellerman.id.au>
CC: Boqun Feng <boqun.feng@gmail.com>
CC: Peter Zijlstra <peterz@infradead.org>
CC: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
CC: Alan Modra <amodra@gmail.com>
CC: linuxppc-dev@lists.ozlabs.org
---
tools/testing/selftests/rseq/rseq-ppc.h | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
diff --git a/tools/testing/selftests/rseq/rseq-ppc.h b/tools/testing/selftests/rseq/rseq-ppc.h
index 9df18487fa9f..76be90196fe4 100644
--- a/tools/testing/selftests/rseq/rseq-ppc.h
+++ b/tools/testing/selftests/rseq/rseq-ppc.h
@@ -6,7 +6,15 @@
* (C) Copyright 2016-2018 - Boqun Feng <boqun.feng@gmail.com>
*/
-#define RSEQ_SIG 0x53053053
+/*
+ * RSEQ_SIG is used with the following trap instruction:
+ *
+ * powerpc-be: 0f e5 00 0b twui r5,11
+ * powerpc64-le: 0b 00 e5 0f twui r5,11
+ * powerpc64-be: 0f e5 00 0b twui r5,11
+ */
+
+#define RSEQ_SIG 0x0fe5000b
#define rseq_smp_mb() __asm__ __volatile__ ("sync" ::: "memory", "cc")
#define rseq_smp_lwsync() __asm__ __volatile__ ("lwsync" ::: "memory", "cc")
--
2.11.0
^ permalink raw reply related [flat|nested] only message in thread