Page MenuHomeFreeBSD

Don't enable interrupts in init_secondary().

Authored by markj on Jan 3 2019, 9:37 PM.



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

Lint OK
No Unit Test Coverage
Build Status
Buildable 21823
Build 21091: arc lint + arc unit

Event Timeline

markj created this revision.Jan 3 2019, 9:37 PM
jhb accepted this revision.Jan 3 2019, 10:38 PM
jhb added inline comments.

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 marked an inline comment as done.Jan 3 2019, 10:52 PM
markj added inline comments.

Hmm, it was added here:

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 updated this revision to Diff 52533.Jan 3 2019, 10:52 PM
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.