Re: [PATCH v5 8/8] LoongArch: Add ORC stack unwinder support

From: Tiezhu Yang
Date: Thu Dec 07 2023 - 02:09:29 EST




On 12/02/2023 09:45 PM, Huacai Chen wrote:
Hi, Tiezhu,

On Wed, Nov 29, 2023 at 9:07 PM Tiezhu Yang <yangtiezhu@xxxxxxxxxxx> wrote:

The kernel CONFIG_UNWINDER_ORC option enables the ORC unwinder, which is
similar in concept to a DWARF unwinder. The difference is that the format
of the ORC data is much simpler than DWARF, which in turn allows the ORC
unwinder to be much simpler and faster.

...

diff --git a/arch/loongarch/kernel/lbt.S b/arch/loongarch/kernel/lbt.S
index 9c75120a26d8..4d6914f84c7e 100644
--- a/arch/loongarch/kernel/lbt.S
+++ b/arch/loongarch/kernel/lbt.S
@@ -11,6 +11,7 @@
#include <asm/asm-offsets.h>
#include <asm/errno.h>
#include <asm/regdef.h>
+#include <asm/unwind_hints.h>

#define SCR_REG_WIDTH 8

@@ -153,3 +154,7 @@ SYM_FUNC_END(_restore_ftop_context)
.L_lbt_fault:
li.w a0, -EFAULT # failure
jr ra
+
+#ifdef CONFIG_CPU_HAS_LBT
+STACK_FRAME_NON_STANDARD _restore_ftop_context
+#endif
This file is only compiled if CONFIG_CPU_HAS_LBT is set, so #ifdef can
be removed.

OK, will remove it in the next version.

Thanks,
Tiezhu