summaryrefslogtreecommitdiff
path: root/tools/testing/selftests/powerpc/ptrace/Makefile
diff options
context:
space:
mode:
authorBreno Leitao <leitao@debian.org>2018-09-20 19:45:07 +0300
committerMichael Ellerman <mpe@ellerman.id.au>2018-10-03 08:40:04 +0300
commitfc35ef12dc8ba8633a99c9d9df03a5bb53f1dda3 (patch)
treeca3b5435aea4ad8011e56c3db14ce340400735d1 /tools/testing/selftests/powerpc/ptrace/Makefile
parent5521eb4bca2db733952f068c37bdf3cd656ad23c (diff)
downloadlinux-fc35ef12dc8ba8633a99c9d9df03a5bb53f1dda3.tar.xz
selftests/powerpc: New PTRACE_SYSEMU test
This patch adds a new test for the new PTRACE_SYSEMU ptrace request. This test also relies on PTRACE_GETREGS and PTRACE_SETREGS requests to run properly, since the trace instruction (gettid() syscall) is being modified at run-time (by PTRACE_SETREGS) and re-executed three times. PTRACE_GETREGS is being used to check that the registers are still sane. This test basically creates a child process that executes syscalls and the parent process check if it is being traced appropriately. The parent process guarantees that the SYSCALLs are being traced, with PTRACE_SYSEMU, and ptrace stops the child application before a syscall is executed. The way the tests validates it, is by guaranteeing that the system calls arguments, as argv[0] (r3) which is the same register that will have the syscall return value on powerpc, are not being corrupted on PTRACE_SYSEMU with a return value, i.e, it continues to have the current arguments instead, meaning that the registers where not clobbered. This test is basically the same test for x86 located at tools/testing/selftests/x86/ptrace_syscall.c, limited to test PTRACE_SYSEMU request, and ported to PowerPC. Signed-off-by: Breno Leitao <leitao@debian.org> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Diffstat (limited to 'tools/testing/selftests/powerpc/ptrace/Makefile')
-rw-r--r--tools/testing/selftests/powerpc/ptrace/Makefile2
1 files changed, 1 insertions, 1 deletions
diff --git a/tools/testing/selftests/powerpc/ptrace/Makefile b/tools/testing/selftests/powerpc/ptrace/Makefile
index 28f5b781a553..1ee59978508d 100644
--- a/tools/testing/selftests/powerpc/ptrace/Makefile
+++ b/tools/testing/selftests/powerpc/ptrace/Makefile
@@ -2,7 +2,7 @@
TEST_PROGS := ptrace-gpr ptrace-tm-gpr ptrace-tm-spd-gpr \
ptrace-tar ptrace-tm-tar ptrace-tm-spd-tar ptrace-vsx ptrace-tm-vsx \
ptrace-tm-spd-vsx ptrace-tm-spr ptrace-hwbreak ptrace-pkey core-pkey \
- perf-hwbreak
+ perf-hwbreak ptrace-syscall
include ../../lib.mk