[<prev] [next>] [day] [month] [year] [list]
Message-ID: <20260113011730.17824-1-yangtiezhu@loongson.cn>
Date: Tue, 13 Jan 2026 09:17:30 +0800
From: Tiezhu Yang <yangtiezhu@...ngson.cn>
To: Huacai Chen <chenhuacai@...nel.org>
Cc: loongarch@...ts.linux.dev,
linux-kernel@...r.kernel.org
Subject: [PATCH v2] Revert "LoongArch: Remove unnecessary checks for ORC unwinder"
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.
The kernel boots normally with the defconfig, so no problem found out
at the first time. The error messages are "cannot find unwind pc at",
here is one way (maybe not the only way) to reproduce:
cd linux
make mrproper defconfig -j"$(nproc)"
scripts/config -e KASAN
make olddefconfig all -j"$(nproc)"
sudo make modules_install
sudo make install
sudo reboot
Signed-off-by: Tiezhu Yang <yangtiezhu@...ngson.cn>
---
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
Powered by blists - more mailing lists