summaryrefslogtreecommitdiffstats
path: root/arch/powerpc/kernel/entry_64.S
diff options
context:
space:
mode:
authorAnton Blanchard2014-09-17 09:07:04 +0200
committerMichael Ellerman2014-11-09 23:59:28 +0100
commitb3c18725a0eb7ea2458e9ae3b7e5a477f52e361f (patch)
treefaecb26b2ba42de9abe84471f02d8230f81a2b06 /arch/powerpc/kernel/entry_64.S
parentpowerpc/ftrace: Remove mod_return_to_handler (diff)
downloadkernel-qcow2-linux-b3c18725a0eb7ea2458e9ae3b7e5a477f52e361f.tar.gz
kernel-qcow2-linux-b3c18725a0eb7ea2458e9ae3b7e5a477f52e361f.tar.xz
kernel-qcow2-linux-b3c18725a0eb7ea2458e9ae3b7e5a477f52e361f.zip
powerpc/ftrace: simplify prepare_ftrace_return
Instead of passing in the stack address of the link register to be modified, just pass in the old value and return the new value and rely on ftrace_graph_caller to do the modification. This removes the exception handling around the stack update - it isn't needed and we weren't consistent about it. Later on we would do an unprotected modification: if (!ftrace_graph_entry(&trace)) { *parent = old; Signed-off-by: Anton Blanchard <anton@samba.org> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Diffstat (limited to 'arch/powerpc/kernel/entry_64.S')
-rw-r--r--arch/powerpc/kernel/entry_64.S11
1 files changed, 9 insertions, 2 deletions
diff --git a/arch/powerpc/kernel/entry_64.S b/arch/powerpc/kernel/entry_64.S
index 66f7ed32848f..194e46dcf08d 100644
--- a/arch/powerpc/kernel/entry_64.S
+++ b/arch/powerpc/kernel/entry_64.S
@@ -1227,13 +1227,20 @@ _GLOBAL(ftrace_graph_caller)
ld r4, 128(r1)
subi r4, r4, MCOUNT_INSN_SIZE
- /* get the parent address */
+ /* Grab the LR out of the caller stack frame */
ld r11, 112(r1)
- addi r3, r11, 16
+ ld r3, 16(r11)
bl prepare_ftrace_return
nop
+ /*
+ * prepare_ftrace_return gives us the address we divert to.
+ * Change the LR in the callers stack frame to this.
+ */
+ ld r11, 112(r1)
+ std r3, 16(r11)
+
ld r0, 128(r1)
mtlr r0
addi r1, r1, 112