]> git.baikalelectronics.ru Git - kernel.git/commit
selftests/powerpc/ptrace: Do more of ptrace-gpr in asm
authorMichael Ellerman <mpe@ellerman.id.au>
Mon, 27 Jun 2022 14:02:36 +0000 (00:02 +1000)
committerMichael Ellerman <mpe@ellerman.id.au>
Mon, 25 Jul 2022 02:05:16 +0000 (12:05 +1000)
commit79e6d0089bffaba15dee2333753c0d3dc2cdddb1
tree6a5546d4bfc523e329e31526573d599c030e76c7
parentb155ed0b1bbfc8c574839f55f0ea10106e5bfde1
selftests/powerpc/ptrace: Do more of ptrace-gpr in asm

The ptrace-gpr test includes some inline asm to load GPR and FPR
registers. It then goes back to C to wait for the parent to trace it and
then checks register contents.

The split between inline asm and C is fragile, it relies on the compiler
not using any non-volatile GPRs after the inline asm block. It also
requires a very large and unwieldy inline asm block.

So convert the logic to set registers, wait, and store registers to a
single asm function, meaning there's no window for the compiler to
intervene.

Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20220627140239.2464900-10-mpe@ellerman.id.au
tools/testing/selftests/powerpc/include/basic_asm.h
tools/testing/selftests/powerpc/ptrace/Makefile
tools/testing/selftests/powerpc/ptrace/ptrace-gpr.S [new file with mode: 0644]
tools/testing/selftests/powerpc/ptrace/ptrace-gpr.c