From: Mathieu Desnoyers Date: Mon, 29 Apr 2019 15:28:01 +0000 (-0400) Subject: rseq/selftests: powerpc code signature: generate valid instructions X-Git-Tag: v5.4-rc1~948^2~7 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=496fd0fc9f5c4c187e69e8697387a7604ab7141d;p=platform%2Fkernel%2Flinux-rpi.git rseq/selftests: powerpc code signature: generate valid instructions Use "twui" as the guard instruction for the restartable sequence abort handler. Signed-off-by: Mathieu Desnoyers CC: Benjamin Herrenschmidt CC: Paul Mackerras CC: Michael Ellerman CC: Boqun Feng CC: Peter Zijlstra CC: "Paul E. McKenney" CC: Alan Modra CC: linuxppc-dev@lists.ozlabs.org Signed-off-by: Shuah Khan --- diff --git a/tools/testing/selftests/rseq/rseq-ppc.h b/tools/testing/selftests/rseq/rseq-ppc.h index 9df1848..76be901 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 */ -#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")