Skip to content

Commit edc96a2

Browse files
AndybnACTpalmer-dabbelt
authored andcommitted
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>
1 parent ac295b6 commit edc96a2

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

tools/testing/selftests/riscv/vector/vstate_prctl.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -88,16 +88,16 @@ int main(void)
8888
return -2;
8989
}
9090

91-
if (!(pair.value & RISCV_HWPROBE_IMA_V)) {
91+
if (!(pair.value & RISCV_HWPROBE_EXT_ZVE32X)) {
9292
rc = prctl(PR_RISCV_V_GET_CONTROL);
9393
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");
9595
return -3;
9696
}
9797

9898
rc = prctl(PR_RISCV_V_SET_CONTROL, PR_RISCV_V_VSTATE_CTRL_ON);
9999
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");
101101
return -4;
102102
}
103103

0 commit comments

Comments
 (0)