[PATCH] KVM: arm64: Treat ID_AA64DFR0_EL1.PMUVer as an unsigned field
Marc Zyngier
maz at kernel.org
Tue Apr 21 09:45:58 PDT 2026
On Tue, 21 Apr 2026 17:41:12 +0100,
Jing Zhang <jingzhangos at google.com> wrote:
>
> ID_AA64DFR0_EL1.PMUVer is an unsigned 4-bit field, but was historically
> marked as signed in the cpufeature table. This led
> kvm_init_host_debug_data() to fail detection of PMUv3 implementation on
> systems with PMUv3p8 or newer, as the signed extraction of the field
> (e.g., 0b1000 for PMUv3p8) would result in a negative value.
>
> Fix this by marking the field as unsigned in the ftr_id_aa64dfr0 table
> and updating the KVM initialization code to use unsigned extraction.
> While at it, ensure that both the 'Not Implemented' (0b0000) and
> 'Implementation Defined' (0b1111) values are correctly handled as
> indicating the absence of a standard PMUv3.
>
> Signed-off-by: Jing Zhang <jingzhangos at google.com>
https://lore.kernel.org/all/20260305-james-kvm-pmuver-sign-v2-0-ee80a125af9b@linaro.org/
M.
--
Without deviation from the norm, progress is not possible.
More information about the linux-arm-kernel
mailing list