Page MenuHomeFreeBSD

x86: change ap_boot_mtx from spinlock mutex to naive lock
ClosedPublic

Authored by kib on Jan 3 2026, 1:15 AM.
Tags
None
Referenced Files
Unknown Object (File)
Sun, Feb 15, 4:53 AM
Unknown Object (File)
Jan 20 2026, 3:32 AM
Unknown Object (File)
Jan 19 2026, 5:15 PM
Unknown Object (File)
Jan 19 2026, 4:28 PM
Unknown Object (File)
Jan 19 2026, 12:56 PM
Unknown Object (File)
Jan 18 2026, 4:04 PM
Unknown Object (File)
Jan 13 2026, 9:25 AM
Unknown Object (File)
Jan 10 2026, 4:48 AM
Subscribers

Details

Summary
Problem is that the printfs done under the spinlock might be very slow,
then spinlock triggers the panic due to some AP holding the mutex too
long.  We do want to ensure that the printfs are serialized, still.

Also, reduce the scope of the lock. The local APIC and MTRR
initializations are local to the AP, while mca_init() protects the
shared state with mca-private spinlock.

PR:     289297

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

kib requested review of this revision.Jan 3 2026, 1:15 AM
markj added inline comments.
sys/x86/x86/mp_x86.c
1099
This revision is now accepted and ready to land.Jan 3 2026, 3:00 PM
kib marked an inline comment as done.

Fix grammar in the comment.
Use PAUSE if CAS failed.

This revision now requires review to proceed.Jan 3 2026, 11:41 PM
This revision is now accepted and ready to land.Jan 5 2026, 2:00 PM