]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
selftests/rseq: Make registration flexible for legacy and optimized mode
authorThomas Gleixner <tglx@kernel.org>
Sun, 26 Apr 2026 16:13:54 +0000 (18:13 +0200)
committerPeter Zijlstra <peterz@infradead.org>
Tue, 5 May 2026 14:03:11 +0000 (16:03 +0200)
commitd97cb2ef0b221b068e90b6058aa97faa0626bdab
treeccf0bfce058a11c0816d9161e48b9d92c470bbd4
parent02b44d943b3adddc3a15c1da97045e205b7d14c1
selftests/rseq: Make registration flexible for legacy and optimized mode

rseq_register_current_thread() either uses the glibc registered RSEQ region
or registers it's own region with the legacy size of 32 bytes.

That worked so far, but becomes a problem when the kernel implements a
distinction between legacy and performance optimized behavior based on the
registration size as that does not allow to test both modes with the self
test suite.

Add two arguments to the function. One to enforce that the registration is
not using libc provided mode and one to tell the registration to use the
legacy size and not the kernel advertised size.

Rename it and make the original one a inline wrapper which preserves the
existing behavior.

Fixes: 566d8015f7ee ("rseq: Avoid CPU/MM CID updates when no event pending")
Signed-off-by: Thomas Gleixner <tglx@kernel.org>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Reviewed-by: Dmitry Vyukov <dvyukov@google.com>
Tested-by: Dmitry Vyukov <dvyukov@google.com>
Link: https://patch.msgid.link/20260428224427.677889423%40kernel.org
Cc: stable@vger.kernel.org
tools/testing/selftests/rseq/rseq-abi.h
tools/testing/selftests/rseq/rseq.c
tools/testing/selftests/rseq/rseq.h