mirror of
https://github.com/torvalds/linux.git
synced 2024-11-26 06:02:05 +00:00
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: c22b0bcb1d
("riscv: Add kprobes supported")
Cc: stable@vger.kernel.org
Signed-off-by: Jisheng Zhang <jszhang@kernel.org>
Reviewed-by: Masami Hiramatsu <mhiramat@kernel.org>
[Palmer: add a comment]
Signed-off-by: Palmer Dabbelt <palmerdabbelt@google.com>
This commit is contained in:
parent
e31be8d343
commit
7ae11635ec
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user