Commit ef4896b5 authored by Will Deacon's avatar Will Deacon
Browse files

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
parents 30431774 9a802ddb
Loading
Loading
Loading
Loading
+11 −7
Original line number Diff line number Diff line
@@ -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();
+10 −0
Original line number Diff line number Diff line
@@ -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
+11 −3
Original line number Diff line number Diff line
@@ -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;

+6 −0
Original line number Diff line number Diff line
@@ -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
+5 −0
Original line number Diff line number Diff line
@@ -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