linux/tools/testing/selftests/powerpc
Breno Leitao 5249497a7b selftests/powerpc: Allocate base registers
Some ptrace selftests are passing input operands using a constraint that
can allocate any register for the operand, and using these registers on
load/store operations.

If the register allocated by the compiler happens to be zero (r0), it might
cause an invalid memory address access, since load and store operations
consider the content of 0x0 address if the base register is r0, instead of
the content of the r0 register. For example:

	r1 := 0xdeadbeef
	r0 := 0xdeadbeef

	ld r2, 0(1) /* will load into r2 the content of r1 address */
	ld r2, 0(0) /* will load into r2 the content of 0x0 */

In order to avoid this possible problem, the inline assembly constraint
should be aware that these registers will be used as a base register, thus,
r0 should not be allocated.

Other than that, this patch removes inline assembly operands that are not
used by the tests.

Signed-off-by: Breno Leitao <leitao@debian.org>
Reviewed-by: Segher Boessenkool <segher@kernel.crashing.org>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
2018-11-25 17:11:21 +11:00
..
alignment selftests/powerpc: Fix Makefiles for headers_install change 2018-09-28 15:07:45 +10:00
benchmarks selftests/powerpc: Fix Makefiles for headers_install change 2018-09-28 15:07:45 +10:00
cache_shape selftests/powerpc/cache_shape: Fix out-of-tree build 2018-10-31 23:56:22 +11:00
copyloops selftests/powerpc: Fix Makefiles for headers_install change 2018-09-28 15:07:45 +10:00
dscr selftests/powerpc: Fix Makefiles for headers_install change 2018-09-28 15:07:45 +10:00
include selftests/powerpc: Add a test of wild bctr 2018-10-20 13:26:47 +11:00
lib selftests/powerpc: Add ptrace tests for VSX, VMX registers 2016-11-17 17:11:51 +11:00
math selftests/powerpc: Fix Makefiles for headers_install change 2018-09-28 15:07:45 +10:00
mm selftests/powerpc: Adjust wild_bctr to build with old binutils 2018-11-15 23:05:17 +11:00
pmu selftests/powerpc/pmu: Link ebb tests with -no-pie 2018-10-31 23:56:21 +11:00
primitives selftests/powerpc: Move UCONTEXT_NIA() into utils.h 2018-10-20 13:26:47 +11:00
ptrace selftests/powerpc: Allocate base registers 2018-11-25 17:11:21 +11:00
scripts selftests/powerpc: Add script to test HMI functionality 2015-12-17 10:46:43 +11:00
security selftests: powerpc: Fix warning for security subdir 2018-10-31 14:36:33 +11:00
signal selftests/powerpc/signal: Fix out-of-tree build 2018-10-31 23:56:20 +11:00
stringloops selftests/powerpc: Fix Makefiles for headers_install change 2018-09-28 15:07:45 +10:00
switch_endian selftests/powerpc/switch_endian: Fix out-of-tree build 2018-10-31 23:56:21 +11:00
syscalls selftests/powerpc: Fix Makefiles for headers_install change 2018-09-28 15:07:45 +10:00
tm Merge branch 'fixes' into next 2018-10-09 16:51:05 +11:00
vphn selftests/powerpc: Fix Makefiles for headers_install change 2018-09-28 15:07:45 +10:00
harness.c selftests/powerpc: Kill child processes on SIGINT 2018-08-08 18:52:24 +10:00
Makefile selftests/powerpc: Add test to verify rfi flush across a system call 2018-10-20 13:26:47 +11:00
utils.c selftests/powerpc: Fix compilation issue due to asm label 2018-11-01 10:06:03 +11:00