LoongArch: Add prologue unwinder support
authorQing Zhang <zhangqing@loongson.cn>
Sat, 6 Aug 2022 08:10:03 +0000 (16:10 +0800)
committerHuacai Chen <chenhuacai@loongson.cn>
Fri, 12 Aug 2022 05:10:11 +0000 (13:10 +0800)
commit49aef111e2dae176a7708b532118f33f24289248
tree394ff32e5dba1e22ebac5015fe3164e7ed2e8a77
parent49232773d8233ed70c4998851bc84e465fc1c788
LoongArch: Add prologue unwinder support

It unwind the stack frame based on prologue code analyze.
CONFIG_KALLSYMS is needed, at least the address and length
of each function.

Three stages when we do unwind,
  1) unwind_start(), the prapare of unwinding, fill unwind_state.
  2) unwind_done(), judge whether the unwind process is finished or not.
  3) unwind_next_frame(), unwind the next frame.

Dividing unwinder helps to add new unwinders in the future, e.g.:
unwinder_frame, unwinder_orc, .etc.

Signed-off-by: Qing Zhang <zhangqing@loongson.cn>
Signed-off-by: Huacai Chen <chenhuacai@loongson.cn>
arch/loongarch/Kconfig.debug
arch/loongarch/include/asm/inst.h
arch/loongarch/include/asm/unwind.h
arch/loongarch/kernel/Makefile
arch/loongarch/kernel/traps.c
arch/loongarch/kernel/unwind_prologue.c [new file with mode: 0644]