aboutsummaryrefslogtreecommitdiffstats
path: root/tools/testing/selftests/powerpc/tm/tm-syscall-asm.S
diff options
context:
space:
mode:
authorNicholas Piggin <npiggin@gmail.com>2021-09-03 22:57:07 +1000
committerMichael Ellerman <mpe@ellerman.id.au>2021-09-13 22:34:11 +1000
commit5379ef2a60431232b9bb01c6d3580b875123d723 (patch)
treed0ec1fcc6d00a876e88681f4863579bf2e9f084f /tools/testing/selftests/powerpc/tm/tm-syscall-asm.S
parentpowerpc/64s: system call scv tabort fix for corrupt irq soft-mask state (diff)
downloadlinux-5379ef2a60431232b9bb01c6d3580b875123d723.tar.gz
linux-5379ef2a60431232b9bb01c6d3580b875123d723.zip
selftests/powerpc: Add scv versions of the basic TM syscall tests
The basic TM vs syscall test code hard codes an sc instruction for the system call, which fails to cover scv even when the userspace libc has support for it. Duplicate the tests with hard coded scv variants so both are tested when possible. Signed-off-by: Nicholas Piggin <npiggin@gmail.com> [mpe: Fix build on old toolchains by using .long for scv] Signed-off-by: Michael Ellerman <mpe@ellerman.id.au> Link: https://lore.kernel.org/r/20210903125707.1601269-2-npiggin@gmail.com
Diffstat (limited to 'tools/testing/selftests/powerpc/tm/tm-syscall-asm.S')
-rw-r--r--tools/testing/selftests/powerpc/tm/tm-syscall-asm.S37
1 files changed, 36 insertions, 1 deletions
diff --git a/tools/testing/selftests/powerpc/tm/tm-syscall-asm.S b/tools/testing/selftests/powerpc/tm/tm-syscall-asm.S
index bd1ca25febe4..aed632d29fff 100644
--- a/tools/testing/selftests/powerpc/tm/tm-syscall-asm.S
+++ b/tools/testing/selftests/powerpc/tm/tm-syscall-asm.S
@@ -1,5 +1,5 @@
/* SPDX-License-Identifier: GPL-2.0 */
-#include <ppc-asm.h>
+#include <basic_asm.h>
#include <asm/unistd.h>
.text
@@ -26,3 +26,38 @@ FUNC_START(getppid_tm_suspended)
1:
li r3, -1
blr
+
+
+.macro scv level
+ .long (0x44000001 | (\level) << 5)
+.endm
+
+FUNC_START(getppid_scv_tm_active)
+ PUSH_BASIC_STACK(0)
+ tbegin.
+ beq 1f
+ li r0, __NR_getppid
+ scv 0
+ tend.
+ POP_BASIC_STACK(0)
+ blr
+1:
+ li r3, -1
+ POP_BASIC_STACK(0)
+ blr
+
+FUNC_START(getppid_scv_tm_suspended)
+ PUSH_BASIC_STACK(0)
+ tbegin.
+ beq 1f
+ li r0, __NR_getppid
+ tsuspend.
+ scv 0
+ tresume.
+ tend.
+ POP_BASIC_STACK(0)
+ blr
+1:
+ li r3, -1
+ POP_BASIC_STACK(0)
+ blr