Subject: Re: [PATCH] KVM: arm64: Treat ID_AA64DFR0_EL1.PMUVer as an unsigned field

From: Marc Zyngier <[email-masked]>
Date: Tue, 21 Apr 2026 17:45:58 +0100

On Tue, 21 Apr 2026 17:41:12 +0100,
Jing Zhang <[email-masked]> 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 <[email-masked]>

https://lore.kernel.org/all/[email-masked]/

	M.

-- 
Without deviation from the norm, progress is not possible.