1
0
Fork 0
alistair23-linux/tools
Breno Leitao fc35ef12dc 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>
2018-10-03 15:40:04 +10:00
..
accounting
arch Merge branch 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2018-08-26 11:25:21 -07:00
bpf tools/bpf: bpftool, add xskmap in map types 2018-09-02 22:30:39 +02:00
build Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next 2018-08-15 15:04:25 -07:00
cgroup tools: fix cross-compile var clobbering 2018-02-21 15:35:42 -08:00
firewire
gpio Linux 4.16-rc5 2018-03-18 17:48:59 +01:00
hv Tools: hv: vss: fix loop device detection 2018-07-03 13:02:33 +02:00
iio iio: Add modifier for DUV light 2018-07-23 19:18:10 +01:00
include tools: introduce test_and_clear_bit 2018-08-22 16:48:36 +02:00
kvm/kvm_stat tools/kvm_stat: re-animate display of dead guests 2018-08-30 17:15:12 +02:00
laptop tools: fix cross-compile var clobbering 2018-02-21 15:35:42 -08:00
leds tools: fix cross-compile var clobbering 2018-02-21 15:35:42 -08:00
lib Merge branch 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2018-08-26 11:25:21 -07:00
memory-model tools/memory-model: Rename litmus tests to comply to norm7 2018-07-17 09:30:36 +02:00
nfsd
objtool Kbuild updates for v4.19 2018-08-15 12:09:03 -07:00
pci tools: PCI: Add MSI-X support 2018-07-19 11:47:13 +01:00
pcmcia
perf perf python: Fix pyrf_evlist__read_on_cpu() interface 2018-08-20 08:54:59 -03:00
power treewide: convert ISO_8859-1 text comments to utf-8 2018-08-23 18:48:43 -07:00
scripts Kbuild: fix # escaping in .cmd files for future Make 2018-04-11 00:03:02 +09:00
spi tools: fix cross-compile var clobbering 2018-02-21 15:35:42 -08:00
testing selftests/powerpc: New PTRACE_SYSEMU test 2018-10-03 15:40:04 +10:00
thermal/tmon tools/thermal: tmon: fix for segfault 2018-03-27 09:51:23 +02:00
time
usb tools: usb: ffs-test: Fix build on big endian systems 2018-07-17 10:12:51 +03:00
virtio tools/virtio: add kmalloc_array stub 2018-07-27 16:54:40 +03:00
vm tools/vm/page-types.c: fix "defined but not used" warning 2018-09-04 16:45:02 -07:00
wmi tools: fix cross-compile var clobbering 2018-02-21 15:35:42 -08:00
Makefile