Lines Matching +full:keep +full:- +full:a +full:- +full:live

1 /* SPDX-License-Identifier: GPL-2.0-or-later */
9 #include <asm/asm-offsets.h>
11 #include <asm/ppc-opcode.h>
21 * We arrive here after a function A calls function B, and we are the trace
22 * function for B. When we enter r1 points to A's stack frame, B has not yet
23 * had a chance to allocate one yet.
25 * Additionally r2 may point either to the TOC for A, or B, depending on
26 * whether B did a TOC setup sequence before calling us.
30 * call site in A.
32 * Our job is to save the register state into a struct pt_regs (on the stack)
36 /* Create a minimal stack frame for representing B */
37 PPC_STLU r1, -STACK_FRAME_MIN_SIZE(r1)
40 PPC_STLU r1,-SWITCH_FRAME_SIZE(r1)
51 PPC_LL r12, -(MCOUNT_INSN_SIZE*2 + SZL)(r11)
63 /* Save the previous LR in pt_regs->link */
65 /* Also save it in A's stack frame */
111 PPC_LL r5, -(MCOUNT_INSN_SIZE*2 + SZL)(r11)
158 * This allows reliable stack trace and the ftrace stack tracer to work as-is.
162 /* Calculate ip from nip-4 into r3 for call below */
166 /* Save NIP as pt_regs->nip */
212 bne- 1f
241 bne- livepatch_handler
250 * Return with blr to keep the link stack balanced. The function profiling sequence
325 * We get here when a function A, calls another function B, but B has
326 * been live patched with a new function C.
331 * - LR points back to the original caller (in A)
332 * - CTR holds the new NIP in C
333 * - r0, r11 & r12 are free
336 * - r0 points back to the original caller (in A)
337 * - LR holds the new NIP in C
338 * - r11 & r12 are free
351 std r12, -8(r11)
354 std r2, -24(r11)
357 std r12, -16(r11)
360 std r0, -16(r11)
369 * caller A. We are free to use r11, r12 and we can use r2 until we
380 ld r12, -8(r11)
382 EMIT_BUG_ENTRY 1b, __FILE__, __LINE__ - 1, 0
385 ld r12, -16(r11)
387 ld r2, -24(r11)
394 /* Return to original caller of live patched function */
412 std r4, -32(r1)
413 std r3, -24(r1)
415 std r2, -16(r1)
416 std r31, -8(r1)
418 stdu r1, -112(r1)
421 * We might be called from a module.
426 stwu r1, -16(r1)
439 ld r4, -32(r1)
440 ld r3, -24(r1)
441 ld r2, -16(r1)
442 ld r31, -8(r1)