aboutsummaryrefslogtreecommitdiffstats
path: root/tools/testing/selftests/powerpc/include
diff options
context:
space:
mode:
authorBreno Leitao <leitao@debian.org>2019-01-17 15:01:54 -0200
committerMichael Ellerman <mpe@ellerman.id.au>2019-05-03 02:55:02 +1000
commit83e367f9ad18d42a1883ee29f20608a2b93e1071 (patch)
tree7e9c3057ab42649f0b12f0c3a351370b5dceb82e /tools/testing/selftests/powerpc/include
parentpowerpc/booke64: set RI in default MSR (diff)
downloadlinux-dev-83e367f9ad18d42a1883ee29f20608a2b93e1071.tar.xz
linux-dev-83e367f9ad18d42a1883ee29f20608a2b93e1071.zip
selftests/powerpc: Add a signal fuzzer selftest
This is a new selftest that raises SIGUSR1 signals and handles it in a set of different ways, trying to create different scenario for testing purpose. This test works raising a signal and calling sigreturn interleaved with TM operations, as starting, suspending and terminating a transaction. The test depends on random numbers, and, based on them, it sets different TM states. Other than that, the test fills out the user context struct that is passed to the sigreturn system call with random data, in order to make sure that the signal handler syscall can handle different and invalid states properly. This selftest has command line parameters to control what kind of tests the user wants to run, as for example, if a transaction should be started prior to signal being raised, or, after the signal being raised and before the sigreturn. If no parameter is given, the default is enabling all options. This test does not check if the user context is being read and set properly by the kernel. Its purpose, at this time, is basically guaranteeing that the kernel does not crash on invalid scenarios. Signed-off-by: Breno Leitao <leitao@debian.org> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Diffstat (limited to 'tools/testing/selftests/powerpc/include')
-rw-r--r--tools/testing/selftests/powerpc/include/reg.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/tools/testing/selftests/powerpc/include/reg.h b/tools/testing/selftests/powerpc/include/reg.h
index 96043b9b9829..1e797ae396ee 100644
--- a/tools/testing/selftests/powerpc/include/reg.h
+++ b/tools/testing/selftests/powerpc/include/reg.h
@@ -79,11 +79,13 @@
/* MSR register bits */
#define MSR_TS_S_LG 33 /* Trans Mem state: Suspended */
+#define MSR_TS_T_LG 34 /* Trans Mem state: Active */
#define __MASK(X) (1UL<<(X))
/* macro to check TM MSR bits */
#define MSR_TS_S __MASK(MSR_TS_S_LG) /* Transaction Suspended */
+#define MSR_TS_T __MASK(MSR_TS_T_LG) /* Transaction Transactional */
/* Vector Instructions */
#define VSX_XX1(xs, ra, rb) (((xs) & 0x1f) << 21 | ((ra) << 16) | \