summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorChristian Loehle <christian.loehle@arm.com>2026-09-16 17:27:56 +0100
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2026-09-18 17:29:08 +0200
commitea5ed1f82e2273bf8c16eace6d701e2ea4e820d2 (patch)
tree51f454bd1703730700f6f5dbde5b8cebd41b59fb /scripts
parentfd1bb9a6cb1f6641840a99653a175b913c0358f4 (diff)
downloadlinux-ea5ed1f82e2273bf8c16eace6d701e2ea4e820d2.tar.gz
linux-ea5ed1f82e2273bf8c16eace6d701e2ea4e820d2.zip
ACPI: CPPC: Validate SystemIO register layouts
cpc_read() and cpc_write() access SystemIO registers using the complete GAS access width. cpc_read() does not extract a partial field, while the writer does not preserve bits outside one. A partial register can therefore return the wrong value or clobber adjacent fields on write. Retain valid read-only fields in 8-, 16-, and 32-bit access units. Extract them after reading the complete port. Continue to require writable controls to cover the complete access unit at Bit Offset zero. A partial write would require a serialized RMW. Accept Access Size zero when Bit Width supplies one of the supported sizes. Require natural alignment on architectures which implement port I/O through MMIO and may fault on unaligned Device-memory accesses. Preserve port layouts on x86; its native port-I/O instructions support them. When CONFIG_HAS_IOPORT is disabled, report unavailable port-I/O support and mark SystemIO layouts inaccessible during probe. Also return -EOPNOTSUPP explicitly in cpc_read() and cpc_write() so a SystemIO entry can never fall through and treat its port number as a physical-memory address. Resolve inaccessible entries using the control-specific policy established for PCC: optional fields can be disabled, while mandatory or semantically required controls fail probe. System I/O may use the same numeric port for different read and write registers, but a direction-dependent alias is safe only when the control is write-only. A readable control such as Minimum Performance would otherwise return the read-side capability's value, which cppc-cpufreq can then write back as its initial performance limit. Reject such aliases and overlapping writers; retain read-only overlaps and aliases between a read-only entry and a revision-4 write-only control. Remove the EPP setter's duplicate SystemIO geometry preflight now that probe validates every published writable control. Fixes: a2c8f92bea5f ("ACPI: CPPC: Implement support for SystemIO registers") Signed-off-by: Christian Loehle <christian.loehle@arm.com> Tested-by: Sumit Gupta <sumitg@nvidia.com> Link: https://patch.msgid.link/20260916162805.1039247-12-christian.loehle@arm.com Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'scripts')
0 files changed, 0 insertions, 0 deletions