From 0381f4cf0014a3879079b400f4c89b9c52b8cefe Mon Sep 17 00:00:00 2001 From: Juxin Gao Date: Sat, 5 Aug 2023 17:06:06 +0800 Subject: [PATCH] Loongarch: Fixed finding zero address exception vector table error ANBZ: #5200 commit 3d36f4298ba91fbdec6bc56aa7bb0663cba6ab0c upstream. Fix when the zero address exception is triggered, the exception vector table cannot be found correctly, and the signal function related to the architecture is corrected Signed-off-by: Juxin Gao --- arch/loongarch/Kconfig | 1 - arch/loongarch/include/asm/extable.h | 2 ++ arch/loongarch/kernel/signal.c | 4 ++-- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/arch/loongarch/Kconfig b/arch/loongarch/Kconfig index 6e591514d7e3..34eff7c52582 100644 --- a/arch/loongarch/Kconfig +++ b/arch/loongarch/Kconfig @@ -130,7 +130,6 @@ config LOONGARCH select TRACE_IRQFLAGS_SUPPORT select USER_STACKTRACE_SUPPORT select ZONE_DMA32 - select ARCH_HAS_RELATIVE_EXTABLE config 32BIT bool diff --git a/arch/loongarch/include/asm/extable.h b/arch/loongarch/include/asm/extable.h index 339122c9d614..6499c9f0640e 100644 --- a/arch/loongarch/include/asm/extable.h +++ b/arch/loongarch/include/asm/extable.h @@ -15,6 +15,8 @@ * on our cache or tlb entries. */ +#define ARCH_HAS_RELATIVE_EXTABLE + struct exception_table_entry { int insn, fixup; short type, data; diff --git a/arch/loongarch/kernel/signal.c b/arch/loongarch/kernel/signal.c index f268a1639a34..8c2ef6598328 100644 --- a/arch/loongarch/kernel/signal.c +++ b/arch/loongarch/kernel/signal.c @@ -853,11 +853,11 @@ static void handle_signal(struct ksignal *ksig, struct pt_regs *regs) signal_setup_done(ret, ksig, 0); } -void arch_do_signal_or_restart(struct pt_regs *regs, bool has_signal) +void arch_do_signal(struct pt_regs *regs) { struct ksignal ksig; - if (has_signal && get_signal(&ksig)) { + if (get_signal(&ksig)) { /* Whee! Actually deliver the signal. */ handle_signal(&ksig, regs); return; -- Gitee