File tree Expand file tree Collapse file tree 1 file changed +13
-1
lines changed
Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Original file line number Diff line number Diff line change 1515
1616#define MSI_VECTORS 256
1717#define FIRST_MSI_VECTOR 64
18- #define MSI_WORDS (MSI_VECTORS / 64U)
18+ #define MSI_WORDS (MSI_VECTORS / 64)
19+
20+ /**
21+ * @note MAX_CPUS is set to 256 (not the expected physical core count).
22+ *
23+ * Local APIC IDs are 8-bit fields (0–255) and are not guaranteed to be
24+ * sequential, zero-based, or densely packed. Some systems leave gaps
25+ * in the LAPIC ID space or assign non-zero IDs to the bootstrap CPU.
26+ *
27+ * By sizing arrays to 256, we can index directly by LAPIC ID without
28+ * needing an LAPIC->OS CPU remapping table. This avoids subtle bugs on
29+ * odd hardware at the cost of a small amount of extra memory.
30+ */
1931#define MAX_CPUS 256
2032
2133/* Precompute reserved mask for the first word */
You can’t perform that action at this time.
0 commit comments