Page MenuHomeFreeBSD

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

Authored by kib on Mon, Jan 19, 12:14 PM.
Tags
None
Referenced Files
Unknown Object (File)
Tue, Jan 20, 3:30 PM
Unknown Object (File)
Tue, Jan 20, 5:24 AM
Unknown Object (File)
Mon, Jan 19, 11:29 PM
Unknown Object (File)
Mon, Jan 19, 7:35 PM
Unknown Object (File)
Mon, Jan 19, 7:20 PM
Unknown Object (File)
Mon, Jan 19, 6:19 PM
Unknown Object (File)
Mon, Jan 19, 4:10 PM
Unknown Object (File)
Mon, Jan 19, 3:59 PM
Subscribers

Details

Summary
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


x86/local_apic.c: add lapic_maxlvt() helper

that calculates the max index of the present LVT entry from the value of
the LAPIC version register.

Diff Detail

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

Event Timeline

kib requested review of this revision.Mon, Jan 19, 12:14 PM
kib edited the summary of this revision. (Show Details)

Add helper

markj added inline comments.
sys/x86/x86/local_apic.c
322

You can use this helper in a few other places, e.g., lapic_dump().

This revision is now accepted and ready to land.Mon, Jan 19, 2:38 PM
kib marked an inline comment as done.

Use lapic_maxlvt() everywhere.

This revision now requires review to proceed.Mon, Jan 19, 4:07 PM
This revision is now accepted and ready to land.Mon, Jan 19, 4:14 PM