mirror of
https://github.com/torvalds/linux.git
synced 2024-11-17 01:22:07 +00:00
c82dd6d078
When the handle_exception function addresses an exception, the interrupts
will be unconditionally enabled after finishing the context save. However,
It may erroneously enable the interrupts if the interrupts are disabled
before entering the handle_exception.
For example, one of the WARN_ON() condition is satisfied in the scheduling
where the interrupt is disabled and rq.lock is locked. The WARN_ON will
trigger a break exception and the handle_exception function will enable the
interrupts before entering do_trap_break function. During the procedure, if
a timer interrupt is pending, it will be taken when interrupts are enabled.
In this case, it may cause a deadlock problem if the rq.lock is locked
again in the timer ISR.
Hence, the handle_exception() can only enable interrupts when the state of
sstatus.SPIE is 1.
This patch is tested on HiFive Unleashed board.
Signed-off-by: Vincent Chen <vincent.chen@sifive.com>
Reviewed-by: Palmer Dabbelt <palmer@sifive.com>
[paul.walmsley@sifive.com: updated to apply]
Fixes:
|
||
---|---|---|
.. | ||
vdso | ||
.gitignore | ||
asm-offsets.c | ||
cacheinfo.c | ||
cpu.c | ||
cpufeature.c | ||
entry.S | ||
fpu.S | ||
ftrace.c | ||
head.S | ||
irq.c | ||
Makefile | ||
mcount-dyn.S | ||
mcount.S | ||
module-sections.c | ||
module.c | ||
module.lds | ||
perf_callchain.c | ||
perf_event.c | ||
perf_regs.c | ||
process.c | ||
ptrace.c | ||
reset.c | ||
riscv_ksyms.c | ||
setup.c | ||
signal.c | ||
smp.c | ||
smpboot.c | ||
stacktrace.c | ||
sys_riscv.c | ||
syscall_table.c | ||
time.c | ||
traps.c | ||
vdso.c | ||
vmlinux.lds.S |