]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
ACPI: processor_core: fix map_x2apic_id for amd-pstate on am4
authorRené Rebe <rene@exactco.de>
Wed, 26 Nov 2025 15:55:13 +0000 (16:55 +0100)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Wed, 26 Nov 2025 17:06:25 +0000 (18:06 +0100)
On all AMD AM4 systems I have seen, e.g ASUS X470-i, Pro WS X570 Ace
and equivalent Gigabyte, amd-pstate does not initialize when the
x2apic is enabled in the BIOS. Kernel debug messages include:

[    0.315438] acpi LNXCPU:00: Failed to get CPU physical ID.
[    0.354756] ACPI CPPC: No CPC descriptor for CPU:0
[    0.714951] amd_pstate: the _CPC object is not present in SBIOS or ACPI disabled

I tracked this down to map_x2apic_id() checking device_declaration
passed in via the type argument of acpi_get_phys_id() via
map_madt_entry() while map_lapic_id() does not.

It appears these BIOSes use Processor statements for declaring the CPUs
in the ACPI namespace instead of processor device objects (which should
have been used). CPU declarations via Processor statements were
deprecated in ACPI 6.0 that was released 10 years ago. They should not
be used any more in any contemporary platform firmware.

I tried to contact Asus support multiple times, but never received a
reply nor did any BIOS update ever change this.

Fix amd-pstate w/ x2apic on am4 by allowing map_x2apic_id() to work with
CPUs declared via Processor statements for IDs less than 255, which is
consistent with ACPI 5.0 that still allowed Processor statements to be
used for declaring CPUs.

Fixes: 7237d3de78ff ("x86, ACPI: add support for x2apic ACPI extensions")
Signed-off-by: René Rebe <rene@exactco.de>
[ rjw: Changelog edits ]
Link: https://patch.msgid.link/20251126.165513.1373131139292726554.rene@exactco.de
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
drivers/acpi/processor_core.c

index 9b6b71a2ffb5461396dcecb1232db99884885e30..a4498357bd165ae8c13623231c109cca6f7fc9f5 100644 (file)
@@ -54,7 +54,7 @@ static int map_x2apic_id(struct acpi_subtable_header *entry,
        if (!(apic->lapic_flags & ACPI_MADT_ENABLED))
                return -ENODEV;
 
-       if (device_declaration && (apic->uid == acpi_id)) {
+       if (apic->uid == acpi_id && (device_declaration || acpi_id < 255)) {
                *apic_id = apic->local_apic_id;
                return 0;
        }