HomeFreeBSD

x86/local_apic.c: Properly calculate the number of LVT entries

Description

x86/local_apic.c: Properly calculate the number of LVT entries

First, the CMCI entry index is APIC_LVT_MAX, so it was excluded
unconditionall [1].

Second, the number of entries is reported by the version register, and
we must not access past the last reported entry.

Reported by: olivier [1]
Fixes: 11f954b021a1aadde1d03d40ed5d6b529e14da98
Reviewed by: markj
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D54773

Details

Provenance
kibAuthored on Jan 19 2026, 11:55 AM
Reviewer
markj
Differential Revision
D54773: x86/local_apic.c: Properly calculate the number of LVT entries
Parents
rGad5e3cb95034: x86/local_apic.c: add lapic_maxlvt() helper
Branches
Unknown
Tags
Unknown