On Mon, 28 Oct 2024 15:25:13 +0000
Will Deacon <[email protected]> wrote:

> On Sat, Oct 26, 2024 at 01:35:30PM +0900, Masami Hiramatsu (Google) wrote:
> > From: Masami Hiramatsu (Google) <[email protected]>
> > 
> > Pass ftrace_regs to the fgraph_ops::entryfunc(). If ftrace_regs is not
> > available, it passes a NULL instead. User callback function can access
> > some registers (including return address) via this ftrace_regs.
> > 
> > Note that the ftrace_regs can be NULL when the arch does NOT define:
> > HAVE_DYNAMIC_FTRACE_WITH_ARGS or HAVE_DYNAMIC_FTRACE_WITH_REGS.
> > More specifically, if HAVE_DYNAMIC_FTRACE_WITH_REGS is defined but
> > not the HAVE_DYNAMIC_FTRACE_WITH_ARGS, and the ftrace ops used to
> > register the function callback does not set FTRACE_OPS_FL_SAVE_REGS.
> > In this case, ftrace_regs can be NULL in user callback.
> > 
> > Signed-off-by: Masami Hiramatsu (Google) <[email protected]>
> > Cc: Steven Rostedt <[email protected]>
> > Cc: Mark Rutland <[email protected]>
> > Cc: Catalin Marinas <[email protected]>
> > Cc: Will Deacon <[email protected]>
> > Cc: Huacai Chen <[email protected]>
> > Cc: WANG Xuerui <[email protected]>
> > Cc: Michael Ellerman <[email protected]>
> > Cc: Nicholas Piggin <[email protected]>
> > Cc: Christophe Leroy <[email protected]>
> > Cc: Naveen N Rao <[email protected]>
> > Cc: Madhavan Srinivasan <[email protected]>
> > Cc: Paul Walmsley <[email protected]>
> > Cc: Palmer Dabbelt <[email protected]>
> > Cc: Albert Ou <[email protected]>
> > Cc: Thomas Gleixner <[email protected]>
> > Cc: Ingo Molnar <[email protected]>
> > Cc: Borislav Petkov <[email protected]>
> > Cc: Dave Hansen <[email protected]>
> > Cc: [email protected]
> > Cc: "H. Peter Anvin" <[email protected]>
> > Cc: Mathieu Desnoyers <[email protected]>
> > 
> > ---
> >  Changes in v18:
> >   - Remove unclear comment about `regs->fp` access on arm64.
> >  Changes in v16:
> >   - Add a note when the ftrace_regs can be NULL.
> >   - Update against for the latest kernel.
> >  Changes in v11:
> >   - Update for the latest for-next branch.
> >  Changes in v8:
> >   - Just pass ftrace_regs to the handler instead of adding a new
> >     entryregfunc.
> >   - Update riscv ftrace_graph_func().
> >  Changes in v3:
> >   - Update for new multiple fgraph.
> > ---
> >  arch/arm64/kernel/ftrace.c               |   15 ++++++++-
> 
> For the arm64 bits:
> 
> Acked-by: Will Deacon <[email protected]>
> 

Thank you for ack for arm64!

> Will


-- 
Masami Hiramatsu (Google) <[email protected]>

Reply via email to