summaryrefslogtreecommitdiffstats
path: root/tools/testing/selftests
diff options
context:
space:
mode:
authorNicholas Piggin <npiggin@gmail.com>2018-05-12 05:35:24 +0200
committerMichael Ellerman <mpe@ellerman.id.au>2018-05-14 15:10:33 +0200
commitc906d2c74e0bb9059fbf43e21f8a962986eb21e2 (patch)
treea1467c2f2d665d61c40e5e07c00c601e6fbbd523 /tools/testing/selftests
parentpowerpc/ioda: Use ibm, supported-tce-sizes for IOMMU page size mask (diff)
downloadlinux-c906d2c74e0bb9059fbf43e21f8a962986eb21e2.tar.xz
linux-c906d2c74e0bb9059fbf43e21f8a962986eb21e2.zip
selftests/powerpc: fix exec benchmark
The exec_target binary could segfault calling _exit(2) because r13 is not set up properly (and libc looks at that when performing a syscall). Call SYS_exit using syscall(2) which doesn't seem to have this problem. Signed-off-by: Nicholas Piggin <npiggin@gmail.com> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Diffstat (limited to 'tools/testing/selftests')
-rw-r--r--tools/testing/selftests/powerpc/benchmarks/exec_target.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/tools/testing/selftests/powerpc/benchmarks/exec_target.c b/tools/testing/selftests/powerpc/benchmarks/exec_target.c
index 3c9c144192be..c14b0fc1edde 100644
--- a/tools/testing/selftests/powerpc/benchmarks/exec_target.c
+++ b/tools/testing/selftests/powerpc/benchmarks/exec_target.c
@@ -6,8 +6,11 @@
* Copyright 2018, Anton Blanchard, IBM Corp.
*/
-void _exit(int);
+#define _GNU_SOURCE
+#include <unistd.h>
+#include <sys/syscall.h>
+
void _start(void)
{
- _exit(0);
+ syscall(SYS_exit, 0);
}