]> www.infradead.org Git - users/jedix/linux-maple.git/commit
selftests: riscv: Fix vector tests
authorCharlie Jenkins <charlie@rivosinc.com>
Thu, 14 Nov 2024 02:21:18 +0000 (18:21 -0800)
committerPalmer Dabbelt <palmer@rivosinc.com>
Sat, 18 Jan 2025 20:33:37 +0000 (12:33 -0800)
commit57d7713af93e4b7344d3022fad9ddf0f10f815ec
tree190b6eeb6234ee86cb5f42d6342b49a1729e6037
parent7fa00fd6ff5366b50dcba2525b9743e1612da2aa
selftests: riscv: Fix vector tests

Overhaul the riscv vector tests to use kselftest_harness to help the
test cases correctly report the results and decouple the individual test
cases from each other. With this refactoring, only run the test cases if
vector is reported and properly report the test case as skipped
otherwise. The v_initval_nolibc test was previously not checking if
vector was supported and used a function (malloc) which invalidates
the state of the vector registers.

Signed-off-by: Charlie Jenkins <charlie@rivosinc.com>
Tested-by: Yangyu Chen <cyy@cyyself.name>
Link: https://lore.kernel.org/r/20241113-xtheadvector-v11-12-236c22791ef9@rivosinc.com
Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>
tools/testing/selftests/riscv/vector/.gitignore
tools/testing/selftests/riscv/vector/Makefile
tools/testing/selftests/riscv/vector/v_exec_initval_nolibc.c [new file with mode: 0644]
tools/testing/selftests/riscv/vector/v_helpers.c [new file with mode: 0644]
tools/testing/selftests/riscv/vector/v_helpers.h [new file with mode: 0644]
tools/testing/selftests/riscv/vector/v_initval.c [new file with mode: 0644]
tools/testing/selftests/riscv/vector/v_initval_nolibc.c [deleted file]
tools/testing/selftests/riscv/vector/vstate_prctl.c