diff options
| author | Oliver Upton <oliver.upton@linux.dev> | 2024-03-05 18:48:39 +0000 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2024-04-10 16:28:23 +0200 |
| commit | 923579201dece7cb9fc30662b4f6e7d7801042a8 (patch) | |
| tree | 13e5eaa0f1b69f6761e7630b1660eab0e45a5d11 /include/kvm | |
| parent | ad141b08d1ce078ad52a00e2eed1589208c54586 (diff) | |
| download | linux-923579201dece7cb9fc30662b4f6e7d7801042a8.tar.gz linux-923579201dece7cb9fc30662b4f6e7d7801042a8.tar.bz2 linux-923579201dece7cb9fc30662b4f6e7d7801042a8.zip | |
KVM: arm64: Fix host-programmed guest events in nVHE
commit e89c928bedd77d181edc2df01cb6672184775140 upstream.
Programming PMU events in the host that count during guest execution is
a feature supported by perf, e.g.
perf stat -e cpu_cycles:G ./lkvm run
While this works for VHE, the guest/host event bitmaps are not carried
through to the hypervisor in the nVHE configuration. Make
kvm_pmu_update_vcpu_events() conditional on whether or not _hardware_
supports PMUv3 rather than if the vCPU as vPMU enabled.
Cc: stable@vger.kernel.org
Fixes: 84d751a019a9 ("KVM: arm64: Pass pmu events to hyp via vcpu")
Reviewed-by: Marc Zyngier <maz@kernel.org>
Link: https://lore.kernel.org/r/20240305184840.636212-3-oliver.upton@linux.dev
Signed-off-by: Oliver Upton <oliver.upton@linux.dev>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'include/kvm')
| -rw-r--r-- | include/kvm/arm_pmu.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/include/kvm/arm_pmu.h b/include/kvm/arm_pmu.h index 96b192139a23..6196b71c5eb5 100644 --- a/include/kvm/arm_pmu.h +++ b/include/kvm/arm_pmu.h @@ -85,7 +85,7 @@ void kvm_vcpu_pmu_restore_host(struct kvm_vcpu *vcpu); */ #define kvm_pmu_update_vcpu_events(vcpu) \ do { \ - if (!has_vhe() && kvm_vcpu_has_pmu(vcpu)) \ + if (!has_vhe() && kvm_arm_support_pmu_v3()) \ vcpu->arch.pmu.events = *kvm_get_pmu_events(); \ } while (0) |
