From: Thomas Gleixner Date: Mon, 27 Oct 2025 08:45:02 +0000 (+0100) Subject: rseq: Make exit debugging static branch based X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=c1cbad8f99b5c73c6af6e96acbfa64eaaaeb085f;p=thirdparty%2Fkernel%2Flinux.git rseq: Make exit debugging static branch based 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 Signed-off-by: Peter Zijlstra (Intel) Signed-off-by: Ingo Molnar Reviewed-by: Mathieu Desnoyers Link: https://patch.msgid.link/20251027084307.272660745@linutronix.de --- diff --git a/include/linux/rseq_entry.h b/include/linux/rseq_entry.h index f9510ce722115..5bdcf5b5f5958 100644 --- a/include/linux/rseq_entry.h +++ b/include/linux/rseq_entry.h @@ -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); /*