OpenCloudOS-Kernel/arch/loongarch/mm
Tiezhu Yang 559ae71cef LoongArch: Add ORC stack unwinder support
commit cb8a2ef0848ca80d67d6d56e2df757cfdf6b3355 upstream.

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.

The ORC data consists of unwind tables which are generated by objtool.
After analyzing all the code paths of a .o file, it determines information
about the stack state at each instruction address in the file and outputs
that information to the .orc_unwind and .orc_unwind_ip sections.

The per-object ORC sections are combined at link time and are sorted and
post-processed at boot time. The unwinder uses the resulting data to
correlate instruction addresses with their stack states at run time.

Most of the logic are similar with x86, in order to get ra info before ra
is saved into stack, add ra_reg and ra_offset into orc_entry. At the same
time, modify some arch-specific code to silence the objtool warnings.

Co-developed-by: Jinyang He <hejinyang@loongson.cn>
Signed-off-by: Jinyang He <hejinyang@loongson.cn>
Co-developed-by: Youling Tang <tangyouling@loongson.cn>
Signed-off-by: Youling Tang <tangyouling@loongson.cn>
Signed-off-by: Tiezhu Yang <yangtiezhu@loongson.cn>
Signed-off-by: Huacai Chen <chenhuacai@loongson.cn>
2024-11-12 16:59:49 +08:00
..
Makefile LoongArch: Add KASAN (Kernel Address Sanitizer) support 2023-09-06 22:54:16 +08:00
cache.c LoongArch: Remove shm_align_mask and use SHMLBA instead 2023-09-06 22:53:09 +08:00
extable.c LoongArch: BPF: Add BPF exception tables 2022-12-14 08:36:11 +08:00
fault.c LoongArch: Fix access error when read fault on a write-only VMA 2024-05-02 16:32:45 +02:00
hugetlbpage.c LoongArch: Fix some build warnings with W=1 2023-09-20 14:26:28 +08:00
init.c LoongArch: Replace kmap_atomic() with kmap_local_page() in copy_user_highpage() 2023-10-18 08:42:52 +08:00
ioremap.c LoongArch: Fix some build warnings with W=1 2023-09-20 14:26:28 +08:00
kasan_init.c LoongArch: Fix earlycon parameter if KASAN enabled 2024-02-23 09:25:16 +01:00
maccess.c
mmap.c LoongArch: Remove shm_align_mask and use SHMLBA instead 2023-09-06 22:53:09 +08:00
page.S LoongArch: Replace #include <asm/export.h> with #include <linux/export.h> 2023-08-25 23:40:26 +08:00
pgtable.c LoongArch: Mark {dmw,tlb}_virt_to_page() exports as non-GPL 2023-12-20 17:01:57 +01:00
tlb.c LoongArch: Add ORC stack unwinder support 2024-11-12 16:59:49 +08:00
tlbex.S LoongArch: Add ORC stack unwinder support 2024-11-12 16:59:49 +08:00