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
This commit is contained in:
Will Deacon 2024-01-04 12:28:22 +00:00
commit ef4896b598
5 changed files with 43 additions and 10 deletions

View File

@ -254,6 +254,12 @@ static int write_clone_read(void)
putnum(++tests_run); \
putstr(" " #name "\n");
#define skip_test(name) \
tests_skipped++; \
putstr("ok "); \
putnum(++tests_run); \
putstr(" # SKIP " #name "\n");
int main(int argc, char **argv)
{
int ret, i;
@ -283,13 +289,11 @@ int main(int argc, char **argv)
} else {
putstr("# SME support not present\n");
for (i = 0; i < EXPECTED_TESTS; i++) {
putstr("ok ");
putnum(i);
putstr(" skipped, TPIDR2 not supported\n");
}
tests_skipped += EXPECTED_TESTS;
skip_test(default_value);
skip_test(write_read);
skip_test(write_sleep_read);
skip_test(write_fork_read);
skip_test(write_clone_read);
}
print_summary();

View File

@ -515,6 +515,10 @@ function barf
mov x11, x1 // actual data
mov x12, x2 // data size
#ifdef SSVE
mrs x13, S3_3_C4_C2_2
#endif
puts "Mismatch: PID="
mov x0, x20
bl putdec
@ -534,6 +538,12 @@ function barf
bl dumphex
puts "]\n"
#ifdef SSVE
puts "\tSVCR: "
mov x0, x13
bl putdecn
#endif
mov x8, #__NR_getpid
svc #0
// fpsimd.c acitivty log dump hack

View File

@ -66,6 +66,11 @@ static struct vec_data vec_data[] = {
},
};
static bool vec_type_supported(struct vec_data *data)
{
return getauxval(data->hwcap_type) & data->hwcap;
}
static int stdio_read_integer(FILE *f, const char *what, int *val)
{
int n = 0;
@ -564,8 +569,11 @@ static void prctl_set_all_vqs(struct vec_data *data)
return;
}
for (i = 0; i < ARRAY_SIZE(vec_data); i++)
for (i = 0; i < ARRAY_SIZE(vec_data); i++) {
if (!vec_type_supported(&vec_data[i]))
continue;
orig_vls[i] = vec_data[i].rdvl();
}
for (vq = SVE_VQ_MIN; vq <= SVE_VQ_MAX; vq++) {
vl = sve_vl_from_vq(vq);
@ -594,7 +602,7 @@ static void prctl_set_all_vqs(struct vec_data *data)
if (&vec_data[i] == data)
continue;
if (!(getauxval(vec_data[i].hwcap_type) & vec_data[i].hwcap))
if (!vec_type_supported(&vec_data[i]))
continue;
if (vec_data[i].rdvl() != orig_vls[i]) {
@ -765,7 +773,7 @@ int main(void)
struct vec_data *data = &vec_data[i];
unsigned long supported;
supported = getauxval(data->hwcap_type) & data->hwcap;
supported = vec_type_supported(data);
if (!supported)
all_supported = false;

View File

@ -333,6 +333,9 @@ function barf
// mov w8, #__NR_exit
// svc #0
// end hack
mrs x13, S3_3_C4_C2_2
smstop
mov x10, x0 // expected data
mov x11, x1 // actual data
@ -356,6 +359,9 @@ function barf
mov x1, x12
bl dumphex
puts "]\n"
puts "\tSVCR: "
mov x0, x13
bl putdecn
mov x8, #__NR_getpid
svc #0

View File

@ -267,6 +267,8 @@ function barf
// mov w8, #__NR_exit
// svc #0
// end hack
mrs x13, S3_3_C4_C2_2
smstop
mov x10, x0 // expected data
mov x11, x1 // actual data
@ -287,6 +289,9 @@ function barf
mov x1, x12
bl dumphex
puts "]\n"
puts "\tSVCR: "
mov x0, x13
bl putdecn
mov x8, #__NR_getpid
svc #0