summaryrefslogtreecommitdiffstats
path: root/arch/powerpc
diff options
context:
space:
mode:
authorNaveen N Rao <naveen@kernel.org>2023-11-30 12:29:47 +0530
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2023-12-20 17:00:14 +0100
commit1c077acf246c4400df0b9be94aa88650bc31a137 (patch)
treec51e55303b28184ae3c5adfc25bf5e84d8913cbb /arch/powerpc
parent34ae53cccf535063b20f743b178603ae3ba31a99 (diff)
downloadlinux-stable-1c077acf246c4400df0b9be94aa88650bc31a137.tar.gz
linux-stable-1c077acf246c4400df0b9be94aa88650bc31a137.tar.bz2
linux-stable-1c077acf246c4400df0b9be94aa88650bc31a137.zip
powerpc/ftrace: Fix stack teardown in ftrace_no_trace
[ Upstream commit 4b3338aaa74d7d4ec5b6734dc298f0db94ec83d2 ] Commit 41a506ef71eb ("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: 41a506ef71eb ("powerpc/ftrace: Create a dummy stackframe to fix stack unwind") Cc: stable@vger.kernel.org # v6.5+ Signed-off-by: Naveen N Rao <naveen@kernel.org> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au> Link: https://msgid.link/20231130065947.2188860-1-naveen@kernel.org Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'arch/powerpc')
-rw-r--r--arch/powerpc/kernel/trace/ftrace_mprofile.S4
1 files changed, 2 insertions, 2 deletions
diff --git a/arch/powerpc/kernel/trace/ftrace_mprofile.S b/arch/powerpc/kernel/trace/ftrace_mprofile.S
index 6f9c2dea905b..f4a72b38488f 100644
--- a/arch/powerpc/kernel/trace/ftrace_mprofile.S
+++ b/arch/powerpc/kernel/trace/ftrace_mprofile.S
@@ -62,7 +62,7 @@
.endif
/* Save previous stack pointer (r1) */
- addi r8, r1, SWITCH_FRAME_SIZE
+ addi r8, r1, SWITCH_FRAME_SIZE+STACK_FRAME_MIN_SIZE
PPC_STL r8, GPR1(r1)
.if \allregs == 1
@@ -182,7 +182,7 @@ ftrace_no_trace:
mflr r3
mtctr r3
REST_GPR(3, r1)
- addi r1, r1, SWITCH_FRAME_SIZE
+ addi r1, r1, SWITCH_FRAME_SIZE+STACK_FRAME_MIN_SIZE
mtlr r0
bctr
#endif