x86: Do not attempt to calibrate the LAPIC timer if no APIC is present

Reported and tested by:	Michael Butler <imb@protected-networks.net>
Reviewed by:	jhb, kib
Fixes:	62d09b46ad ("x86: Defer LAPIC calibration until after timecounters are available")
MFC after:	3 days
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D33669
This commit is contained in:
Mark Johnston 2021-12-28 17:44:57 -05:00
parent deca0138dc
commit 0ecda8d5ae

View File

@ -913,6 +913,12 @@ native_lapic_calibrate_timer(void)
struct lapic *la;
register_t intr;
#ifdef DEV_ATPIC
/* Fail if the local APIC is not present. */
if (!x2apic_mode && lapic_map == NULL)
return;
#endif
intr = intr_disable();
la = &lapics[lapic_id()];