Page MenuHomeFreeBSD

Don't enable interrupts in init_secondary().
ClosedPublic

Authored by markj on Jan 3 2019, 9:37 PM.
Tags
None
Referenced Files
Unknown Object (File)
Wed, Apr 17, 9:57 AM
Unknown Object (File)
Mar 8 2024, 12:11 AM
Unknown Object (File)
Jan 18 2024, 8:16 AM
Unknown Object (File)
Jan 15 2024, 3:44 AM
Unknown Object (File)
Dec 23 2023, 4:17 AM
Unknown Object (File)
Dec 13 2023, 3:06 AM
Unknown Object (File)
Nov 7 2023, 12:41 AM
Unknown Object (File)
Nov 1 2023, 12:59 PM
Subscribers

Details

Summary

sched_throw() expects the caller to hold a spinlock section; see the
td_md initialization in cpu_fork(). This bug can cause a deadlock when
APs are started: statclock() fires before the thread lock acquired in
sched_throw() is released, and recurses on the thread lock.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

jhb added inline comments.
sys/riscv/riscv/mp_machdep.c
231 ↗(On Diff #52531)

Are interrupts enabled here at all? We really depend on them not being enabled on APs until after the first context switch.

This revision is now accepted and ready to land.Jan 3 2019, 10:38 PM
markj added inline comments.
sys/riscv/riscv/mp_machdep.c
231 ↗(On Diff #52531)

Hmm, it was added here: https://svnweb.freebsd.org/changeset/base/335005

We boot in QEMU without the intr_disable(), though. I added code to read and print sstatus here, and SIE is disabled. So it seems safe to remove the intr_disable().

markj marked an inline comment as done.
  • Remove unneeded intr_disable() call.
This revision now requires review to proceed.Jan 3 2019, 10:52 PM
This revision was not accepted when it landed; it landed in state Needs Review.Jan 4 2019, 5:15 PM
This revision was automatically updated to reflect the committed changes.