Skip to content

Commit 9bad925

Browse files
author
Marc Zyngier
committed
KVM: arm64: PMU: Simplify vcpu computation on perf overflow notification
The way we compute the target vcpu on getting an overflow is a bit odd, as we use the PMC array as an anchor for kvm_pmc_to_vcpu, while we could directly compute the correct address. Get rid of the intermediate step and directly compute the target vcpu. Signed-off-by: Marc Zyngier <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent 1f7c978 commit 9bad925

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

arch/arm64/kvm/pmu-emul.c

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -405,11 +405,8 @@ void kvm_pmu_sync_hwstate(struct kvm_vcpu *vcpu)
405405
static void kvm_pmu_perf_overflow_notify_vcpu(struct irq_work *work)
406406
{
407407
struct kvm_vcpu *vcpu;
408-
struct kvm_pmu *pmu;
409-
410-
pmu = container_of(work, struct kvm_pmu, overflow_work);
411-
vcpu = kvm_pmc_to_vcpu(pmu->pmc);
412408

409+
vcpu = container_of(work, struct kvm_vcpu, arch.pmu.overflow_work);
413410
kvm_vcpu_kick(vcpu);
414411
}
415412

0 commit comments

Comments
 (0)