linux_dsm_epyc7002/tools/testing/selftests/powerpc/tm
Breno Leitao a65329aa7d selftests/powerpc: New TM signal self test
A new self test that forces MSR[TS] to be set without calling any TM
instruction. This test also tries to cause a page fault at a signal
handler, exactly between MSR[TS] set and tm_recheckpoint(), forcing
thread->texasr to be rewritten with TEXASR[FS] = 0, which will cause a BUG
when tm_recheckpoint() is called.

This test is not deterministic, since it is hard to guarantee that the page
access will cause a page fault. In order to force more page faults at
signal context, the signal handler and the ucontext are being mapped into a
MADV_DONTNEED memory chunks.

Tests have shown that the bug could be exposed with few interactions in a
buggy kernel. This test is configured to loop 5000x, having a good chance
to hit the kernel issue in just one run.  This self test takes less than
two seconds to run.

This test uses set/getcontext because the kernel will recheckpoint
zeroed structures, causing the test to segfault, which is undesired because
the test needs to rerun, so, there is a signal handler for SIGSEGV which
will restart the test.

v2: Uses the MADV_DONTNEED memory advice
v3: Fix memcpy and 32-bits compilation
v4: Does not define unused macros

Signed-off-by: Breno Leitao <leitao@debian.org>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
2019-01-15 11:17:09 +11:00
..
.gitignore selftests/powerpc: New TM signal self test 2019-01-15 11:17:09 +11:00
Makefile selftests/powerpc: New TM signal self test 2019-01-15 11:17:09 +11:00
tm-exec.c selftests/powerpc: exec() with suspended transaction 2016-07-26 14:28:22 +10:00
tm-fork.c selftests/powerpc: Add test for forking inside transaction 2016-05-11 21:54:13 +10:00
tm-resched-dscr.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
tm-signal-context-chk-fpu.c selftests/powerpc: Add checks for transactional FPUs in signal contexts 2016-10-04 20:33:14 +11:00
tm-signal-context-chk-gpr.c selftests/powerpc: Add checks for transactional GPRs in signal contexts 2016-10-04 20:33:12 +11:00
tm-signal-context-chk-vmx.c selftests/powerpc: Add checks for transactional VMXs in signal contexts 2016-10-04 20:33:14 +11:00
tm-signal-context-chk-vsx.c selftests/powerpc: Add checks for transactional VSXs in signal contexts 2016-10-04 20:33:15 +11:00
tm-signal-context-force-tm.c selftests/powerpc: New TM signal self test 2019-01-15 11:17:09 +11:00
tm-signal-msr-resv.c selftests/powerpc: Fix out of bounds access in TM signal test 2016-03-02 23:34:45 +11:00
tm-signal-sigreturn-nt.c selftests/powerpc: Add checks for transactional sigreturn 2018-12-21 14:46:50 +11:00
tm-signal-stack.c selftests/powerpc: Standardise TM calls 2016-05-11 21:54:12 +10:00
tm-signal.S selftests/powerpc: Move shared headers into new include dir 2016-11-17 17:11:47 +11:00
tm-sigreturn.c selftests/powerpc: Only run some tests on ppc64le 2018-08-07 21:49:25 +10:00
tm-syscall-asm.S License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
tm-syscall.c selftests/powerpc: exec() with suspended transaction 2016-07-26 14:28:22 +10:00
tm-tar.c selftests/powerpc: Only run some tests on ppc64le 2018-08-07 21:49:25 +10:00
tm-tmspr.c powerpc/selftests: Wait all threads to join 2018-09-17 21:17:25 +10:00
tm-trap.c selftests/powerpc: Skip tm-trap if transactional memory is not enabled 2018-02-26 13:18:25 +11:00
tm-unavailable.c selftests/powerpc: Do not fail with reschedule 2018-09-19 21:58:09 +10:00
tm-vmx-unavail.c selftests/powerpc: Test TM and VMX register state 2017-05-16 13:03:05 +10:00
tm-vmxcopy.c selftests/powerpc: Only run some tests on ppc64le 2018-08-07 21:49:25 +10:00
tm.h selftests/powerpc: Do not fail with reschedule 2018-09-19 21:58:09 +10:00