Commit af3c04e5 authored by Vanshidhar Konda's avatar Vanshidhar Konda Committed by liwei
Browse files

ACPI: CPPC: Fix access width used for PCC registers

mainline inclusion
from mainline-v6.9-rc6
commit f489c948028b69cea235d9c0de1cc10eeb26a172
category: bugfix
bugzilla: https://gitee.com/src-openeuler/kernel/issues/I9QRD6
CVE: CVE-2024-35995

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=f489c948028b69cea235d9c0de1cc10eeb26a172



--------------------------------

commit 2f4a4d63a193 ("ACPI: CPPC: Use access_width over bit_width for system
memory accesses") modified cpc_read()/cpc_write() to use access_width to
read CPC registers.

However, for PCC registers the access width field in the ACPI register
macro specifies the PCC subspace ID.  For non-zero PCC subspace ID it is
incorrectly treated as access width. This causes errors when reading
from PCC registers in the CPPC driver.

For PCC registers, base the size of read/write on the bit width field.
The debug message in cpc_read()/cpc_write() is updated to print relevant
information for the address space type used to read the register.

Fixes: 2f4a4d63a193 ("ACPI: CPPC: Use access_width over bit_width for system memory accesses")
Signed-off-by: default avatarVanshidhar Konda <vanshikonda@os.amperecomputing.com>
Tested-by: default avatarJarred White <jarredwhite@linux.microsoft.com>
Reviewed-by: default avatarJarred White <jarredwhite@linux.microsoft.com>
Reviewed-by: default avatarEaswar Hariharan <eahariha@linux.microsoft.com>
Cc: 5.15+ <stable@vger.kernel.org> # 5.15+
Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: default avatarliwei <liwei728@huawei.com>
parent c7613e09
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment