Skip to contentSkip to conversation

selftests/powerpc: Skip tm-signal-sigreturn-nt if TM not available

PATCH Applied Michael Ellerman 2 participants 2 messages Nov 5, 2019 – Nov 14, 2019

Subsystems (2)
lore
Share & tools
lore

Michael Ellerman

author reviewer
#0 lore raw

PATCH 1/1 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")
---
 tools/testing/selftests/powerpc/tm/tm-signal-sigreturn-nt.c | 4 ++++
 1 file changed, 4 insertions(+)
tools/testing/selftests/powerpc/tm/tm-signal-sigreturn-nt.c +4 -0
index 56fbf9f6bbf3..07c388147b75 100644
@@ -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;
 
Signature · 1 line
2.21.0
#1 lore raw
Quoted 8 lines · Michael Ellerman

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

Quoted 4 lines

We should skip the test if TM is not available.

Fixes 34642d70ac7e ("selftests/powerpc: Add checks for transactional sigreturn")

Applied to powerpc next.

https://git.kernel.org/powerpc/c/505127068d9b705a6cf335143239db91bfe7bbe2

cheers