diff options
| author | Christian Loehle <christian.loehle@arm.com> | 2026-09-16 17:27:59 +0100 |
|---|---|---|
| committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2026-09-18 17:29:08 +0200 |
| commit | a97aaf2aedae282eb668397428046cbd52435334 (patch) | |
| tree | c25f76b8a978e041a5f3997cefda09fc4b96572b /scripts/stackusage | |
| parent | 3051865865a88b41c5df881d44a6e3d1e85675ba (diff) | |
| download | linux-a97aaf2aedae282eb668397428046cbd52435334.tar.gz linux-a97aaf2aedae282eb668397428046cbd52435334.zip | |
ACPI: CPPC: Clear Performance Limited without a stale read
The Performance Limited status bits remain set until reset or OSPM clears
them by writing zero. ACPI does not define the effect of writing one, so a
plain read/write implementation may set a status bit when OSPM writes one.
cppc_set_perf_limited() used a read-modify-write. An excursion reported
between the transactions could be cleared by the stale write. Conversely,
writing ones directly to bits not selected for clearing can manufacture an
event. Clearing both bits with a literal zero is portable without a read;
reject selective clears, which require an interlocked RMW that Linux cannot
provide across all CPPC address spaces.
A partial SystemMemory or SystemIO field needs an RMW to preserve the
access unit. Keep it readable, but reject clears. Classify a field as a
writer during overlap validation only when both its _CPC semantics and
validated resource permit writing. Other writers can replay stale status,
so drop only disjoint optional SystemMemory controls and reject required or
overlapping writers. A present Autonomous Selection Enable control is
required, because hiding it could leave autonomous mode enabled while OSPM
believes it disabled.
Retain inaccessible Performance Limited ranges without accessing them, so
overlap validation cannot hide asynchronous status. For PCC, record the
claim in its own subspace without letting it select the channel for usable
controls. Bounds-check only entries in the acquired subspace. A status
range that exceeds its shared region still protects its known inbounds
portion from overlap with a writer. Likewise retain a SystemIO status
range whose first port is valid but whose complete access extends beyond
0xffff. The retained range only rejects an overlapping valid writer.
Fixes: 13c45a26635f ("ACPI: CPPC: add APIs and sysfs interface for perf_limited")
Reported-by: Sashiko <sashiko-bot@kernel.org>
Link: https://sashiko.dev/#/patchset/20260807111303.1062391-1-christian.loehle%40arm.com
Reported-by: Sumit Gupta <sumitg@nvidia.com>
Link: https://lore.kernel.org/lkml/d5f1ea9b-53b7-4db2-983a-b5be8e71a371@arm.com/
Signed-off-by: Christian Loehle <christian.loehle@arm.com>
Tested-by: Sumit Gupta <sumitg@nvidia.com>
Link: https://patch.msgid.link/20260916162805.1039247-15-christian.loehle@arm.com
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'scripts/stackusage')
0 files changed, 0 insertions, 0 deletions
