Skip to content

Commit

Permalink
ftrace/x86-64: Allow to change RIP in handlers
Browse files Browse the repository at this point in the history
Allow ftrace handlers to change RIP register (regs->ip)
in handlers. This will allow handlers to call another
function instead of original function.

Link: http://lkml.kernel.org/r/[email protected]

Cc: Peter Zijlstra <[email protected]>
Cc: Frederic Weisbecker <[email protected]>
Cc: Thomas Gleixner <[email protected]>
Cc: "H. Peter Anvin" <[email protected]>
Signed-off-by: Masami Hiramatsu <[email protected]>
Signed-off-by: Steven Rostedt <[email protected]>
  • Loading branch information
rostedt committed Sep 14, 2012
1 parent 4b036d5 commit 47d5a5f
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions arch/x86/kernel/entry_64.S
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,10 @@ GLOBAL(ftrace_regs_call)
movq EFLAGS(%rsp), %rax
movq %rax, SS(%rsp)

/* Handlers can change the RIP */
movq RIP(%rsp), %rax
movq %rax, SS+8(%rsp)

/* restore the rest of pt_regs */
movq R15(%rsp), %r15
movq R14(%rsp), %r14
Expand Down

0 comments on commit 47d5a5f

Please sign in to comment.