diff options
| author | James Clark <james.clark@linaro.org> | 2026-03-05 16:28:18 +0000 |
|---|---|---|
| committer | Will Deacon <will@kernel.org> | 2026-03-24 12:33:49 +0000 |
| commit | d1dcc20bcc40efe1f1c71639376c91dafa489222 (patch) | |
| tree | e577a2e7d486decd516ce09713e5c4f0de11bd2d /tools/perf/scripts/python/stackcollapse.py | |
| parent | 2e30447b233a8e7a561bb51995b8d4944282bf62 (diff) | |
arm64: cpufeature: Make PMUVer and PerfMon unsigned
On the host, this change doesn't make a difference because the fields
are defined as FTR_EXACT. However, KVM allows userspace to set these
fields for a guest and overrides the type to be FTR_LOWER_SAFE. And
while KVM used to do an unsigned comparison to validate that the new
value is lower than what the hardware provides, since the linked commit
it uses the generic sanitization framework which does a signed
comparison.
Fix it by defining these fields as unsigned. In theory, without this
fix, userspace could set a higher PMU version than the hardware supports
by providing any value with the top bit set.
Fixes: c118cead07a7 ("KVM: arm64: Use generic sanitisation for ID_(AA64)DFR0_EL1")
Signed-off-by: James Clark <james.clark@linaro.org>
Reviewed-by: Marc Zyngier <maz@kernel.org>
Reviewed-by: Colton Lewis <coltonlewis@google.com>
Signed-off-by: Will Deacon <will@kernel.org>
Diffstat (limited to 'tools/perf/scripts/python/stackcollapse.py')
0 files changed, 0 insertions, 0 deletions
