Skip to content

Commit 4b3338a

Browse files
rnavmpe
authored andcommitted
powerpc/ftrace: Fix stack teardown in ftrace_no_trace
Commit 41a506e ("powerpc/ftrace: Create a dummy stackframe to fix stack unwind") added use of a new stack frame on ftrace entry to fix stack unwind. However, the commit missed updating the offset used while tearing down the ftrace stack when ftrace is disabled. Fix the same. In addition, the commit missed saving the correct stack pointer in pt_regs. Update the same. Fixes: 41a506e ("powerpc/ftrace: Create a dummy stackframe to fix stack unwind") Cc: [email protected] # v6.5+ Signed-off-by: Naveen N Rao <[email protected]> Signed-off-by: Michael Ellerman <[email protected]> Link: https://msgid.link/[email protected]
1 parent dc158d2 commit 4b3338a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

arch/powerpc/kernel/trace/ftrace_entry.S

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@
6262
.endif
6363

6464
/* Save previous stack pointer (r1) */
65-
addi r8, r1, SWITCH_FRAME_SIZE
65+
addi r8, r1, SWITCH_FRAME_SIZE+STACK_FRAME_MIN_SIZE
6666
PPC_STL r8, GPR1(r1)
6767

6868
.if \allregs == 1
@@ -182,7 +182,7 @@ ftrace_no_trace:
182182
mflr r3
183183
mtctr r3
184184
REST_GPR(3, r1)
185-
addi r1, r1, SWITCH_FRAME_SIZE
185+
addi r1, r1, SWITCH_FRAME_SIZE+STACK_FRAME_MIN_SIZE
186186
mtlr r0
187187
bctr
188188
#endif

0 commit comments

Comments
 (0)