summaryrefslogtreecommitdiff
path: root/tools/testing/selftests/rseq/run_param_test.sh
diff options
context:
space:
mode:
authorPaolo Bonzini <pbonzini@redhat.com>2026-06-03 17:00:06 +0200
committerPaolo Bonzini <pbonzini@redhat.com>2026-06-03 17:00:06 +0200
commit9fb628b4cd3488a36e3fc9b22bb840048aa1a9d2 (patch)
tree393daf8614f7915c98eca753d79545aa7e9feb99 /tools/testing/selftests/rseq/run_param_test.sh
parentffb83b98357658b44a8a3b617a42d7ae48514ffd (diff)
parentc114187c5dcf1a66a2910ec66a87d230d523e5c1 (diff)
downloadlinux-next-9fb628b4cd3488a36e3fc9b22bb840048aa1a9d2.tar.gz
linux-next-9fb628b4cd3488a36e3fc9b22bb840048aa1a9d2.zip
Merge branch 'kvm-ghcb-for-7.2' into HEAD
Merge the final part of the GHCB 7.2 fixes at https://lore.kernel.org/kvm/20260529183549.1104619-1-pbonzini@redhat.com/. Patches 1-17 have already been included in Linux 7.1; these are minor cleanups, and fixes for behaviors that are suboptimal or contradicting the specification. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'tools/testing/selftests/rseq/run_param_test.sh')
-rwxr-xr-xtools/testing/selftests/rseq/run_param_test.sh39
1 files changed, 39 insertions, 0 deletions
diff --git a/tools/testing/selftests/rseq/run_param_test.sh b/tools/testing/selftests/rseq/run_param_test.sh
index 8d31426ab41f..69a3fa049929 100755
--- a/tools/testing/selftests/rseq/run_param_test.sh
+++ b/tools/testing/selftests/rseq/run_param_test.sh
@@ -34,6 +34,11 @@ REPS=1000
SLOW_REPS=100
NR_THREADS=$((6*${NR_CPUS}))
+# Prevent GLIBC from registering RSEQ so the selftest can run in legacy and
+# performance optimized mode.
+GLIBC_TUNABLES="${GLIBC_TUNABLES:-}:glibc.pthread.rseq=0"
+export GLIBC_TUNABLES
+
function do_tests()
{
local i=0
@@ -103,6 +108,40 @@ function inject_blocking()
NR_LOOPS=
}
+echo "Testing in legacy RSEQ mode"
+echo "Yield injection (25%)"
+inject_blocking -m 4 -y -L
+
+echo "Yield injection (50%)"
+inject_blocking -m 2 -y -L
+
+echo "Yield injection (100%)"
+inject_blocking -m 1 -y -L
+
+echo "Kill injection (25%)"
+inject_blocking -m 4 -k -L
+
+echo "Kill injection (50%)"
+inject_blocking -m 2 -k -L
+
+echo "Kill injection (100%)"
+inject_blocking -m 1 -k -L
+
+echo "Sleep injection (1ms, 25%)"
+inject_blocking -m 4 -s 1 -L
+
+echo "Sleep injection (1ms, 50%)"
+inject_blocking -m 2 -s 1 -L
+
+echo "Sleep injection (1ms, 100%)"
+inject_blocking -m 1 -s 1 -L
+
+./check_optimized || {
+ echo "Skipping optimized RSEQ mode test. Not supported";
+ exit 0
+}
+
+echo "Testing in optimized RSEQ mode"
echo "Yield injection (25%)"
inject_blocking -m 4 -y