linux-stable/tools/testing/selftests/powerpc/math
Michael Ellerman 1bdf22580b selftests/powerpc: Check all FPRs in fpu_syscall test
There is a selftest that checks if FPRs are corrupted across a fork, aka
clone. It was added as part of the series that optimised the clone path
to save the parent's FP state without "giving up" (turning off FP).

See commit 8792468da5 ("powerpc: Add the ability to save FPU without
giving it up").

The test encodes the assumption that FPRs 0-13 are volatile across the
syscall, by only checking the volatile FPRs are not changed by the fork.
There was also a comment in the fpu_preempt test alluding to that:

  The check_fpu function in asm only checks the non volatile registers
  as it is reused from the syscall test

It is true that the function call ABI treats f0-f13 as volatile,
however the syscall ABI has since been documented as *not* treating those
registers as volatile. See commit 7b8845a2a2 ("powerpc/64: Document
the syscall ABI").

So change the test to check all FPRs are not corrupted by the syscall.
Note that this currently fails, because save_fpu() etc. do not restore
f0/vsr0.

Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://msgid.link/20231128132748.1990179-5-mpe@ellerman.id.au
2023-12-13 13:29:09 +11:00
..
.gitignore selftests/powerpc: Add missing files to .gitignores 2022-06-29 19:37:04 +10:00
Makefile selftests/powerpc: Add matrix multiply assist (MMA) test 2022-04-27 16:32:42 +10:00
fpu.h selftests/powerpc: Generate better bit patterns for FPU tests 2023-12-13 13:29:08 +11:00
fpu_asm.S selftests/powerpc: Check all FPRs in fpu_syscall test 2023-12-13 13:29:09 +11:00
fpu_denormal.c selftests/powerpc: Add FPU denormal test 2020-07-15 12:02:20 +10:00
fpu_preempt.c selftests/powerpc: Run fpu_preempt test for 60 seconds 2023-12-13 13:29:09 +11:00
fpu_signal.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 152 2019-05-30 11:26:32 -07:00
fpu_syscall.c selftests/powerpc: Check all FPRs in fpu_syscall test 2023-12-13 13:29:09 +11:00
mma.S selftests/powerpc: Fix matrix multiply assist test 2022-07-28 16:22:15 +10:00
mma.c selftests/powerpc: Add matrix multiply assist (MMA) test 2022-04-27 16:32:42 +10:00
vmx_asm.S treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 152 2019-05-30 11:26:32 -07:00
vmx_preempt.c selftests/powerpc: Fix error handling in FPU/VMX preemption tests 2023-12-13 13:29:08 +11:00
vmx_signal.c selftests/powerpc: Increase timeout for vsx_signal test 2023-03-15 00:52:09 +11:00
vmx_syscall.c selftests/powerpc: Skip vmx/vsx/tar/etc tests on older CPUs 2020-08-03 22:12:41 +10:00
vsx_asm.S treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 152 2019-05-30 11:26:32 -07:00
vsx_preempt.c selftests/powerpc: Skip vmx/vsx/tar/etc tests on older CPUs 2020-08-03 22:12:41 +10:00