Commit 50512706 authored by Michael Ellerman's avatar Michael Ellerman

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:7c202575
  !! child died by signal 4
  failure: tm_signal_sigreturn_nt

We should skip the test if TM is not available.

Fixes: 34642d70 ("selftests/powerpc: Add checks for transactional sigreturn")
Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20191104233524.24348-1-mpe@ellerman.id.au
parent 7c202575
...@@ -10,10 +10,12 @@ ...@@ -10,10 +10,12 @@
*/ */
#define _GNU_SOURCE #define _GNU_SOURCE
#include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <signal.h> #include <signal.h>
#include "utils.h" #include "utils.h"
#include "tm.h"
void trap_signal_handler(int signo, siginfo_t *si, void *uc) void trap_signal_handler(int signo, siginfo_t *si, void *uc)
{ {
...@@ -29,6 +31,8 @@ int tm_signal_sigreturn_nt(void) ...@@ -29,6 +31,8 @@ int tm_signal_sigreturn_nt(void)
{ {
struct sigaction trap_sa; struct sigaction trap_sa;
SKIP_IF(!have_htm());
trap_sa.sa_flags = SA_SIGINFO; trap_sa.sa_flags = SA_SIGINFO;
trap_sa.sa_sigaction = trap_signal_handler; trap_sa.sa_sigaction = trap_signal_handler;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment