]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
KVM: arm64: Read PMUVer as unsigned
authorJames Clark <james.clark@linaro.org>
Thu, 5 Mar 2026 16:28:17 +0000 (16:28 +0000)
committerWill Deacon <will@kernel.org>
Tue, 24 Mar 2026 12:33:48 +0000 (12:33 +0000)
commit2e30447b233a8e7a561bb51995b8d4944282bf62
treeebd812ee72883a2b673ebf416afd6cf43e6955db
parent1f318b96cc84d7c2ab792fcc0bfd42a7ca890681
KVM: arm64: Read PMUVer as unsigned

ID_AA64DFR0_EL1.PMUVer is an unsigned field, so this skips
initialization of host_data_ptr(nr_event_counters) for PMUv3 for Armv8.8
onwards as they appear as negative values.

Fix it by reading it as unsigned. Now ID_AA64DFR0_EL1_PMUVer_IMP_DEF
needs to be special cased, so use pmuv3_implemented() which already does
it.

Fixes: 2417218f2f23 ("KVM: arm64: Get rid of __kvm_get_mdcr_el2() and related warts")
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>
arch/arm64/kvm/debug.c