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

From: Michael Ellerman
Date: Mon Oct 14 2024 - 05:35:11 EST


Steven Rostedt <rostedt@xxxxxxxxxxx> writes:
> From: Steven Rostedt <rostedt@xxxxxxxxxxx>
>
> Most architectures use pt_regs within ftrace_regs making a lot of the
> accessor functions just calls to the pt_regs internally. Instead of
> duplication this effort, use a HAVE_ARCH_FTRACE_REGS for architectures
> that have their own ftrace_regs that is not based on pt_regs and will
> define all the accessor functions, and for the architectures that just use
> pt_regs, it will leave it undefined, and the default accessor functions
> will be used.
>
> Note, this will also make it easier to add new accessor functions to
> ftrace_regs as it will mean having to touch less architectures.
>
> Cc: <linux-arch@xxxxxxxxxxxxxxx>
> Cc: "x86@xxxxxxxxxx" <x86@xxxxxxxxxx>
> Cc: Mathieu Desnoyers <mathieu.desnoyers@xxxxxxxxxxxx>
> Cc: Mark Rutland <mark.rutland@xxxxxxx>
> Cc: Will Deacon <will@xxxxxxxxxx>
> Cc: Huacai Chen <chenhuacai@xxxxxxxxxx>
> Cc: WANG Xuerui <kernel@xxxxxxxxxx>
> Cc: Michael Ellerman <mpe@xxxxxxxxxxxxxx>
> Cc: Nicholas Piggin <npiggin@xxxxxxxxx>
> Cc: Christophe Leroy <christophe.leroy@xxxxxxxxxx>
> Cc: Naveen N Rao <naveen@xxxxxxxxxx>
> Cc: Madhavan Srinivasan <maddy@xxxxxxxxxxxxx>
> Cc: Paul Walmsley <paul.walmsley@xxxxxxxxxx>
> Cc: Palmer Dabbelt <palmer@xxxxxxxxxxx>
> Cc: Albert Ou <aou@xxxxxxxxxxxxxxxxx>
> Cc: Heiko Carstens <hca@xxxxxxxxxxxxx>
> Cc: Vasily Gorbik <gor@xxxxxxxxxxxxx>
> Cc: Alexander Gordeev <agordeev@xxxxxxxxxxxxx>
> Cc: Christian Borntraeger <borntraeger@xxxxxxxxxxxxx>
> Cc: Sven Schnelle <svens@xxxxxxxxxxxxx>
> Cc: Thomas Gleixner <tglx@xxxxxxxxxxxxx>
> Cc: Ingo Molnar <mingo@xxxxxxxxxx>
> Cc: Borislav Petkov <bp@xxxxxxxxx>
> Cc: Dave Hansen <dave.hansen@xxxxxxxxxxxxxxx>
> Link: https://lore.kernel.org/20241010202114.2289f6fd@xxxxxxxxxxxxxxxxxx
> Acked-by: Masami Hiramatsu (Google) <mhiramat@xxxxxxxxxx>
> Acked-by: Heiko Carstens <hca@xxxxxxxxxxxxx> # s390
> Acked-by: Catalin Marinas <catalin.marinas@xxxxxxx>
> Suggested-by: Masami Hiramatsu (Google) <mhiramat@xxxxxxxxxx>
> Signed-off-by: Steven Rostedt (Google) <rostedt@xxxxxxxxxxx>
> ---
> arch/arm64/include/asm/ftrace.h | 1 +
> arch/loongarch/include/asm/ftrace.h | 25 +-------------------
> arch/powerpc/include/asm/ftrace.h | 26 +--------------------

Acked-by: Michael Ellerman <mpe@xxxxxxxxxxxxxx> (powerpc)

cheers

> arch/riscv/include/asm/ftrace.h | 1 +
> arch/s390/include/asm/ftrace.h | 26 +--------------------
> arch/x86/include/asm/ftrace.h | 21 +----------------
> include/linux/ftrace.h | 32 ++++++-------------------
> include/linux/ftrace_regs.h | 36 +++++++++++++++++++++++++++++
> 8 files changed, 49 insertions(+), 119 deletions(-)
> create mode 100644 include/linux/ftrace_regs.h