Skip to content

Commit e093256

Browse files
brooniewilldeacon
authored andcommitted
selftests: arm64: Add build and documentation for FP tests
Integrate the FP tests with the build system and add some documentation for the ones run outside the kselftest infrastructure. The content in the README was largely written by Dave Martin with edits by me. Signed-off-by: Mark Brown <broonie@kernel.org> Acked-by: Dave Martin <Dave.Martin@arm.com> Acked-by: Shuah Khan <skhan@linuxfoundation.org> Link: https://lore.kernel.org/r/20200819114837.51466-7-broonie@kernel.org Signed-off-by: Will Deacon <will@kernel.org>
1 parent 25f47e3 commit e093256

4 files changed

Lines changed: 123 additions & 1 deletion

File tree

tools/testing/selftests/arm64/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
ARCH ?= $(shell uname -m 2>/dev/null || echo not)
55

66
ifneq (,$(filter $(ARCH),aarch64 arm64))
7-
ARM64_SUBTARGETS ?= tags signal pauth
7+
ARM64_SUBTARGETS ?= tags signal pauth fp
88
else
99
ARM64_SUBTARGETS :=
1010
endif
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
fpsimd-test
2+
sve-probe-vls
3+
sve-ptrace
4+
sve-test
5+
vlset
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# SPDX-License-Identifier: GPL-2.0
2+
3+
CFLAGS += -I../../../../../usr/include/
4+
TEST_GEN_PROGS := sve-ptrace sve-probe-vls
5+
TEST_PROGS_EXTENDED := fpsimd-test fpsimd-stress sve-test sve-stress vlset
6+
7+
all: $(TEST_GEN_PROGS) $(TEST_PROGS_EXTENDED)
8+
9+
fpsimd-test: fpsimd-test.o
10+
$(CC) -nostdlib $^ -o $@
11+
sve-ptrace: sve-ptrace.o sve-ptrace-asm.o
12+
sve-probe-vls: sve-probe-vls.o
13+
sve-test: sve-test.o
14+
$(CC) -nostdlib $^ -o $@
15+
vlset: vlset.o
16+
17+
include ../../lib.mk
Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
1+
This directory contains a mix of tests integrated with kselftest and
2+
standalone stress tests.
3+
4+
kselftest tests
5+
===============
6+
7+
sve-probe-vls - Checks the SVE vector length enumeration interface
8+
sve-ptrace - Checks the SVE ptrace interface
9+
10+
Running the non-kselftest tests
11+
===============================
12+
13+
sve-stress performs an SVE context switch stress test, as described
14+
below.
15+
16+
(The fpsimd-stress test works the same way; just substitute "fpsimd" for
17+
"sve" in the following commands.)
18+
19+
20+
The test runs until killed by the user.
21+
22+
If no context switch error was detected, you will see output such as
23+
the following:
24+
25+
$ ./sve-stress
26+
(wait for some time)
27+
^C
28+
Vector length: 512 bits
29+
PID: 1573
30+
Terminated by signal 15, no error, iterations=9467, signals=1014
31+
Vector length: 512 bits
32+
PID: 1575
33+
Terminated by signal 15, no error, iterations=9448, signals=1028
34+
Vector length: 512 bits
35+
PID: 1577
36+
Terminated by signal 15, no error, iterations=9436, signals=1039
37+
Vector length: 512 bits
38+
PID: 1579
39+
Terminated by signal 15, no error, iterations=9421, signals=1039
40+
Vector length: 512 bits
41+
PID: 1581
42+
Terminated by signal 15, no error, iterations=9403, signals=1039
43+
Vector length: 512 bits
44+
PID: 1583
45+
Terminated by signal 15, no error, iterations=9385, signals=1036
46+
Vector length: 512 bits
47+
PID: 1585
48+
Terminated by signal 15, no error, iterations=9376, signals=1039
49+
Vector length: 512 bits
50+
PID: 1587
51+
Terminated by signal 15, no error, iterations=9361, signals=1039
52+
Vector length: 512 bits
53+
PID: 1589
54+
Terminated by signal 15, no error, iterations=9350, signals=1039
55+
56+
57+
If an error was detected, details of the mismatch will be printed
58+
instead of "no error".
59+
60+
Ideally, the test should be allowed to run for many minutes or hours
61+
to maximise test coverage.
62+
63+
64+
KVM stress testing
65+
==================
66+
67+
To try to reproduce the bugs that we have been observing, sve-stress
68+
should be run in parallel in two KVM guests, while simultaneously
69+
running on the host.
70+
71+
1) Start 2 guests, using the following command for each:
72+
73+
$ lkvm run --console=virtio -pconsole=hvc0 --sve Image
74+
75+
(Depending on the hardware GIC implementation, you may also need
76+
--irqchip=gicv3. New kvmtool defaults to that if appropriate, but I
77+
can't remember whether my branch is new enough for that. Try without
78+
the option first.)
79+
80+
Kvmtool occupies the terminal until you kill it (Ctrl+A x),
81+
or until the guest terminates. It is therefore recommended to run
82+
each instance in separate terminal (use screen or ssh etc.) This
83+
allows multiple guests to be run in parallel while running other
84+
commands on the host.
85+
86+
Within the guest, the host filesystem is accessible, mounted on /host.
87+
88+
2) Run the sve-stress on *each* guest with the Vector-Length set to 32:
89+
guest$ ./vlset --inherit 32 ./sve-stress
90+
91+
3) Run the sve-stress on the host with the maximum Vector-Length:
92+
host$ ./vlset --inherit --max ./sve-stress
93+
94+
95+
Again, the test should be allowed to run for many minutes or hours to
96+
maximise test coverage.
97+
98+
If no error is detected, you will see output from each sve-stress
99+
instance similar to that illustrated above; otherwise details of the
100+
observed mismatches will be printed.

0 commit comments

Comments
 (0)