HomeFreeBSD

calibrate lapic timer in native_lapic_setup

Description

calibrate lapic timer in native_lapic_setup

The idea is to calibrate the LAPIC timer just once and only on boot,
given that [at present] the timer constants are global and shared
between all processors.

My primary motivation is to fix a panic that can happen when dynamically
switching to lapic timer. The panic is caused by a recursion on
et_hw_mtx when printing the calibration results to console. See the
review for the details of the panic.

Also, the code should become slightly simpler and easier to read. The
previous code was racy too. Multiple processors could start calibrating
the global constants concurrently, although that seems to have been
benign.

Reviewed by: kib, mav, jhb
MFC after: 3 weeks
Differential Revision: https://reviews.freebsd.org/D15422

Details

Provenance
avgAuthored on
Reviewer
kib
Differential Revision
D15422: calibrate lapic timer in native_lapic_setup
Parents
rS333637: Check that ifma_protospec != NULL in inm_lookup
Branches
Unknown
Tags
Unknown