[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20240524103754.1df43a670eeb15bca9df48c7@kernel.org>
Date: Fri, 24 May 2024 10:37:54 +0900
From: Masami Hiramatsu (Google) <mhiramat@...nel.org>
To: Steven Rostedt <rostedt@...dmis.org>
Cc: Alexei Starovoitov <alexei.starovoitov@...il.com>, Florent Revest
<revest@...omium.org>, linux-trace-kernel@...r.kernel.org, LKML
<linux-kernel@...r.kernel.org>, Martin KaFai Lau <martin.lau@...ux.dev>,
bpf <bpf@...r.kernel.org>, Sven Schnelle <svens@...ux.ibm.com>, Alexei
Starovoitov <ast@...nel.org>, Jiri Olsa <jolsa@...nel.org>, Arnaldo
Carvalho de Melo <acme@...nel.org>, Daniel Borkmann <daniel@...earbox.net>,
Alan Maguire <alan.maguire@...cle.com>, Mark Rutland
<mark.rutland@....com>, Peter Zijlstra <peterz@...radead.org>, Thomas
Gleixner <tglx@...utronix.de>, Guo Ren <guoren@...nel.org>
Subject: Re: [PATCH v10 03/36] x86: tracing: Add ftrace_regs definition in
the header
On Thu, 23 May 2024 19:14:59 -0400
Steven Rostedt <rostedt@...dmis.org> wrote:
> On Tue, 7 May 2024 23:08:35 +0900
> "Masami Hiramatsu (Google)" <mhiramat@...nel.org> wrote:
>
> > From: Masami Hiramatsu (Google) <mhiramat@...nel.org>
> >
> > Add ftrace_regs definition for x86_64 in the ftrace header to
> > clarify what register will be accessible from ftrace_regs.
> >
> > Signed-off-by: Masami Hiramatsu (Google) <mhiramat@...nel.org>
> > ---
> > Changes in v3:
> > - Add rip to be saved.
> > Changes in v2:
> > - Newly added.
> > ---
> > arch/x86/include/asm/ftrace.h | 6 ++++++
> > 1 file changed, 6 insertions(+)
> >
> > diff --git a/arch/x86/include/asm/ftrace.h b/arch/x86/include/asm/ftrace.h
> > index cf88cc8cc74d..c88bf47f46da 100644
> > --- a/arch/x86/include/asm/ftrace.h
> > +++ b/arch/x86/include/asm/ftrace.h
> > @@ -36,6 +36,12 @@ static inline unsigned long ftrace_call_adjust(unsigned long addr)
> >
> > #ifdef CONFIG_HAVE_DYNAMIC_FTRACE_WITH_ARGS
> > struct ftrace_regs {
> > + /*
> > + * On the x86_64, the ftrace_regs saves;
> > + * rax, rcx, rdx, rdi, rsi, r8, r9, rbp, rip and rsp.
> > + * Also orig_ax is used for passing direct trampoline address.
> > + * x86_32 doesn't support ftrace_regs.
>
> Should add a comment that if fregs->regs.cs is set, then all of the pt_regs
> is valid.
But what about rbx and r1*? Only regs->cs should be care for pt_regs?
Or, did you mean "the ftrace_regs is valid"?
> And x86_32 does support ftrace_regs, it just doesn't support
> having a subset of it.
Oh, thanks. I'll update the comment about x86_32.
Thank you,
>
> -- Steve
>
>
> > + */
> > struct pt_regs regs;
> > };
> >
>
>
--
Masami Hiramatsu (Google) <mhiramat@...nel.org>
Powered by blists - more mailing lists