[PATCH v11 34/40] kselftest/arm64: sme: Provide streaming mode SVE stress test

Shuah Khan skhan at linuxfoundation.org
Mon Feb 7 16:40:08 PST 2022


On 2/7/22 8:21 AM, Mark Brown wrote:
> One of the features of SME is the addition of streaming mode, in which we
> have access to a set of streaming mode SVE registers at the SME vector
> length. Since these are accessed using the SVE instructions let's reuse
> the existing SVE stress test for testing with a compile time option for
> controlling the few small differences needed:
> 
>   - Enter streaming mode immediately on starting the program.
>   - In streaming mode FFR is removed so skip reading and writing FFR.
> 
> In order to avoid requiring a cutting edge toolchain with SME support
> use the op/CR form for specifying SVCR.

A few words or pointer to op/CR form would help as education for
people that aren't familiar with the form (self included).

> 
> Signed-off-by: Mark Brown <broonie at kernel.org>
> ---
>   tools/testing/selftests/arm64/fp/.gitignore  |  1 +
>   tools/testing/selftests/arm64/fp/Makefile    |  3 +
>   tools/testing/selftests/arm64/fp/ssve-stress | 59 ++++++++++++++++++++
>   tools/testing/selftests/arm64/fp/sve-test.S  | 20 +++++++
>   4 files changed, 83 insertions(+)
>   create mode 100644 tools/testing/selftests/arm64/fp/ssve-stress
> 
> diff --git a/tools/testing/selftests/arm64/fp/.gitignore b/tools/testing/selftests/arm64/fp/.gitignore
> index 6e9a610c5e5d..5729a5b1adfc 100644
> --- a/tools/testing/selftests/arm64/fp/.gitignore
> +++ b/tools/testing/selftests/arm64/fp/.gitignore
> @@ -5,5 +5,6 @@ rdvl-sve
>   sve-probe-vls
>   sve-ptrace
>   sve-test
> +ssve-test
>   vec-syscfg
>   vlset
> diff --git a/tools/testing/selftests/arm64/fp/Makefile b/tools/testing/selftests/arm64/fp/Makefile
> index a224fff8082b..e6643c9b0474 100644
> --- a/tools/testing/selftests/arm64/fp/Makefile
> +++ b/tools/testing/selftests/arm64/fp/Makefile
> @@ -5,6 +5,7 @@ TEST_GEN_PROGS := sve-ptrace sve-probe-vls vec-syscfg
>   TEST_PROGS_EXTENDED := fp-pidbench fpsimd-test fpsimd-stress \
>   	rdvl-sme rdvl-sve \
>   	sve-test sve-stress \
> +	ssve-test ssve-stress \
>   	vlset
>   
>   all: $(TEST_GEN_PROGS) $(TEST_PROGS_EXTENDED)
> @@ -19,6 +20,8 @@ sve-ptrace: sve-ptrace.o
>   sve-probe-vls: sve-probe-vls.o rdvl.o
>   sve-test: sve-test.o asm-utils.o
>   	$(CC) -nostdlib $^ -o $@
> +ssve-test: sve-test.S asm-utils.o
> +	$(CC) -DSSVE -nostdlib $^ -o $@
>   vec-syscfg: vec-syscfg.o rdvl.o
>   vlset: vlset.o
>   
> diff --git a/tools/testing/selftests/arm64/fp/ssve-stress b/tools/testing/selftests/arm64/fp/ssve-stress
> new file mode 100644
> index 000000000000..e2bd2cc184ad
> --- /dev/null
> +++ b/tools/testing/selftests/arm64/fp/ssve-stress
> @@ -0,0 +1,59 @@
> +#!/bin/bash
> +# SPDX-License-Identifier: GPL-2.0-only
> +# Copyright (C) 2015-2019 ARM Limited.
> +# Original author: Dave Martin <Dave.Martin at arm.com>
> +
> +set -ue
> +
> +NR_CPUS=`nproc`
> +
> +pids=
> +logs=
> +
> +cleanup () {
> +	trap - INT TERM CHLD
> +	set +e
> +
> +	if [ -n "$pids" ]; then
> +		kill $pids
> +		wait $pids
> +		pids=
> +	fi
> +
> +	if [ -n "$logs" ]; then
> +		cat $logs
> +		rm $logs
> +		logs=
> +	fi
> +}
> +
> +interrupt () {
> +	cleanup
> +	exit 0
> +}
> +
> +child_died () {
> +	cleanup
> +	exit 1

Is this a failure condition?

> +}
> +

With the comments explained or addressed:

Reviewed-by: Shuah Khan <skhan at linuxfoundation.org>

thanks,
-- Shuah



More information about the linux-arm-kernel mailing list