]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
rseq: Make exit debugging static branch based
authorThomas Gleixner <tglx@linutronix.de>
Mon, 27 Oct 2025 08:45:02 +0000 (09:45 +0100)
committerIngo Molnar <mingo@kernel.org>
Tue, 4 Nov 2025 07:33:20 +0000 (08:33 +0100)
Disconnect it from the config switch and use the static debug branch. This
is a temporary measure for validating the rework. At the end this check
needs to be hidden behind lockdep as it has nothing to do with the other
debug infrastructure, which mainly aids user space debugging by enabling a
zoo of checks which terminate misbehaving tasks instead of letting them
keep the hard to diagnose pieces.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Reviewed-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Link: https://patch.msgid.link/20251027084307.272660745@linutronix.de
include/linux/rseq_entry.h

index f9510ce722115d32910cf5d8c3cc5c2c0ccccffd..5bdcf5b5f5958ce89c9f2406d6a00dd07db27530 100644 (file)
@@ -285,7 +285,7 @@ static __always_inline void rseq_exit_to_user_mode(void)
 
        rseq_stat_inc(rseq_stats.exit);
 
-       if (IS_ENABLED(CONFIG_DEBUG_RSEQ))
+       if (static_branch_unlikely(&rseq_debug_enabled))
                WARN_ON_ONCE(ev->sched_switch);
 
        /*