x86/srat: fix parsing of APIC IDs > MAX_APIC_ID
Ignore them like it's done in the MADT parser. This allows booting on a box with SRAT and APIC IDs > 255. Reported by: Wei Liu <wei.liu2@citrix.com> Tested by: Wei Liu <wei.liu2@citrix.com> Reviewed by: kib MFC after: 2 weeks Sponsored by: Citrix Systems R&D
This commit is contained in:
parent
4ca582c4f2
commit
6e2ab0aef5
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=315402
@ -202,6 +202,12 @@ srat_parse_entry(ACPI_SUBTABLE_HEADER *entry, void *arg)
|
||||
"enabled" : "disabled");
|
||||
if (!(cpu->Flags & ACPI_SRAT_CPU_ENABLED))
|
||||
break;
|
||||
if (cpu->ApicId > MAX_APIC_ID) {
|
||||
printf("SRAT: Ignoring local APIC ID %u (too high)\n",
|
||||
cpu->ApicId);
|
||||
break;
|
||||
}
|
||||
|
||||
if (cpus[cpu->ApicId].enabled) {
|
||||
printf("SRAT: Duplicate local APIC ID %u\n",
|
||||
cpu->ApicId);
|
||||
@ -220,6 +226,12 @@ srat_parse_entry(ACPI_SUBTABLE_HEADER *entry, void *arg)
|
||||
"enabled" : "disabled");
|
||||
if (!(x2apic->Flags & ACPI_SRAT_CPU_ENABLED))
|
||||
break;
|
||||
if (x2apic->ApicId > MAX_APIC_ID) {
|
||||
printf("SRAT: Ignoring local APIC ID %u (too high)\n",
|
||||
x2apic->ApicId);
|
||||
break;
|
||||
}
|
||||
|
||||
KASSERT(!cpus[x2apic->ApicId].enabled,
|
||||
("Duplicate local APIC ID %u", x2apic->ApicId));
|
||||
cpus[x2apic->ApicId].domain = x2apic->ProximityDomain;
|
||||
|
Loading…
Reference in New Issue
Block a user