linux-stable/arch/loongarch
Jinyang He dc74a9e8a8 LoongArch: Add generic ex-handler unwind in prologue unwinder
When exception is triggered, code flow go handle_\exception in some
cases. One of stackframe in this case as follows,

high -> +-------+
        | REGS  |  <- a pt_regs
        |       |
        |       |  <- ex trigger
        | REGS  |  <- ex pt_regs   <-+
        |       |                    |
        |       |                    |
low  -> +-------+           ->unwind-+

When unwinder unwinds to handler_\exception it cannot go on prologue
analysis. Because it is an asynchronous code flow, we should get the
next frame PC from regs->csr_era rather than regs->regs[1]. At init time
we copy the handlers to eentry and also copy them to NUMA-affine memory
named pcpu_handlers if NUMA is enabled. Thus, unwinder cannot unwind
normally. To solve this, we try to give some hints in handler_\exception
and fixup unwinders in unwind_next_frame().

Reported-by: Qing Zhang <zhangqing@loongson.cn>
Signed-off-by: Jinyang He <hejinyang@loongson.cn>
Signed-off-by: Huacai Chen <chenhuacai@loongson.cn>
2023-01-17 11:42:16 +08:00
..
boot loongarch: efi: enable generic EFI compressed boot 2022-09-20 09:50:31 +02:00
configs LoongArch: Update Loongson-3 default config file 2022-12-14 08:41:54 +08:00
include LoongArch: Add generic ex-handler unwind in prologue unwinder 2023-01-17 11:42:16 +08:00
kernel LoongArch: Add generic ex-handler unwind in prologue unwinder 2023-01-17 11:42:16 +08:00
lib LoongArch: Use alternative to optimize libraries 2022-12-14 08:36:11 +08:00
mm LoongArch: Add generic ex-handler unwind in prologue unwinder 2023-01-17 11:42:16 +08:00
net LoongArch: BPF: Add BPF exception tables 2022-12-14 08:36:11 +08:00
pci LoongArch: Add FDT booting support from efi system table 2022-12-14 08:41:53 +08:00
power LoongArch: Add hibernation (ACPI S4) support 2022-12-14 08:41:53 +08:00
vdso LoongArch: Fix build warnings in VDSO 2022-08-25 19:34:59 +08:00
Kbuild LoongArch: Add BPF JIT support 2022-10-12 16:36:20 +08:00
Kconfig LoongArch changes for v6.2 2022-12-19 08:23:27 -06:00
Kconfig.debug LoongArch: Add prologue unwinder support 2022-08-12 13:10:11 +08:00
Makefile LoongArch/ftrace: Add dynamic function tracer support 2022-12-14 08:41:53 +08:00