Skip to content

Commit ef4896b

Browse files
committed
Merge branch 'for-next/selftests' into for-next/core
* for-next/selftests: kselftest/arm64: Don't probe the current VL for unsupported vector types kselftest/arm64: Log SVCR when the SME tests barf kselftest/arm64: Improve output for skipped TPIDR2 ABI test
2 parents 3043177 + 9a802dd commit ef4896b

File tree

5 files changed

+43
-10
lines changed

5 files changed

+43
-10
lines changed

tools/testing/selftests/arm64/abi/tpidr2.c

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -254,6 +254,12 @@ static int write_clone_read(void)
254254
putnum(++tests_run); \
255255
putstr(" " #name "\n");
256256

257+
#define skip_test(name) \
258+
tests_skipped++; \
259+
putstr("ok "); \
260+
putnum(++tests_run); \
261+
putstr(" # SKIP " #name "\n");
262+
257263
int main(int argc, char **argv)
258264
{
259265
int ret, i;
@@ -283,13 +289,11 @@ int main(int argc, char **argv)
283289
} else {
284290
putstr("# SME support not present\n");
285291

286-
for (i = 0; i < EXPECTED_TESTS; i++) {
287-
putstr("ok ");
288-
putnum(i);
289-
putstr(" skipped, TPIDR2 not supported\n");
290-
}
291-
292-
tests_skipped += EXPECTED_TESTS;
292+
skip_test(default_value);
293+
skip_test(write_read);
294+
skip_test(write_sleep_read);
295+
skip_test(write_fork_read);
296+
skip_test(write_clone_read);
293297
}
294298

295299
print_summary();

tools/testing/selftests/arm64/fp/sve-test.S

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -515,6 +515,10 @@ function barf
515515
mov x11, x1 // actual data
516516
mov x12, x2 // data size
517517

518+
#ifdef SSVE
519+
mrs x13, S3_3_C4_C2_2
520+
#endif
521+
518522
puts "Mismatch: PID="
519523
mov x0, x20
520524
bl putdec
@@ -534,6 +538,12 @@ function barf
534538
bl dumphex
535539
puts "]\n"
536540

541+
#ifdef SSVE
542+
puts "\tSVCR: "
543+
mov x0, x13
544+
bl putdecn
545+
#endif
546+
537547
mov x8, #__NR_getpid
538548
svc #0
539549
// fpsimd.c acitivty log dump hack

tools/testing/selftests/arm64/fp/vec-syscfg.c

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,11 @@ static struct vec_data vec_data[] = {
6666
},
6767
};
6868

69+
static bool vec_type_supported(struct vec_data *data)
70+
{
71+
return getauxval(data->hwcap_type) & data->hwcap;
72+
}
73+
6974
static int stdio_read_integer(FILE *f, const char *what, int *val)
7075
{
7176
int n = 0;
@@ -564,8 +569,11 @@ static void prctl_set_all_vqs(struct vec_data *data)
564569
return;
565570
}
566571

567-
for (i = 0; i < ARRAY_SIZE(vec_data); i++)
572+
for (i = 0; i < ARRAY_SIZE(vec_data); i++) {
573+
if (!vec_type_supported(&vec_data[i]))
574+
continue;
568575
orig_vls[i] = vec_data[i].rdvl();
576+
}
569577

570578
for (vq = SVE_VQ_MIN; vq <= SVE_VQ_MAX; vq++) {
571579
vl = sve_vl_from_vq(vq);
@@ -594,7 +602,7 @@ static void prctl_set_all_vqs(struct vec_data *data)
594602
if (&vec_data[i] == data)
595603
continue;
596604

597-
if (!(getauxval(vec_data[i].hwcap_type) & vec_data[i].hwcap))
605+
if (!vec_type_supported(&vec_data[i]))
598606
continue;
599607

600608
if (vec_data[i].rdvl() != orig_vls[i]) {
@@ -765,7 +773,7 @@ int main(void)
765773
struct vec_data *data = &vec_data[i];
766774
unsigned long supported;
767775

768-
supported = getauxval(data->hwcap_type) & data->hwcap;
776+
supported = vec_type_supported(data);
769777
if (!supported)
770778
all_supported = false;
771779

tools/testing/selftests/arm64/fp/za-test.S

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -333,6 +333,9 @@ function barf
333333
// mov w8, #__NR_exit
334334
// svc #0
335335
// end hack
336+
337+
mrs x13, S3_3_C4_C2_2
338+
336339
smstop
337340
mov x10, x0 // expected data
338341
mov x11, x1 // actual data
@@ -356,6 +359,9 @@ function barf
356359
mov x1, x12
357360
bl dumphex
358361
puts "]\n"
362+
puts "\tSVCR: "
363+
mov x0, x13
364+
bl putdecn
359365

360366
mov x8, #__NR_getpid
361367
svc #0

tools/testing/selftests/arm64/fp/zt-test.S

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -267,6 +267,8 @@ function barf
267267
// mov w8, #__NR_exit
268268
// svc #0
269269
// end hack
270+
271+
mrs x13, S3_3_C4_C2_2
270272
smstop
271273
mov x10, x0 // expected data
272274
mov x11, x1 // actual data
@@ -287,6 +289,9 @@ function barf
287289
mov x1, x12
288290
bl dumphex
289291
puts "]\n"
292+
puts "\tSVCR: "
293+
mov x0, x13
294+
bl putdecn
290295

291296
mov x8, #__NR_getpid
292297
svc #0

0 commit comments

Comments
 (0)