Skip to content

Commit 50806fd

Browse files
brooniectmarinas
authored andcommitted
kselftest/arm64: Skip VL_INHERIT tests for unsupported vector types
Currently we unconditionally test the ability to set the vector length inheritance flag via ptrace meaning that we generate false failures on systems that don't support SVE when we attempt to set the vector length there. Check the hwcap and mark the tests as skipped when it's not present. Fixes: 0ba1ce1 ("selftests: arm64: Add coverage of ptrace flags for SVE VL inheritance") Signed-off-by: Mark Brown <[email protected]> Reviewed-by: Shuah Khan <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Catalin Marinas <[email protected]>
1 parent 3758a6c commit 50806fd

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

tools/testing/selftests/arm64/fp/sve-ptrace.c

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -557,7 +557,14 @@ static int do_parent(pid_t child)
557557
}
558558

559559
/* prctl() flags */
560-
ptrace_set_get_inherit(child, &vec_types[i]);
560+
if (getauxval(vec_types[i].hwcap_type) & vec_types[i].hwcap) {
561+
ptrace_set_get_inherit(child, &vec_types[i]);
562+
} else {
563+
ksft_test_result_skip("%s SVE_PT_VL_INHERIT set\n",
564+
vec_types[i].name);
565+
ksft_test_result_skip("%s SVE_PT_VL_INHERIT cleared\n",
566+
vec_types[i].name);
567+
}
561568

562569
/* Step through every possible VQ */
563570
for (vq = SVE_VQ_MIN; vq <= SVE_VQ_MAX; vq++) {

0 commit comments

Comments
 (0)