Commit 712f4ee7 authored by Will Deacon's avatar Will Deacon
Browse files

Merge branch 'for-next/selftests' into for-next/core

* for-next/selftests:
  kselftest/arm64: Add lsfe to the hwcaps test
  kselftest/arm64: Check that unsupported regsets fail in sve-ptrace
  kselftest/arm64: Verify that we reject out of bounds VLs in sve-ptrace
  kselftest/arm64/gcs/basic-gcs: Respect parent directory CFLAGS
  selftests/arm64: Fix grammatical error in string literals
  kselftest/arm64: Add parentheses around sizeof for clarity
  kselftest/arm64: Supress warning and improve readability
  kselftest/arm64: Remove extra blank line
  kselftest/arm64/gcs: Use nolibc's getauxval()
  kselftest/arm64/gcs: Correctly check return value when disabling GCS
  selftests: arm64: Fix -Waddress warning in tpidr2 test
  kselftest/arm64: Log error codes in sve-ptrace
  selftests: arm64: Check fread return value in exec_target
parents f2d64a22 777fb19e
Loading
Loading
Loading
Loading
+21 −1
Original line number Diff line number Diff line
@@ -17,6 +17,8 @@
#include <asm/sigcontext.h>
#include <asm/unistd.h>

#include <linux/auxvec.h>

#include "../../kselftest.h"

#define TESTS_PER_HWCAP 3
@@ -55,7 +57,6 @@ static void cmpbr_sigill(void)
	/* Not implemented, too complicated and unreliable anyway */
}


static void crc32_sigill(void)
{
	/* CRC32W W0, W0, W1 */
@@ -169,6 +170,18 @@ static void lse128_sigill(void)
		     : "cc", "memory");
}

static void lsfe_sigill(void)
{
	float __attribute__ ((aligned (16))) mem;
	register float *memp asm ("x0") = &mem;

	/* STFADD H0, [X0] */
	asm volatile(".inst 0x7c20801f"
		     : "+r" (memp)
		     :
		     : "memory");
}

static void lut_sigill(void)
{
	/* LUTI2 V0.16B, { V0.16B }, V[0] */
@@ -762,6 +775,13 @@ static const struct hwcap_data {
		.cpuinfo = "lse128",
		.sigill_fn = lse128_sigill,
	},
	{
		.name = "LSFE",
		.at_hwcap = AT_HWCAP3,
		.hwcap_bit = HWCAP3_LSFE,
		.cpuinfo = "lsfe",
		.sigill_fn = lsfe_sigill,
	},
	{
		.name = "LUT",
		.at_hwcap = AT_HWCAP2,
+4 −4
Original line number Diff line number Diff line
@@ -227,10 +227,10 @@ int main(int argc, char **argv)
	ret = open("/proc/sys/abi/sme_default_vector_length", O_RDONLY, 0);
	if (ret >= 0) {
		ksft_test_result(default_value(), "default_value\n");
		ksft_test_result(write_read, "write_read\n");
		ksft_test_result(write_sleep_read, "write_sleep_read\n");
		ksft_test_result(write_fork_read, "write_fork_read\n");
		ksft_test_result(write_clone_read, "write_clone_read\n");
		ksft_test_result(write_read(), "write_read\n");
		ksft_test_result(write_sleep_read(), "write_sleep_read\n");
		ksft_test_result(write_fork_read(), "write_fork_read\n");
		ksft_test_result(write_clone_read(), "write_clone_read\n");

	} else {
		ksft_print_msg("SME support not present\n");
+0 −1
Original line number Diff line number Diff line
@@ -14,7 +14,6 @@
#define GNU_PROPERTY_AARCH64_FEATURE_1_BTI	(1U << 0)
#define GNU_PROPERTY_AARCH64_FEATURE_1_PAC	(1U << 1)


.macro startfn name:req
	.globl \name
\name:
+0 −1
Original line number Diff line number Diff line
@@ -1568,7 +1568,6 @@ static void run_sve_tests(void)
					  &test_config);
		}
	}

}

static void run_sme_tests(void)
+3 −3
Original line number Diff line number Diff line
@@ -106,7 +106,7 @@ static void child_start(struct child_data *child, const char *program)
		/*
		 * Read from the startup pipe, there should be no data
		 * and we should block until it is closed. We just
		 * carry on on error since this isn't super critical.
		 * carry-on on error since this isn't super critical.
		 */
		ret = read(3, &i, sizeof(i));
		if (ret < 0)
@@ -549,7 +549,7 @@ int main(int argc, char **argv)

	evs = calloc(tests, sizeof(*evs));
	if (!evs)
		ksft_exit_fail_msg("Failed to allocated %d epoll events\n",
		ksft_exit_fail_msg("Failed to allocate %d epoll events\n",
				   tests);

	for (i = 0; i < cpus; i++) {
Loading