From: Jisheng Zhang Date: Mon, 29 Mar 2021 18:16:24 +0000 (+0800) Subject: riscv: keep interrupts disabled for BREAKPOINT exception X-Git-Tag: accepted/tizen/unified/20230118.172025~7478^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=7ae11635ec90072083503c6b6485cdffe46203b3;p=platform%2Fkernel%2Flinux-rpi.git riscv: keep interrupts disabled for BREAKPOINT exception Current riscv's kprobe handlers are run with both preemption and interrupt enabled, this violates kprobe requirements. Fix this issue by keeping interrupts disabled for BREAKPOINT exception. Fixes: c22b0bcb1dd0 ("riscv: Add kprobes supported") Cc: stable@vger.kernel.org Signed-off-by: Jisheng Zhang Reviewed-by: Masami Hiramatsu [Palmer: add a comment] Signed-off-by: Palmer Dabbelt --- diff --git a/arch/riscv/kernel/entry.S b/arch/riscv/kernel/entry.S index 76274a4..83095fa 100644 --- a/arch/riscv/kernel/entry.S +++ b/arch/riscv/kernel/entry.S @@ -130,6 +130,9 @@ skip_context_tracking: */ andi t0, s1, SR_PIE beqz t0, 1f + /* kprobes, entered via ebreak, must have interrupts disabled. */ + li t0, EXC_BREAKPOINT + beq s4, t0, 1f #ifdef CONFIG_TRACE_IRQFLAGS call trace_hardirqs_on #endif