Michael Ellerman 611e385087 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
2022-07-25 12:05:16 +10:00

42 lines
1013 B
Makefile

# SPDX-License-Identifier: GPL-2.0
TM_TESTS := ptrace-tm-gpr
TM_TESTS += ptrace-tm-spd-gpr
TM_TESTS += ptrace-tm-spd-tar
TM_TESTS += ptrace-tm-spd-vsx
TM_TESTS += ptrace-tm-spr
TM_TESTS += ptrace-tm-tar
TM_TESTS += ptrace-tm-vsx
TESTS_64 := $(TM_TESTS)
TESTS_64 += core-pkey
TESTS_64 += perf-hwbreak
TESTS_64 += ptrace-hwbreak
TESTS_64 += ptrace-perf-hwbreak
TESTS_64 += ptrace-pkey
TESTS_64 += ptrace-syscall
TESTS_64 += ptrace-tar
TESTS_64 += ptrace-vsx
TESTS += ptrace-gpr
TEST_GEN_PROGS := $(TESTS) $(TESTS_64)
LOCAL_HDRS += $(patsubst %,$(selfdir)/powerpc/ptrace/%,$(wildcard *.h))
top_srcdir = ../../../../..
include ../../lib.mk
TM_TESTS := $(patsubst %,$(OUTPUT)/%,$(TM_TESTS))
TESTS_64 := $(patsubst %,$(OUTPUT)/%,$(TESTS_64))
$(TESTS_64): CFLAGS += -m64
$(TM_TESTS): CFLAGS += -I../tm -mhtm
CFLAGS += -I../../../../../usr/include -fno-pie
$(OUTPUT)/ptrace-gpr: ptrace-gpr.S
$(OUTPUT)/ptrace-pkey $(OUTPUT)/core-pkey: LDLIBS += -pthread
$(TEST_GEN_PROGS): ../harness.c ../utils.c ../lib/reg.S