[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20221109064937.3643993-2-guoren@kernel.org>
Date: Wed, 9 Nov 2022 01:49:36 -0500
From: guoren@...nel.org
To: anup@...infault.org, paul.walmsley@...ive.com, palmer@...belt.com,
conor.dooley@...rochip.com, heiko@...ech.de, peterz@...radead.org,
arnd@...db.de, linux-arch@...r.kernel.org, keescook@...omium.org,
paulmck@...nel.org, frederic@...nel.org, nsaenzju@...hat.com,
changbin.du@...el.com, vincent.chen@...ive.com
Cc: linux-riscv@...ts.infradead.org, linux-kernel@...r.kernel.org,
Guo Ren <guoren@...ux.alibaba.com>,
Guo Ren <guoren@...nel.org>, Alan Kao <alankao@...estech.com>,
Palmer Dabbelt <palmer@...osinc.com>
Subject: [PATCH 1/2] riscv: stacktrace: Fixup ftrace_graph_ret_addr retp argument
From: Guo Ren <guoren@...ux.alibaba.com>
The 'retp' is a pointer to the return address on the stack, so we
must pass the current return address pointer as the 'retp'
argument to ftrace_push_return_trace(). Not parent function's
return address on the stack.
Fixes: b785ec129bd9 ("riscv/ftrace: Add HAVE_FUNCTION_GRAPH_RET_ADDR_PTR support")
Signed-off-by: Guo Ren <guoren@...ux.alibaba.com>
Signed-off-by: Guo Ren <guoren@...nel.org>
Cc: Alan Kao <alankao@...estech.com>
Cc: Palmer Dabbelt <palmer@...osinc.com>
---
arch/riscv/kernel/stacktrace.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/riscv/kernel/stacktrace.c b/arch/riscv/kernel/stacktrace.c
index 08d11a53f39e..bcfe9eb55f80 100644
--- a/arch/riscv/kernel/stacktrace.c
+++ b/arch/riscv/kernel/stacktrace.c
@@ -58,7 +58,7 @@ void notrace walk_stackframe(struct task_struct *task, struct pt_regs *regs,
} else {
fp = frame->fp;
pc = ftrace_graph_ret_addr(current, NULL, frame->ra,
- (unsigned long *)(fp - 8));
+ &frame->ra);
}
}
--
2.36.1
Powered by blists - more mailing lists