]> www.infradead.org Git - users/dwmw2/linux.git/commitdiff
selftest: run vector prctl test for ZVE32X
authorAndy Chiu <andy.chiu@sifive.com>
Thu, 9 May 2024 16:26:58 +0000 (00:26 +0800)
committerPalmer Dabbelt <palmer@rivosinc.com>
Thu, 30 May 2024 21:33:11 +0000 (14:33 -0700)
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>
tools/testing/selftests/riscv/vector/vstate_prctl.c

index 27668fb3b6d08209b8c6a98dec01d6935941b47e..895177f6bf4c865e894b16ed8662184f0c20b30f 100644 (file)
@@ -88,16 +88,16 @@ int main(void)
                return -2;
        }
 
-       if (!(pair.value & RISCV_HWPROBE_IMA_V)) {
+       if (!(pair.value & RISCV_HWPROBE_EXT_ZVE32X)) {
                rc = prctl(PR_RISCV_V_GET_CONTROL);
                if (rc != -1 || errno != EINVAL) {
-                       ksft_test_result_fail("GET_CONTROL should fail on kernel/hw without V\n");
+                       ksft_test_result_fail("GET_CONTROL should fail on kernel/hw without ZVE32X\n");
                        return -3;
                }
 
                rc = prctl(PR_RISCV_V_SET_CONTROL, PR_RISCV_V_VSTATE_CTRL_ON);
                if (rc != -1 || errno != EINVAL) {
-                       ksft_test_result_fail("GET_CONTROL should fail on kernel/hw without V\n");
+                       ksft_test_result_fail("SET_CONTROL should fail on kernel/hw without ZVE32X\n");
                        return -4;
                }