Skip to content

Commit 615ca25

Browse files
ouptonjannau
authored andcommitted
KVM: arm64: Advertise 0 event counters for IMPDEF PMU
The programmable event counters on Apple M* parts are quite different from what's available in PMUv3, as the event counters aren't fungible (some events only work on specific counters) and the event ID space doesn't match the architecture. Signed-off-by: Oliver Upton <oliver.upton@linux.dev>
1 parent c20e571 commit 615ca25

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

arch/arm64/kvm/pmu-emul.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -942,6 +942,9 @@ u8 kvm_arm_pmu_get_max_counters(struct kvm *kvm)
942942
{
943943
struct arm_pmu *arm_pmu = kvm->arch.arm_pmu;
944944

945+
if (cpus_have_final_cap(ARM64_WORKAROUND_PMUV3_IMPDEF_TRAPS))
946+
return 0;
947+
945948
/*
946949
* The arm_pmu->cntr_mask considers the fixed counter(s) as well.
947950
* Ignore those and return only the general-purpose counters.

0 commit comments

Comments
 (0)