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>
Showing
- arch/loongarch/include/asm/unwind.h 1 addition, 1 deletionarch/loongarch/include/asm/unwind.h
- arch/loongarch/kernel/genex.S 3 additions, 0 deletionsarch/loongarch/kernel/genex.S
- arch/loongarch/kernel/unwind_prologue.c 88 additions, 13 deletionsarch/loongarch/kernel/unwind_prologue.c
- arch/loongarch/mm/tlb.c 1 addition, 1 deletionarch/loongarch/mm/tlb.c
Loading
Please register or sign in to comment