From: Heiko Carstens Date: Mon, 4 Oct 2021 14:16:45 +0000 (+0200) Subject: s390/ftrace: add ftrace_instruction_pointer_set() helper function X-Git-Tag: v5.16-rc1~104^2~37 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=176510ebecd1ca201a8808dbbee9991eca005207;p=thirdparty%2Flinux.git s390/ftrace: add ftrace_instruction_pointer_set() helper function Add ftrace_instruction_pointer_set() helper function to match x86. See commit 2860cd8a2353 ("livepatch: Use the default ftrace_ops instead of REGS when ARGS is available"). Signed-off-by: Heiko Carstens Signed-off-by: Vasily Gorbik --- diff --git a/arch/s390/include/asm/ftrace.h b/arch/s390/include/asm/ftrace.h index 98c066cb347fa..3baceb4a7d3c2 100644 --- a/arch/s390/include/asm/ftrace.h +++ b/arch/s390/include/asm/ftrace.h @@ -51,6 +51,14 @@ static __always_inline struct pt_regs *arch_ftrace_get_regs(struct ftrace_regs * return &fregs->regs; } +static __always_inline void ftrace_instruction_pointer_set(struct ftrace_regs *fregs, + unsigned long ip) +{ + struct pt_regs *regs = arch_ftrace_get_regs(fregs); + + regs->psw.addr = ip; +} + /* * Even though the system call numbers are identical for s390/s390x a * different system call table is used for compat tasks. This may lead diff --git a/arch/s390/include/asm/livepatch.h b/arch/s390/include/asm/livepatch.h index d578a8c766765..5209f223331a9 100644 --- a/arch/s390/include/asm/livepatch.h +++ b/arch/s390/include/asm/livepatch.h @@ -16,9 +16,7 @@ static inline void klp_arch_set_pc(struct ftrace_regs *fregs, unsigned long ip) { - struct pt_regs *regs = ftrace_get_regs(fregs); - - regs->psw.addr = ip; + ftrace_instruction_pointer_set(fregs, ip); } #endif