diff options
author | Marc Zyngier <maz@kernel.org> | 2022-11-13 17:38:31 +0100 |
---|---|---|
committer | Marc Zyngier <maz@kernel.org> | 2022-11-19 13:56:39 +0100 |
commit | 9bad925dd741408825590eccc495d073cc246de0 (patch) | |
tree | 42f36384e9f306c500803cf51b75cd5a00296167 /arch/arm64 | |
parent | KVM: arm64: PMU: Allow PMUv3p5 to be exposed to the guest (diff) | |
download | linux-9bad925dd741408825590eccc495d073cc246de0.tar.xz linux-9bad925dd741408825590eccc495d073cc246de0.zip |
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 <maz@kernel.org>
Link: https://lore.kernel.org/r/20221113163832.3154370-16-maz@kernel.org
Diffstat (limited to 'arch/arm64')
-rw-r--r-- | arch/arm64/kvm/pmu-emul.c | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/arch/arm64/kvm/pmu-emul.c b/arch/arm64/kvm/pmu-emul.c index be881ae67133..49a004660497 100644 --- a/arch/arm64/kvm/pmu-emul.c +++ b/arch/arm64/kvm/pmu-emul.c @@ -405,11 +405,8 @@ void kvm_pmu_sync_hwstate(struct kvm_vcpu *vcpu) static void kvm_pmu_perf_overflow_notify_vcpu(struct irq_work *work) { struct kvm_vcpu *vcpu; - struct kvm_pmu *pmu; - - pmu = container_of(work, struct kvm_pmu, overflow_work); - vcpu = kvm_pmc_to_vcpu(pmu->pmc); + vcpu = container_of(work, struct kvm_vcpu, arch.pmu.overflow_work); kvm_vcpu_kick(vcpu); } |