Commit b43ab36a authored by Mark Brown's avatar Mark Brown Committed by Catalin Marinas

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: default avatarMark Brown <broonie@kernel.org>
Reviewed-by: default avatarDave Martin <Dave.Martin@arm.com>
Link: https://lore.kernel.org/r/20210803140450.46624-3-broonie@kernel.orgSigned-off-by: default avatarCatalin Marinas <catalin.marinas@arm.com>
parent 77108610
...@@ -13,7 +13,7 @@ fpsimd-test: fpsimd-test.o ...@@ -13,7 +13,7 @@ fpsimd-test: fpsimd-test.o
$(CC) -nostdlib $^ -o $@ $(CC) -nostdlib $^ -o $@
rdvl-sve: rdvl-sve.o rdvl.o rdvl-sve: rdvl-sve.o rdvl.o
sve-ptrace: sve-ptrace.o sve-ptrace-asm.o sve-ptrace: sve-ptrace.o sve-ptrace-asm.o
sve-probe-vls: sve-probe-vls.o sve-probe-vls: sve-probe-vls.o rdvl.o
sve-test: sve-test.o sve-test: sve-test.o
$(CC) -nostdlib $^ -o $@ $(CC) -nostdlib $^ -o $@
vlset: vlset.o vlset: vlset.o
......
...@@ -13,6 +13,7 @@ ...@@ -13,6 +13,7 @@
#include <asm/sigcontext.h> #include <asm/sigcontext.h>
#include "../../kselftest.h" #include "../../kselftest.h"
#include "rdvl.h"
int main(int argc, char **argv) int main(int argc, char **argv)
{ {
...@@ -38,6 +39,10 @@ int main(int argc, char **argv) ...@@ -38,6 +39,10 @@ int main(int argc, char **argv)
vl &= PR_SVE_VL_LEN_MASK; vl &= PR_SVE_VL_LEN_MASK;
if (rdvl_sve() != vl)
ksft_exit_fail_msg("PR_SVE_SET_VL reports %d, RDVL %d\n",
vl, rdvl_sve());
if (!sve_vl_valid(vl)) if (!sve_vl_valid(vl))
ksft_exit_fail_msg("VL %d invalid\n", vl); ksft_exit_fail_msg("VL %d invalid\n", vl);
vq = sve_vq_from_vl(vl); vq = sve_vq_from_vl(vl);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment