Skip to content

Commit

Permalink
x86/acpi: Prevent X2APIC id 0xffffffff from being accounted
Browse files Browse the repository at this point in the history
RongQing reported that there are some X2APIC id 0xffffffff in his machine's
ACPI MADT table, which makes the number of possible CPU inaccurate.

The reason is that the ACPI X2APIC parser has no sanity check for APIC ID
0xffffffff, which is an invalid id in all APIC types. See "Intel® 64
Architecture x2APIC Specification", Chapter 2.4.1.

Add a sanity check to acpi_parse_x2apic() which ignores the invalid id.

Reported-by: Li RongQing <[email protected]>
Signed-off-by: Dou Liyang <[email protected]>
Signed-off-by: Thomas Gleixner <[email protected]>
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Link: https://lkml.kernel.org/r/[email protected]
  • Loading branch information
douliyang authored and KAGA-KOKO committed Apr 17, 2018
1 parent d3878e1 commit 10daf10
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions arch/x86/kernel/acpi/boot.c
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,10 @@ acpi_parse_x2apic(struct acpi_subtable_header *header, const unsigned long end)
apic_id = processor->local_apic_id;
enabled = processor->lapic_flags & ACPI_MADT_ENABLED;

/* Ignore invalid ID */
if (apic_id == 0xffffffff)
return 0;

/*
* We need to register disabled CPU as well to permit
* counting disabled CPUs. This allows us to size
Expand Down

0 comments on commit 10daf10

Please sign in to comment.