Skip to content
  • Andriy Gapon's avatar
    calibrate lapic timer in native_lapic_setup · 7c5ccd2d
    Andriy Gapon authored
    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
    7c5ccd2d