Skip to content

Commit

Permalink
s390/ftrace: add ftrace_instruction_pointer_set() helper function
Browse files Browse the repository at this point in the history
Add ftrace_instruction_pointer_set() helper function to match x86.
See commit 2860cd8 ("livepatch: Use the default ftrace_ops
instead of REGS when ARGS is available").

Signed-off-by: Heiko Carstens <[email protected]>
Signed-off-by: Vasily Gorbik <[email protected]>
  • Loading branch information
hcahca authored and Vasily Gorbik committed Oct 11, 2021
1 parent 5740a7c commit 176510e
Showing 2 changed files with 9 additions and 3 deletions.
8 changes: 8 additions & 0 deletions arch/s390/include/asm/ftrace.h
Original file line number Diff line number Diff line change
@@ -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
4 changes: 1 addition & 3 deletions arch/s390/include/asm/livepatch.h
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 176510e

Please sign in to comment.