Skip to content

Commit 1735004

Browse files
committed
KVM: arm64: Fix host-programmed guest events in nVHE
jira LE-1907 Rebuild_History Non-Buildable kernel-5.14.0-427.28.1.el9_4 commit-author Oliver Upton <oliver.upton@linux.dev> commit e89c928 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: 84d751a ("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> (cherry picked from commit e89c928) Signed-off-by: Jonathan Maple <jmaple@ciq.com>
1 parent 7db7e58 commit 1735004

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

include/kvm/arm_pmu.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ void kvm_vcpu_pmu_resync_el0(void);
8686
*/
8787
#define kvm_pmu_update_vcpu_events(vcpu) \
8888
do { \
89-
if (!has_vhe() && kvm_vcpu_has_pmu(vcpu)) \
89+
if (!has_vhe() && kvm_arm_support_pmu_v3()) \
9090
vcpu->arch.pmu.events = *kvm_get_pmu_events(); \
9191
} while (0)
9292

0 commit comments

Comments
 (0)