summaryrefslogtreecommitdiff
path: root/arch/loongarch/kernel/stacktrace.c
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>2025-09-25 11:16:54 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2025-09-25 11:16:54 +0200
commitea2c1f2fff9e8c48d5dc0877a803edf916b1cfcf (patch)
treeea0f5ba14a51d6e7f8160c63bbd84a4e0f18b1a9 /arch/loongarch/kernel/stacktrace.c
parent362f34fba309536598a02bc0541ccaeae2bc9052 (diff)
parentb0d8acc711981d712a59ee20b073cbc52a4109c5 (diff)
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'arch/loongarch/kernel/stacktrace.c')
-rw-r--r--arch/loongarch/kernel/stacktrace.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/arch/loongarch/kernel/stacktrace.c b/arch/loongarch/kernel/stacktrace.c
index 9a038d1070d7..387dc4d3c486 100644
--- a/arch/loongarch/kernel/stacktrace.c
+++ b/arch/loongarch/kernel/stacktrace.c
@@ -51,12 +51,13 @@ int arch_stack_walk_reliable(stack_trace_consume_fn consume_entry,
if (task == current) {
regs->regs[3] = (unsigned long)__builtin_frame_address(0);
regs->csr_era = (unsigned long)__builtin_return_address(0);
+ regs->regs[22] = 0;
} else {
regs->regs[3] = thread_saved_fp(task);
regs->csr_era = thread_saved_ra(task);
+ regs->regs[22] = task->thread.reg22;
}
regs->regs[1] = 0;
- regs->regs[22] = 0;
for (unwind_start(&state, task, regs);
!unwind_done(&state) && !unwind_error(&state); unwind_next_frame(&state)) {