Skip to content

Commit 8681573

Browse files
Anshuman KhandualMarc Zyngier
authored andcommitted
KVM: arm64: PMU: Replace version number '0' with ID_AA64DFR0_EL1_PMUVer_NI
kvm_host_pmu_init() returns when detected PMU is either not implemented, or implementation defined. kvm_pmu_probe_armpmu() also has a similar situation. Extracted ID_AA64DFR0_EL1_PMUVer value, when PMU is not implemented is '0', which can be replaced with ID_AA64DFR0_EL1_PMUVer_NI defined as '0b0000'. Cc: Arnaldo Carvalho de Melo <[email protected]> Cc: Marc Zyngier <[email protected]> Cc: Mark Rutland <[email protected]> Cc: Will Deacon <[email protected]> Cc: Catalin Marinas <[email protected]> Cc: [email protected] Cc: [email protected] Cc: [email protected] Signed-off-by: Anshuman Khandual <[email protected]> Signed-off-by: Marc Zyngier <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent d56bdce commit 8681573

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

arch/arm64/kvm/pmu-emul.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -668,7 +668,8 @@ void kvm_host_pmu_init(struct arm_pmu *pmu)
668668
{
669669
struct arm_pmu_entry *entry;
670670

671-
if (pmu->pmuver == 0 || pmu->pmuver == ID_AA64DFR0_EL1_PMUVer_IMP_DEF)
671+
if (pmu->pmuver == ID_AA64DFR0_EL1_PMUVer_NI ||
672+
pmu->pmuver == ID_AA64DFR0_EL1_PMUVer_IMP_DEF)
672673
return;
673674

674675
mutex_lock(&arm_pmus_lock);
@@ -721,7 +722,7 @@ static struct arm_pmu *kvm_pmu_probe_armpmu(void)
721722

722723
if (event->pmu) {
723724
pmu = to_arm_pmu(event->pmu);
724-
if (pmu->pmuver == 0 ||
725+
if (pmu->pmuver == ID_AA64DFR0_EL1_PMUVer_NI ||
725726
pmu->pmuver == ID_AA64DFR0_EL1_PMUVer_IMP_DEF)
726727
pmu = NULL;
727728
}

0 commit comments

Comments
 (0)