Linux Kernel Selftest development
 help / color / mirror / Atom feed
From: Mark Brown <broonie@kernel.org>
To: Catalin Marinas <catalin.marinas@arm.com>,
	Will Deacon <will@kernel.org>,
	Shuah Khan <skhan@linuxfoundation.org>,
	Shuah Khan <shuah@kernel.org>
Cc: Alan Hayward <alan.hayward@arm.com>,
	Luis Machado <luis.machado@arm.com>,
	Szabolcs Nagy <szabolcs.nagy@arm.com>,
	linux-arm-kernel@lists.infradead.org,
	linux-kselftest@vger.kernel.org, Mark Brown <broonie@kernel.org>
Subject: [PATCH v2 15/21] kselftest/arm64: Cover ZT in the FP stress test
Date: Tue,  1 Nov 2022 14:33:30 +0000	[thread overview]
Message-ID: <20221101143336.254445-16-broonie@kernel.org> (raw)
In-Reply-To: <20221101143336.254445-1-broonie@kernel.org>

Hook up the newly added zt-test program in the FPSIMD stress tests, start
a copy per CPU when SME2 is supported.

Signed-off-by: Mark Brown <broonie@kernel.org>
---
 tools/testing/selftests/arm64/fp/fp-stress.c | 29 ++++++++++++++++++--
 1 file changed, 27 insertions(+), 2 deletions(-)

diff --git a/tools/testing/selftests/arm64/fp/fp-stress.c b/tools/testing/selftests/arm64/fp/fp-stress.c
index 4e62a9199f97..7f4eef8717ad 100644
--- a/tools/testing/selftests/arm64/fp/fp-stress.c
+++ b/tools/testing/selftests/arm64/fp/fp-stress.c
@@ -350,6 +350,19 @@ static void start_za(struct child_data *child, int vl, int cpu)
 	ksft_print_msg("Started %s\n", child->name);
 }
 
+static void start_zt(struct child_data *child, int cpu)
+{
+	int ret;
+
+	child_start(child, "./zt-test");
+
+	ret = asprintf(&child->name, "ZT-%d", cpu);
+	if (ret == -1)
+		ksft_exit_fail_msg("asprintf() failed\n");
+
+	ksft_print_msg("Started %s\n", child->name);
+}
+
 static void probe_vls(int vls[], int *vl_count, int set_vl)
 {
 	unsigned int vq;
@@ -404,6 +417,7 @@ int main(int argc, char **argv)
 	int cpus, tests, i, j, c;
 	int sve_vl_count, sme_vl_count, fpsimd_per_cpu;
 	int sve_vls[MAX_VLS], sme_vls[MAX_VLS];
+	bool have_sme2;
 	struct epoll_event ev;
 	struct sigaction sa;
 
@@ -437,6 +451,13 @@ int main(int argc, char **argv)
 		sme_vl_count = 0;
 	}
 
+	if (getauxval(AT_HWCAP2) & HWCAP2_SME2) {
+		tests += cpus;
+		have_sme2 = true;
+	} else {
+		have_sme2 = false;
+	}
+
 	/* Force context switching if we only have FPSIMD */
 	if (!sve_vl_count && !sme_vl_count)
 		fpsimd_per_cpu = 2;
@@ -447,8 +468,9 @@ int main(int argc, char **argv)
 	ksft_print_header();
 	ksft_set_plan(tests);
 
-	ksft_print_msg("%d CPUs, %d SVE VLs, %d SME VLs\n",
-		       cpus, sve_vl_count, sme_vl_count);
+	ksft_print_msg("%d CPUs, %d SVE VLs, %d SME VLs, SME2 %s\n",
+		       cpus, sve_vl_count, sme_vl_count,
+		       have_sme2 ? "present" : "absent");
 
 	if (timeout > 0)
 		ksft_print_msg("Will run for %ds\n", timeout);
@@ -495,6 +517,9 @@ int main(int argc, char **argv)
 			start_ssve(&children[num_children++], sme_vls[j], i);
 			start_za(&children[num_children++], sme_vls[j], i);
 		}
+
+		if (have_sme2)
+			start_zt(&children[num_children++], i);
 	}
 
 	for (;;) {
-- 
2.30.2


  parent reply	other threads:[~2022-11-01 14:39 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-01 14:33 [PATCH v2 00/21] arm64/sme: Support SME 2 and SME 2.1 Mark Brown
2022-11-01 14:33 ` [PATCH v2 01/21] arm64/sme: Rename za_state to sme_state Mark Brown
2022-11-01 14:33 ` [PATCH v2 02/21] arm64: Document boot requirements for SME 2 Mark Brown
2022-11-01 14:33 ` [PATCH v2 03/21] arm64/sysreg: Update system registers for SME 2 and 2.1 Mark Brown
2022-11-01 14:33 ` [PATCH v2 04/21] arm64/sme: Document SME 2 and SME 2.1 ABI Mark Brown
2022-11-11 10:17   ` Luis Machado
2022-11-11 10:38     ` Luis Machado
2022-11-11 11:20     ` Mark Brown
2022-11-01 14:33 ` [PATCH v2 05/21] arm64/esr: Document ISS for ZT0 being disabled Mark Brown
2022-11-01 14:33 ` [PATCH v2 06/21] arm64/sme: Manually encode ZT0 load and store instructions Mark Brown
2022-11-01 14:33 ` [PATCH v2 07/21] arm64/sme: Enable host kernel to access ZT0 Mark Brown
2022-11-01 14:33 ` [PATCH v2 08/21] arm64/sme: Add basic enumeration for SME2 Mark Brown
2022-11-01 14:33 ` [PATCH v2 09/21] arm64/sme: Provide storage for ZT0 Mark Brown
2022-11-01 14:33 ` [PATCH v2 10/21] arm64/sme: Implement context switching " Mark Brown
2022-11-01 14:33 ` [PATCH v2 11/21] arm64/sme: Implement signal handling for ZT Mark Brown
2022-11-01 14:33 ` [PATCH v2 12/21] arm64/sme: Implement ZT0 ptrace support Mark Brown
2022-11-11 10:31   ` Luis Machado
2022-11-11 11:25     ` Mark Brown
2022-11-01 14:33 ` [PATCH v2 13/21] arm64/sme: Add hwcaps for SME 2 and 2.1 features Mark Brown
2022-11-01 14:33 ` [PATCH v2 14/21] kselftest/arm64: Add a stress test program for ZT0 Mark Brown
2022-11-01 14:33 ` Mark Brown [this message]
2022-11-01 14:33 ` [PATCH v2 16/21] kselftest/arm64: Enumerate SME2 in the signal test utility code Mark Brown
2022-11-01 14:33 ` [PATCH v2 17/21] kselftest/arm64: Teach the generic signal context validation about ZT Mark Brown
2022-11-01 14:33 ` [PATCH v2 18/21] kselftest/arm64: Add test coverage for ZT register signal frames Mark Brown
2022-11-01 14:33 ` [PATCH v2 19/21] kselftest/arm64: Add SME2 coverage to syscall-abi Mark Brown
2022-11-01 14:33 ` [PATCH v2 20/21] kselftest/arm64: Add coverage of the ZT ptrace regset Mark Brown
2022-11-01 14:33 ` [PATCH v2 21/21] kselftest/arm64: Add coverage of SME 2 and 2.1 hwcaps Mark Brown

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20221101143336.254445-16-broonie@kernel.org \
    --to=broonie@kernel.org \
    --cc=alan.hayward@arm.com \
    --cc=catalin.marinas@arm.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=luis.machado@arm.com \
    --cc=shuah@kernel.org \
    --cc=skhan@linuxfoundation.org \
    --cc=szabolcs.nagy@arm.com \
    --cc=will@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox