Similar as other architectures such as arm64, x86 and so on, use offsets relative to the exception table entry values rather than absolute addresses for both the exception locationand the fixup. And recently, arm64 and x86 remove anonymous out-of-line fixups, we want to acchieve the same result. Implementing the relative extable will facilitate subsequent kernel relocation support, which can reduce relocation operations to the extable (thanks to Jinyang for the suggestion). At the same time, add BPF exception tables handling. Youling Tang (7): LoongArch: Consolidate __ex_table construction LoongArch: Switch to relative exception tables LoongArch: extable: Add `type` and `data` fields LoongArch: Add gpr-num.h LoongArch: extable: Add a dedicated uaccess handler LoongArch: vmlinux.lds.S: Remove `.fixup` section LoongArch: bpf: Add BPF exception tables arch/loongarch/include/asm/asm-extable.h | 65 ++++++++++++++++++ arch/loongarch/include/asm/extable.h | 49 ++++++++++++++ arch/loongarch/include/asm/futex.h | 27 ++------ arch/loongarch/include/asm/gpr-num.h | 22 +++++++ arch/loongarch/include/asm/uaccess.h | 24 ++----- arch/loongarch/kernel/fpu.S | 5 +- arch/loongarch/kernel/vmlinux.lds.S | 4 +- arch/loongarch/lib/clear_user.S | 17 ++--- arch/loongarch/lib/copy_user.S | 19 ++---- arch/loongarch/mm/extable.c | 60 ++++++++++++++--- arch/loongarch/net/bpf_jit.c | 84 ++++++++++++++++++++++-- arch/loongarch/net/bpf_jit.h | 2 + scripts/mod/modpost.c | 13 ++++ scripts/sorttable.c | 2 +- 14 files changed, 312 insertions(+), 81 deletions(-) create mode 100644 arch/loongarch/include/asm/asm-extable.h create mode 100644 arch/loongarch/include/asm/extable.h create mode 100644 arch/loongarch/include/asm/gpr-num.h -- 2.36.1