Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F144466208
D54773.1774785031.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D54773.1774785031.diff
View Options
diff --git a/sys/x86/include/apicreg.h b/sys/x86/include/apicreg.h
--- a/sys/x86/include/apicreg.h
+++ b/sys/x86/include/apicreg.h
@@ -439,7 +439,12 @@
#define APIC_EXTF_SEIO_CAP 0x00000002
#define APIC_EXTF_IER_CAP 0x00000001
-/* LVT table indices */
+/*
+ * LVT table indices.
+ * Must be ordered following the appearance of the LVT entries in
+ * series the LAPIC versions, which is reported by LAPIC_VERSION
+ * MAXLVT field.
+ */
#define APIC_LVT_LINT0 0
#define APIC_LVT_LINT1 1
#define APIC_LVT_TIMER 2
diff --git a/sys/x86/x86/local_apic.c b/sys/x86/x86/local_apic.c
--- a/sys/x86/x86/local_apic.c
+++ b/sys/x86/x86/local_apic.c
@@ -809,9 +809,13 @@
static void
lapic_early_mask_vecs(void)
{
- int elvt_count, i;
+ int elvt_count, lvts_count, i;
+ uint32_t version;
- for (i = 0; i < APIC_LVT_MAX; i++)
+ version = lapic_read32(LAPIC_VERSION);
+ lvts_count = min(nitems(lvts), ((version & APIC_VER_MAXLVT) >>
+ MAXLVTSHIFT) + 1);
+ for (i = 0; i < lvts_count; i++)
lapic_early_mask_vec(&lvts[i]);
elvt_count = amd_read_elvt_count();
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sun, Mar 29, 11:50 AM (2 h, 29 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
28223477
Default Alt Text
D54773.1774785031.diff (1 KB)
Attached To
Mode
D54773: x86/local_apic.c: Properly calculate the number of LVT entries
Attached
Detach File
Event Timeline
Log In to Comment