Re: [for-next][PATCH 4/4] ftrace: Consolidate ftrace_regs accessor functions for archs using pt_regs

From: Google
Date: Mon Oct 14 2024 - 19:54:48 EST


Hi Steve,

I found one problem on this patch while debugging my series;

On Fri, 11 Oct 2024 09:29:45 -0400
Steven Rostedt <rostedt@xxxxxxxxxxx> wrote:

> -#define ftrace_regs_get_argument(fregs, n) \
> - regs_get_kernel_argument(&arch_ftrace_regs(fregs)->regs, n)

As you can seem most arch uses "arch_ftrace_regs()" macro
for ftrace_regs_*() macros. This is because we are sure
this ftrace_regs is not fully compatible with pt_regs.


> +#define ftrace_regs_get_instruction_pointer(fregs) \
> + instruction_pointer(arch_ftrace_get_regs(fregs))

However, these consolidated macros in ftrace_regs.h are
using "arch_ftrace_get_regs()" macro, which can return NULL
if FL_SAVE_REGS is not set.

So, those should use arch_ftrace_regs() as original code
does.

Thank you,

--
Masami Hiramatsu (Google) <mhiramat@xxxxxxxxxx>