Skip to content

Commit 89ff30b

Browse files
brooniectmarinas
authored andcommitted
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>
1 parent daac835 commit 89ff30b

2 files changed

Lines changed: 24 additions & 4 deletions

File tree

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

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,16 @@
3030
#define NT_ARM_SSVE 0x40b
3131
#endif
3232

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+
3343
struct vec_type {
3444
const char *name;
3545
unsigned long hwcap_type;
@@ -55,7 +65,7 @@ static const struct vec_type vec_types[] = {
5565
},
5666
};
5767

58-
#define VL_TESTS (((SVE_VQ_MAX - SVE_VQ_MIN) + 1) * 4)
68+
#define VL_TESTS (((TEST_VQ_MAX - SVE_VQ_MIN) + 1) * 4)
5969
#define FLAG_TESTS 2
6070
#define FPSIMD_TESTS 2
6171

@@ -689,7 +699,7 @@ static int do_parent(pid_t child)
689699
}
690700

691701
/* Step through every possible VQ */
692-
for (vq = SVE_VQ_MIN; vq <= SVE_VQ_MAX; vq++) {
702+
for (vq = SVE_VQ_MIN; vq <= TEST_VQ_MAX; vq++) {
693703
vl = sve_vl_from_vq(vq);
694704

695705
/* First, try to set this vector length */

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

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,17 @@
2525
#define NT_ARM_ZA 0x40c
2626
#endif
2727

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)
2939

3040
static void fill_buf(char *buf, size_t size)
3141
{
@@ -301,7 +311,7 @@ static int do_parent(pid_t child)
301311
ksft_print_msg("Parent is %d, child is %d\n", getpid(), child);
302312

303313
/* Step through every possible VQ */
304-
for (vq = SVE_VQ_MIN; vq <= SVE_VQ_MAX; vq++) {
314+
for (vq = SVE_VQ_MIN; vq <= TEST_VQ_MAX; vq++) {
305315
vl = sve_vl_from_vq(vq);
306316

307317
/* First, try to set this vector length */

0 commit comments

Comments
 (0)