[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <163369614818.636038.5019945597127474028.stgit@devnote2>
Date: Fri, 8 Oct 2021 21:29:08 +0900
From: Masami Hiramatsu <mhiramat@...nel.org>
To: Steven Rostedt <rostedt@...dmis.org>
Cc: "Naveen N . Rao" <naveen.n.rao@...ux.vnet.ibm.com>,
Ananth N Mavinakayanahalli <ananth@...ux.ibm.com>,
Ingo Molnar <mingo@...nel.org>, linux-kernel@...r.kernel.org,
mhiramat@...nel.org, Sven Schnelle <svens@...ux.ibm.com>,
Catalin Marinas <catalin.marinas@....com>,
Will Deacon <will@...nel.org>,
Russell King <linux@...linux.org.uk>,
Nathan Chancellor <nathan@...nel.org>,
Nick Desaulniers <ndesaulniers@...gle.com>,
linux-arm-kernel@...ts.infradead.org
Subject: [PATCH 6/8] ARM: clang: Do not relay on lr register for stacktrace
Currently the stacktrace on clang compiled arm kernel uses the 'lr'
register to find the first frame address from pt_regs. However, that
is wrong after calling another function, because the 'lr' register
is used by 'bl' instruction and never be recovered.
As same as gcc arm kernel, directly use the frame pointer (x11) of
the pt_regs to find the first frame address.
Signed-off-by: Masami Hiramatsu <mhiramat@...nel.org>
---
arch/arm/kernel/stacktrace.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/arch/arm/kernel/stacktrace.c b/arch/arm/kernel/stacktrace.c
index 76ea4178a55c..db798eac7431 100644
--- a/arch/arm/kernel/stacktrace.c
+++ b/arch/arm/kernel/stacktrace.c
@@ -54,8 +54,7 @@ int notrace unwind_frame(struct stackframe *frame)
frame->sp = frame->fp;
frame->fp = *(unsigned long *)(fp);
- frame->pc = frame->lr;
- frame->lr = *(unsigned long *)(fp + 4);
+ frame->pc = *(unsigned long *)(fp + 4);
#else
/* check current frame pointer is within bounds */
if (fp < low + 12 || fp > high - 4)
Powered by blists - more mailing lists