Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

kselftest/arm64: Limit the maximum VL we try to set via ptrace

When SVE was initially merged we chose to export the maximum VQ in the ABI
as being 512, rather more than the architecturally supported maximum of 16.
For the ptrace tests this results in us generating a lot of test cases and
hence log output which are redundant since a system couldn't possibly
support them. Instead only check values up to the current architectural
limit, plus one more so that we're covering the constraining of higher
vector lengths.

This makes no practical difference to our test coverage, speeds things up
on slower consoles and makes the output much more managable.

Signed-off-by: Mark Brown <broonie@kernel.org>
Link: https://lore.kernel.org/r/20230111-arm64-kselftest-ptrace-max-vl-v1-1-8167f41d1ad8@kernel.org
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>

authored by

Mark Brown and committed by
Catalin Marinas
89ff30b9 daac8353

+24 -4
+12 -2
tools/testing/selftests/arm64/fp/sve-ptrace.c
··· 30 30 #define NT_ARM_SSVE 0x40b 31 31 #endif 32 32 33 + /* 34 + * The architecture defines the maximum VQ as 16 but for extensibility 35 + * the kernel specifies the SVE_VQ_MAX as 512 resulting in us running 36 + * a *lot* more tests than are useful if we use it. Until the 37 + * architecture is extended let's limit our coverage to what is 38 + * currently allowed, plus one extra to ensure we cover constraining 39 + * the VL as expected. 40 + */ 41 + #define TEST_VQ_MAX 17 42 + 33 43 struct vec_type { 34 44 const char *name; 35 45 unsigned long hwcap_type; ··· 65 55 }, 66 56 }; 67 57 68 - #define VL_TESTS (((SVE_VQ_MAX - SVE_VQ_MIN) + 1) * 4) 58 + #define VL_TESTS (((TEST_VQ_MAX - SVE_VQ_MIN) + 1) * 4) 69 59 #define FLAG_TESTS 2 70 60 #define FPSIMD_TESTS 2 71 61 ··· 699 689 } 700 690 701 691 /* Step through every possible VQ */ 702 - for (vq = SVE_VQ_MIN; vq <= SVE_VQ_MAX; vq++) { 692 + for (vq = SVE_VQ_MIN; vq <= TEST_VQ_MAX; vq++) { 703 693 vl = sve_vl_from_vq(vq); 704 694 705 695 /* First, try to set this vector length */
+12 -2
tools/testing/selftests/arm64/fp/za-ptrace.c
··· 25 25 #define NT_ARM_ZA 0x40c 26 26 #endif 27 27 28 - #define EXPECTED_TESTS (((SVE_VQ_MAX - SVE_VQ_MIN) + 1) * 3) 28 + /* 29 + * The architecture defines the maximum VQ as 16 but for extensibility 30 + * the kernel specifies the SVE_VQ_MAX as 512 resulting in us running 31 + * a *lot* more tests than are useful if we use it. Until the 32 + * architecture is extended let's limit our coverage to what is 33 + * currently allowed, plus one extra to ensure we cover constraining 34 + * the VL as expected. 35 + */ 36 + #define TEST_VQ_MAX 17 37 + 38 + #define EXPECTED_TESTS (((TEST_VQ_MAX - SVE_VQ_MIN) + 1) * 3) 29 39 30 40 static void fill_buf(char *buf, size_t size) 31 41 { ··· 311 301 ksft_print_msg("Parent is %d, child is %d\n", getpid(), child); 312 302 313 303 /* Step through every possible VQ */ 314 - for (vq = SVE_VQ_MIN; vq <= SVE_VQ_MAX; vq++) { 304 + for (vq = SVE_VQ_MIN; vq <= TEST_VQ_MAX; vq++) { 315 305 vl = sve_vl_from_vq(vq); 316 306 317 307 /* First, try to set this vector length */