[PATCH] Revert "LoongArch: Remove unnecessary checks for ORC unwinder"
From: Tiezhu Yang
Date: Mon Jan 12 2026 - 04:15:48 EST
This reverts commit 4cd641a79e69270a062777f64a0dd330abb9044a.
The system can not boot normally with the latest kernel 6.19-rc5 under
different configs, commit 4cd641a79e69 ("LoongArch: Remove unnecessary
checks for ORC unwinder") is the first bad commit since 6.19-rc4, just
revert it first before finding the root cause.
Signed-off-by: Tiezhu Yang <yangtiezhu@xxxxxxxxxxx>
---
arch/loongarch/kernel/unwind_orc.c | 16 +++++++++++-----
1 file changed, 11 insertions(+), 5 deletions(-)
diff --git a/arch/loongarch/kernel/unwind_orc.c b/arch/loongarch/kernel/unwind_orc.c
index 8a6e3429a860..710f82d73797 100644
--- a/arch/loongarch/kernel/unwind_orc.c
+++ b/arch/loongarch/kernel/unwind_orc.c
@@ -352,6 +352,12 @@ static inline unsigned long bt_address(unsigned long ra)
{
extern unsigned long eentry;
+ if (__kernel_text_address(ra))
+ return ra;
+
+ if (__module_text_address(ra))
+ return ra;
+
if (ra >= eentry && ra < eentry + EXCCODE_INT_END * VECSIZE) {
unsigned long func;
unsigned long type = (ra - eentry) / VECSIZE;
@@ -369,13 +375,10 @@ static inline unsigned long bt_address(unsigned long ra)
break;
}
- ra = func + offset;
+ return func + offset;
}
- if (__kernel_text_address(ra))
- return ra;
-
- return 0;
+ return ra;
}
bool unwind_next_frame(struct unwind_state *state)
@@ -498,6 +501,9 @@ bool unwind_next_frame(struct unwind_state *state)
goto err;
}
+ if (!__kernel_text_address(state->pc))
+ goto err;
+
return true;
err:
--
2.42.0