svn commit: r348622 - stable/12/sys/riscv/riscv
Ruslan Bukin
br at FreeBSD.org
Tue Jun 4 15:33:53 UTC 2019
Author: br
Date: Tue Jun 4 15:33:52 2019
New Revision: 348622
URL: https://svnweb.freebsd.org/changeset/base/348622
Log:
MFC r347226:
Disable interrupts first and then set spinlock_count to 1.
Otherwise interrupt can be generated just after setting spinlock_count
and before disabling interrupts.
Sponsored by: DARPA, AFRL
Modified:
stable/12/sys/riscv/riscv/machdep.c
Modified: stable/12/sys/riscv/riscv/machdep.c
==============================================================================
--- stable/12/sys/riscv/riscv/machdep.c Tue Jun 4 15:32:56 2019 (r348621)
+++ stable/12/sys/riscv/riscv/machdep.c Tue Jun 4 15:33:52 2019 (r348622)
@@ -460,11 +460,13 @@ void
spinlock_enter(void)
{
struct thread *td;
+ register_t reg;
td = curthread;
if (td->td_md.md_spinlock_count == 0) {
+ reg = intr_disable();
td->td_md.md_spinlock_count = 1;
- td->td_md.md_saved_sstatus_ie = intr_disable();
+ td->td_md.md_saved_sstatus_ie = reg;
} else
td->td_md.md_spinlock_count++;
critical_enter();
More information about the svn-src-stable-12
mailing list