Commit e0c0fc18 authored by Vincent Chen's avatar Vincent Chen Committed by Paul Walmsley

riscv: avoid sending a SIGTRAP to a user thread trapped in WARN()

On RISC-V, when the kernel runs code on behalf of a user thread, and the
kernel executes a WARN() or WARN_ON(), the user thread will be sent
a bogus SIGTRAP.  Fix the RISC-V kernel code to not send a SIGTRAP when
a WARN()/WARN_ON() is executed.
Signed-off-by: default avatarVincent Chen <vincent.chen@sifive.com>
Reviewed-by: default avatarChristoph Hellwig <hch@lst.de>
[paul.walmsley@sifive.com: fixed subject]
Signed-off-by: default avatarPaul Walmsley <paul.walmsley@sifive.com>
parent 8b04825e
......@@ -134,7 +134,7 @@ asmlinkage void do_trap_break(struct pt_regs *regs)
break;
case BUG_TRAP_TYPE_WARN:
regs->sepc += get_break_insn_length(regs->sepc);
break;
return;
case BUG_TRAP_TYPE_BUG:
#endif /* CONFIG_GENERIC_BUG */
default:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment