linux_dsm_epyc7002/tools/testing/selftests/powerpc/ptrace
Breno Leitao 48dc0ef190 selftests/powerpc: Fix ptrace tm failure
Test ptrace-tm-spd-gpr fails on current kernel (4.19) due to a segmentation
fault that happens on the child process prior to setting cptr[2] = 1. This
causes the parent process to wait forever at 'while (!pptr[2])' and the test to
be killed by the test harness framework by timeout, thus, failing.

The segmentation fault happens because of a inline assembly being
generated as:

	0x10000355c <tm_spd_gpr+492>    lfs    f0, 0(0)

This is reading memory position 0x0 and causing the segmentation fault.

This code is being generated by ASM_LOAD_FPR_SINGLE_PRECISION(flt_4), where
flt_4 is passed to the inline assembly block as:

	[flt_4] "r" (&d)

Since the inline assembly 'r' constraint means any GPR, gpr0 is being
chosen, thus causing this issue when issuing a Load Floating-Point Single
instruction.

This patch simply changes the constraint to 'b', which specify that this
register will be used as base, and r0 is not allowed to be used, avoiding
this issue.

Other than that, removing flt_2 register from the input operands, since it
is not used by the inline assembly code at all.

Cc: stable@vger.kernel.org
Signed-off-by: Breno Leitao <leitao@debian.org>
Acked-by: Segher Boessenkool <segher@kernel.crashing.org>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
2018-10-26 21:58:58 +11:00
..
.gitignore selftests/powerpc: Add perf breakpoint test 2018-06-03 21:16:44 +10:00
child.h selftests/powerpc: Add ptrace tests for Protection Key registers 2018-05-28 18:46:35 +10:00
core-pkey.c selftests/powerpc: Fix core-pkey for default execute permission change 2018-07-24 22:02:29 +10:00
Makefile Revert "selftests/powerpc: Fix out-of-tree build errors" 2018-10-26 21:58:58 +11:00
perf-hwbreak.c selftests/powerpc: Add perf breakpoint test 2018-06-03 21:16:44 +10:00
ptrace-gpr.c
ptrace-gpr.h
ptrace-hwbreak.c selftests/powerpc: Add ptrace hw breakpoint test 2018-05-25 00:08:25 +10:00
ptrace-pkey.c selftests/powerpc: Fix ptrace-pkey for default execute permission change 2018-07-24 22:03:14 +10:00
ptrace-syscall.c selftests/powerpc: New PTRACE_SYSEMU test 2018-10-03 15:40:04 +10:00
ptrace-tar.c selftests/powerpc: Add ptrace tests for TAR, PPR, DSCR registers 2016-11-17 17:11:49 +11:00
ptrace-tar.h selftests/powerpc: Add ptrace tests for TAR, PPR, DSCR registers 2016-11-17 17:11:49 +11:00
ptrace-tm-gpr.c selftests/powerpc: Add ptrace tests for GPR/FPR registers in TM 2016-11-17 17:11:48 +11:00
ptrace-tm-spd-gpr.c selftests/powerpc: Fix ptrace tm failure 2018-10-26 21:58:58 +11:00
ptrace-tm-spd-tar.c selftests/powerpc: Add ptrace tests for TAR, PPR, DSCR in suspended TM 2016-11-17 17:11:50 +11:00
ptrace-tm-spd-vsx.c selftests/powerpc: Fix build errors in powerpc ptrace selftests 2017-12-11 13:03:37 +11:00
ptrace-tm-spr.c selftests/powerpc: Fix build errors in powerpc ptrace selftests 2017-12-11 13:03:37 +11:00
ptrace-tm-tar.c selftests/powerpc: Add ptrace tests for TAR, PPR, DSCR in TM 2016-11-17 17:11:50 +11:00
ptrace-tm-vsx.c selftests/powerpc: Fix build errors in powerpc ptrace selftests 2017-12-11 13:03:37 +11:00
ptrace-vsx.c selftests/powerpc: Add ptrace tests for VSX, VMX registers 2016-11-17 17:11:51 +11:00
ptrace-vsx.h selftests/powerpc: Add ptrace tests for VSX, VMX registers 2016-11-17 17:11:51 +11:00
ptrace.h selftests/powerpc: Add ptrace tests for Protection Key registers 2018-05-28 18:46:35 +10:00