Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

selftest: run vector prctl test for ZVE32X

The minimal requirement for running Vector subextension on Linux is
ZVE32X. So change the test accordingly to run prctl as long as it find
it.

Signed-off-by: Andy Chiu <andy.chiu@sifive.com>
Link: https://lore.kernel.org/r/20240510-zve-detection-v5-8-0711bdd26c12@sifive.com
Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>

authored by

Andy Chiu and committed by
Palmer Dabbelt
edc96a2b ac295b67

+3 -3
+3 -3
tools/testing/selftests/riscv/vector/vstate_prctl.c
··· 88 88 return -2; 89 89 } 90 90 91 - if (!(pair.value & RISCV_HWPROBE_IMA_V)) { 91 + if (!(pair.value & RISCV_HWPROBE_EXT_ZVE32X)) { 92 92 rc = prctl(PR_RISCV_V_GET_CONTROL); 93 93 if (rc != -1 || errno != EINVAL) { 94 - ksft_test_result_fail("GET_CONTROL should fail on kernel/hw without V\n"); 94 + ksft_test_result_fail("GET_CONTROL should fail on kernel/hw without ZVE32X\n"); 95 95 return -3; 96 96 } 97 97 98 98 rc = prctl(PR_RISCV_V_SET_CONTROL, PR_RISCV_V_VSTATE_CTRL_ON); 99 99 if (rc != -1 || errno != EINVAL) { 100 - ksft_test_result_fail("GET_CONTROL should fail on kernel/hw without V\n"); 100 + ksft_test_result_fail("SET_CONTROL should fail on kernel/hw without ZVE32X\n"); 101 101 return -4; 102 102 } 103 103