diff options
author | Michael Ellerman <mpe@ellerman.id.au> | 2019-11-05 10:15:56 +1100 |
---|---|---|
committer | Michael Ellerman <mpe@ellerman.id.au> | 2019-11-05 11:26:20 +1100 |
commit | 505127068d9b705a6cf335143239db91bfe7bbe2 (patch) | |
tree | 1f62a630ba2f86289755a16308a00665d4cf6391 /tools/testing/selftests/powerpc/tm | |
parent | 7c202575ef63f1c67832acea2179f07f8a2cf7bc (diff) | |
download | linux-505127068d9b705a6cf335143239db91bfe7bbe2.tar.gz linux-505127068d9b705a6cf335143239db91bfe7bbe2.tar.bz2 linux-505127068d9b705a6cf335143239db91bfe7bbe2.zip |
selftests/powerpc: Skip tm-signal-sigreturn-nt if TM not available
On systems where TM (Transactional Memory) is disabled the
tm-signal-sigreturn-nt test causes a SIGILL:
test: tm_signal_sigreturn_nt
tags: git_version:7c202575ef63
!! child died by signal 4
failure: tm_signal_sigreturn_nt
We should skip the test if TM is not available.
Fixes: 34642d70ac7e ("selftests/powerpc: Add checks for transactional sigreturn")
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20191104233524.24348-1-mpe@ellerman.id.au
Diffstat (limited to 'tools/testing/selftests/powerpc/tm')
-rw-r--r-- | tools/testing/selftests/powerpc/tm/tm-signal-sigreturn-nt.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/tools/testing/selftests/powerpc/tm/tm-signal-sigreturn-nt.c b/tools/testing/selftests/powerpc/tm/tm-signal-sigreturn-nt.c index 56fbf9f6bbf3..07c388147b75 100644 --- a/tools/testing/selftests/powerpc/tm/tm-signal-sigreturn-nt.c +++ b/tools/testing/selftests/powerpc/tm/tm-signal-sigreturn-nt.c @@ -10,10 +10,12 @@ */ #define _GNU_SOURCE +#include <stdio.h> #include <stdlib.h> #include <signal.h> #include "utils.h" +#include "tm.h" void trap_signal_handler(int signo, siginfo_t *si, void *uc) { @@ -29,6 +31,8 @@ int tm_signal_sigreturn_nt(void) { struct sigaction trap_sa; + SKIP_IF(!have_htm()); + trap_sa.sa_flags = SA_SIGINFO; trap_sa.sa_sigaction = trap_signal_handler; |