Unverified Commit 7ae11635 authored by Jisheng Zhang's avatar Jisheng Zhang Committed by Palmer Dabbelt
Browse files

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: c22b0bcb ("riscv: Add kprobes supported")
Cc: stable@vger.kernel.org
Signed-off-by: default avatarJisheng Zhang <jszhang@kernel.org>
Reviewed-by: default avatarMasami Hiramatsu <mhiramat@kernel.org>
[Palmer: add a comment]
Signed-off-by: default avatarPalmer Dabbelt <palmerdabbelt@google.com>
parent e31be8d3
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -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