All of lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Josef Bacik" <josef@toxicpanda.com>
Cc: bpf@vger.kernel.org, linux-trace-kernel@vger.kernel.org
Subject: Re: [PATCH RFC 09/13] arm64: ftrace: Maintain Tasks RCU trampoline nesting in ftrace_caller
Date: Thu, 10 Sep 2026 19:04:36 +0000	[thread overview]
Message-ID: <20260910190436.EBE3A1F000FF@smtp.kernel.org> (raw)
In-Reply-To: <20260910-b4-rcu-tasks-preempt-qs-v1-9-d4469f4cc101@toxicpanda.com>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Low] Build failure due to missing `ftrace_static_tramp_end` symbol when `CONFIG_DYNAMIC_FTRACE_WITH_ARGS` is disabled.
--

commit 459a25e6b720c08167da420eb83180b2856610e3
Author: Josef Bacik <josef@toxicpanda.com>

    arm64: ftrace: Maintain Tasks RCU trampoline nesting in ftrace_caller
    
    Bracket the call out to the ftrace_ops callback in ftrace_caller with an
    increment/decrement of current->rcu_tramp_nesting, using x12/w13 which
    are scratch there.  The read-modify-write is not atomic, but only current
    modifies the count and every interrupting user is balanced, so nothing is
    lost.

> diff --git a/arch/arm64/kernel/entry-ftrace.S b/arch/arm64/kernel/entry-ftrace.S
> index 025140caafe74..46a102e7199ac 100644
> --- a/arch/arm64/kernel/entry-ftrace.S
> +++ b/arch/arm64/kernel/entry-ftrace.S
> @@ -14,6 +14,33 @@
>  #include <asm/insn.h>
>  
>  #ifdef CONFIG_DYNAMIC_FTRACE_WITH_ARGS

[ ... ]

> @@ -178,6 +209,10 @@ SYM_CODE_START(ftrace_stub_direct_tramp)
>  SYM_CODE_END(ftrace_stub_direct_tramp)
>  #endif /* CONFIG_DYNAMIC_FTRACE_WITH_DIRECT_CALLS */
>  
> +/* End of [ftrace_caller, ...) for arch_rcu_tasks_ip_in_trampoline(). */
> +SYM_CODE_START(ftrace_static_tramp_end)
> +SYM_CODE_END(ftrace_static_tramp_end)
> +
>  #else /* CONFIG_DYNAMIC_FTRACE_WITH_ARGS */
>  
>  /*

[Severity: Low]
Will this cause a linker error when compiling with
CONFIG_RCU_TASKS_PREEMPT_QS=y but CONFIG_DYNAMIC_FTRACE_WITH_ARGS=n?

The ftrace_static_tramp_end label is defined here exclusively inside the
CONFIG_DYNAMIC_FTRACE_WITH_ARGS block. The legacy mcount-based ftrace path
in the #else block lacks this definition.

> diff --git a/arch/arm64/kernel/ftrace.c b/arch/arm64/kernel/ftrace.c
> index e1a3c0b3a0514..1b7ac2afed0df 100644
> --- a/arch/arm64/kernel/ftrace.c
> +++ b/arch/arm64/kernel/ftrace.c
> @@ -17,6 +17,22 @@
>  #include <asm/insn.h>
>  #include <asm/text-patching.h>
>  
> +#ifdef CONFIG_RCU_TASKS_PREEMPT_QS
> +extern void ftrace_static_tramp_end(void);
> +
> +/*
> + * See rcu_tasks_ip_in_trampoline().  ftrace_caller and ftrace_stub_direct_tramp
> + * are core kernel text but must be treated as trampolines: a task preempted in
> + * them may be carrying an ops pointer (x11) or a direct-call BPF trampoline
> + * address (x17) whose lifetime is guarded only by Tasks RCU.
> + */
> +bool arch_rcu_tasks_ip_in_trampoline(unsigned long ip)
> +{
> +	return ip >= (unsigned long)ftrace_caller &&
> +	       ip <  (unsigned long)ftrace_static_tramp_end;
> +}
> +#endif

[Severity: Low]
Since arch_rcu_tasks_ip_in_trampoline() unconditionally references
ftrace_static_tramp_end here under CONFIG_RCU_TASKS_PREEMPT_QS, this might
lead to an undefined reference at link time if CONFIG_DYNAMIC_FTRACE_WITH_ARGS
is disabled.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260910-b4-rcu-tasks-preempt-qs-v1-0-d4469f4cc101@toxicpanda.com?part=9

  reply	other threads:[~2026-09-10 19:04 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-10 18:50 [PATCH RFC 00/13] rcu-tasks: let preemption outside trampolines be a quiescent state Josef Bacik
2026-09-10 18:50 ` [PATCH RFC 01/13] rcu-tasks: Add per-task trampoline nesting count Josef Bacik
2026-09-10 18:50 ` [PATCH RFC 02/13] entry: Pass pt_regs to irqentry_exit_cond_resched() Josef Bacik
2026-09-10 18:50 ` [PATCH RFC 03/13] rcu-tasks: Hold trampoline nesting across irq-exit preemption in trampoline text Josef Bacik
2026-09-10 18:50 ` [PATCH RFC 04/13] kprobes: Let Tasks RCU recognise tasks preempted in an optprobe jump window Josef Bacik
2026-09-10 19:16   ` sashiko-bot
2026-09-10 22:46     ` Josef Bacik
2026-09-10 18:50 ` [PATCH RFC 05/13] ftrace: Mark modules hosting direct-call trampolines for Tasks RCU Josef Bacik
2026-09-10 18:50 ` [PATCH RFC 06/13] x86/ftrace: Maintain Tasks RCU trampoline nesting in ftrace_caller Josef Bacik
2026-09-10 18:50 ` [PATCH RFC 07/13] x86/kprobes: Maintain Tasks RCU trampoline nesting in the optprobe template Josef Bacik
2026-09-10 18:50 ` [PATCH RFC 08/13] bpf, x86: Maintain Tasks RCU trampoline nesting in the BPF trampoline Josef Bacik
2026-09-10 18:50 ` [PATCH RFC 09/13] arm64: ftrace: Maintain Tasks RCU trampoline nesting in ftrace_caller Josef Bacik
2026-09-10 19:04   ` sashiko-bot [this message]
2026-09-10 22:46     ` Josef Bacik
2026-09-10 18:50 ` [PATCH RFC 10/13] bpf, arm64: Maintain Tasks RCU trampoline nesting in the BPF trampoline Josef Bacik
2026-09-10 18:50 ` [PATCH RFC 11/13] samples: ftrace: Maintain Tasks RCU trampoline nesting in direct-call trampolines Josef Bacik
2026-09-10 18:50 ` [PATCH RFC 12/13] rcutorture: Bracket Tasks RCU readers with trampoline nesting Josef Bacik
2026-09-10 18:50 ` [PATCH RFC 13/13] rcu-tasks: Treat preemption outside trampolines as a quiescent state Josef Bacik
2026-09-10 19:44 ` [PATCH RFC 00/13] rcu-tasks: let preemption outside trampolines be " Steven Rostedt
2026-09-10 22:59   ` Paul E. McKenney

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260910190436.EBE3A1F000FF@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=josef@toxicpanda.com \
    --cc=linux-trace-kernel@vger.kernel.org \
    --cc=sashiko-reviews@lists.linux.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.