Skip to content

Commit b43ab36

Browse files
brooniectmarinas
authored andcommitted
kselftest/arm64: Validate vector lengths are set in sve-probe-vls
Currently sve-probe-vls does not verify that the vector lengths reported by the prctl() interface are actually what is reported by the architecture, use the rdvl_sve() helper to validate this. Signed-off-by: Mark Brown <[email protected]> Reviewed-by: Dave Martin <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Catalin Marinas <[email protected]>
1 parent 7710861 commit b43ab36

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

tools/testing/selftests/arm64/fp/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ fpsimd-test: fpsimd-test.o
1313
$(CC) -nostdlib $^ -o $@
1414
rdvl-sve: rdvl-sve.o rdvl.o
1515
sve-ptrace: sve-ptrace.o sve-ptrace-asm.o
16-
sve-probe-vls: sve-probe-vls.o
16+
sve-probe-vls: sve-probe-vls.o rdvl.o
1717
sve-test: sve-test.o
1818
$(CC) -nostdlib $^ -o $@
1919
vlset: vlset.o

tools/testing/selftests/arm64/fp/sve-probe-vls.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
#include <asm/sigcontext.h>
1414

1515
#include "../../kselftest.h"
16+
#include "rdvl.h"
1617

1718
int main(int argc, char **argv)
1819
{
@@ -38,6 +39,10 @@ int main(int argc, char **argv)
3839

3940
vl &= PR_SVE_VL_LEN_MASK;
4041

42+
if (rdvl_sve() != vl)
43+
ksft_exit_fail_msg("PR_SVE_SET_VL reports %d, RDVL %d\n",
44+
vl, rdvl_sve());
45+
4146
if (!sve_vl_valid(vl))
4247
ksft_exit_fail_msg("VL %d invalid\n", vl);
4348
vq = sve_vq_from_vl(vl);

0 commit comments

Comments
 (0)