summaryrefslogtreecommitdiff
path: root/arch/powerpc/kernel/entry_64.S
diff options
context:
space:
mode:
authorMichael Ellerman <mpe@ellerman.id.au>2017-04-24 17:24:04 +0300
committerMichael Ellerman <mpe@ellerman.id.au>2017-04-24 17:24:04 +0300
commit9fc849144c80091252551a4897782ed5321d654a (patch)
tree0af5b9f46ee5a79a6abe64ee63eea12f2a99fdbb /arch/powerpc/kernel/entry_64.S
parent9a914aa6824ac5d5fd3195ed422f31540a0ab767 (diff)
parent24bd909e94776ecce95291bff910f14c78ac4a43 (diff)
downloadlinux-9fc849144c80091252551a4897782ed5321d654a.tar.xz
Merge branch 'topic/kprobes' into next
Although most of these kprobes patches are powerpc specific, there's a couple that touch generic code (with Acks). At the moment there's one conflict with acme's tree, but it's not too bad. Still just in case some other conflicts show up, we've put these in a topic branch so another tree could merge some or all of it if necessary.
Diffstat (limited to 'arch/powerpc/kernel/entry_64.S')
-rw-r--r--arch/powerpc/kernel/entry_64.S13
1 files changed, 7 insertions, 6 deletions
diff --git a/arch/powerpc/kernel/entry_64.S b/arch/powerpc/kernel/entry_64.S
index cb3fb98a5785..70a5c1948b05 100644
--- a/arch/powerpc/kernel/entry_64.S
+++ b/arch/powerpc/kernel/entry_64.S
@@ -1248,9 +1248,10 @@ _GLOBAL(ftrace_caller)
/* Get the _mcount() call site out of LR */
mflr r7
- /* Save it as pt_regs->nip & pt_regs->link */
+ /* Save it as pt_regs->nip */
std r7, _NIP(r1)
- std r7, _LINK(r1)
+ /* Save the read LR in pt_regs->link */
+ std r0, _LINK(r1)
/* Save callee's TOC in the ABI compliant location */
std r2, 24(r1)
@@ -1297,16 +1298,16 @@ ftrace_call:
REST_8GPRS(16,r1)
REST_8GPRS(24,r1)
+ /* Restore possibly modified LR */
+ ld r0, _LINK(r1)
+ mtlr r0
+
/* Restore callee's TOC */
ld r2, 24(r1)
/* Pop our stack frame */
addi r1, r1, SWITCH_FRAME_SIZE
- /* Restore original LR for return to B */
- ld r0, LRSAVE(r1)
- mtlr r0
-
#ifdef CONFIG_LIVEPATCH
/* Based on the cmpd above, if the NIP was altered handle livepatch */
bne- livepatch_handler