[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <871pmlv2x6.ffs@tglx>
Date: Wed, 29 Oct 2025 22:00:37 +0100
From: Thomas Gleixner <tglx@...utronix.de>
To: Steven Rostedt <rostedt@...dmis.org>
Cc: LKML <linux-kernel@...r.kernel.org>, Michael Jeanson
 <mjeanson@...icios.com>, Jens Axboe <axboe@...nel.dk>, Mathieu Desnoyers
 <mathieu.desnoyers@...icios.com>, Peter Zijlstra <peterz@...radead.org>,
 "Paul E. McKenney" <paulmck@...nel.org>, x86@...nel.org, Sean
 Christopherson <seanjc@...gle.com>, Wei Liu <wei.liu@...nel.org>
Subject: Re: [patch V6 19/31] rseq: Provide and use rseq_update_user_cs()
On Wed, Oct 29 2025 at 12:04, Steven Rostedt wrote:
>> +bool rseq_debug_update_user_cs(struct task_struct *t, struct pt_regs *regs, unsigned long csaddr);
>
> So rseq_debug_update_user_cs() is always declared.
And?
>> +#ifdef RSEQ_BUILD_SLOW_PATH
>
> But the function is only defined if RSEQ_BUILD_SLOW_PATH is defined.
Right.
>
> There's no:
>
> #else
>
> bool rseq_debug_update_user_cs(struct task_struct *t, struct pt_regs *regs,
> 			       unsigned long csaddr)
> {
> 	return false;
> }
And why would you need that?
>> +	if (static_branch_unlikely(&rseq_debug_enabled))
>> +		return rseq_debug_update_user_cs(t, regs, csaddr);
>
> Wouldn't the above reference to rseq_debug_update_user_cs() fail to build
> if RSEQ_BUILD_SLOW_PATH is not defined?
>
> Or am I missing something?
Yes. None of this is compiled at all when CONFIG_RSEQ=n.
When CONFIG_RSEQ=y then the slowpath muck is compiled into kernel/rseq.c
because that file defines RSEQ_BUILD_SLOW_PATH.
> I see that it looks like RSEQ_BUILD_SLOW_PATH is always defined, but why
> have this logic if it can't be not defined?
The fastpath inline version is compiled into the entry code and that
does not define RSEQ_BUILD_SLOW_PATH and therefore needs the
unconditional forward declaration of the debug function.
I made it this way because I wanted to keep the debug and non-debug
version next to each other as it's simpler that way to keep them in sync
instead of forgetting about the other variant because it's in a
different file.
Thanks,
        tglx
Powered by blists - more mailing lists
 
