From: Michael Ellerman Date: Mon, 26 Feb 2018 02:17:07 +0000 (+1100) Subject: selftests/powerpc: Skip tm-trap if transactional memory is not enabled X-Git-Tag: v5.15~9199^2~14 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=192b2e742c06af399e8eecb4a1726520bfccece8;p=platform%2Fkernel%2Flinux-starfive.git selftests/powerpc: Skip tm-trap if transactional memory is not enabled Some processor revisions do not support transactional memory, and additionally kernel support can be disabled. In either case the tm-trap test should be skipped, otherwise it will fail with a SIGILL. Fixes: a08082f8e4e1 ("powerpc/selftests: Check endianness on trap in TM") Signed-off-by: Michael Ellerman --- diff --git a/tools/testing/selftests/powerpc/tm/tm-trap.c b/tools/testing/selftests/powerpc/tm/tm-trap.c index 5d92c23..179d592 100644 --- a/tools/testing/selftests/powerpc/tm/tm-trap.c +++ b/tools/testing/selftests/powerpc/tm/tm-trap.c @@ -255,6 +255,8 @@ int tm_trap_test(void) struct sigaction trap_sa; + SKIP_IF(!have_htm()); + trap_sa.sa_flags = SA_SIGINFO; trap_sa.sa_sigaction = trap_signal_handler; sigaction(SIGTRAP, &trap_sa, NULL);