powerpc/ftrace: Also save r1 in ftrace_caller()

Also save r1 in ftrace_caller()

r1 is needed during unwinding when the function_graph tracer
is active.

Fixes: 830213786c ("powerpc/ftrace: directly call of function graph tracer by ftrace caller")
Reported-by: Naveen N. Rao <naveen.n.rao@linux.vnet.ibm.com>
Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/ff535e86d3a69376a6d89168511d4e403835f18b.1644949750.git.christophe.leroy@csgroup.eu
This commit is contained in:
Christophe Leroy 2022-02-15 19:31:22 +01:00 committed by Michael Ellerman
parent cb7356986d
commit 34d8dac807
1 changed files with 4 additions and 0 deletions

View File

@ -173,6 +173,10 @@ _GLOBAL(ftrace_caller)
beq ftrace_no_trace beq ftrace_no_trace
#endif #endif
/* Save previous stack pointer (r1) */
addi r8, r1, SWITCH_FRAME_SIZE
PPC_STL r8, GPR1(r1)
/* Get the _mcount() call site out of LR */ /* Get the _mcount() call site out of LR */
mflr r7 mflr r7
PPC_STL r7, _NIP(r1) PPC_STL r7, _NIP(r1)