aboutsummaryrefslogtreecommitdiffstats
path: root/virt
diff options
context:
space:
mode:
authorAndrew Murray <andrew.murray@arm.com>2019-04-09 15:22:15 -0400
committerMarc Zyngier <marc.zyngier@arm.com>2019-04-24 10:46:26 -0400
commit435e53fb5e21ad1820c5c69f208304c0e5623d01 (patch)
treeb3ad2d97114ca99f78c6edcc76c7b0e1446df91b /virt
parent3d91befbb3a0fcec6e1eebde45c8074b88cc9441 (diff)
arm64: KVM: Enable VHE support for :G/:H perf event modifiers
With VHE different exception levels are used between the host (EL2) and guest (EL1) with a shared exception level for userpace (EL0). We can take advantage of this and use the PMU's exception level filtering to avoid enabling/disabling counters in the world-switch code. Instead we just modify the counter type to include or exclude EL0 at vcpu_{load,put} time. We also ensure that trapped PMU system register writes do not re-enable EL0 when reconfiguring the backing perf events. This approach completely avoids blackout windows seen with !VHE. Suggested-by: Christoffer Dall <christoffer.dall@arm.com> Signed-off-by: Andrew Murray <andrew.murray@arm.com> Acked-by: Will Deacon <will.deacon@arm.com> Reviewed-by: Suzuki K Poulose <suzuki.poulose@arm.com> Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
Diffstat (limited to 'virt')
-rw-r--r--virt/kvm/arm/arm.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/virt/kvm/arm/arm.c b/virt/kvm/arm/arm.c
index e960b91551d6..8b7ca101f0f7 100644
--- a/virt/kvm/arm/arm.c
+++ b/virt/kvm/arm/arm.c
@@ -382,6 +382,7 @@ void kvm_arch_vcpu_load(struct kvm_vcpu *vcpu, int cpu)
382 kvm_timer_vcpu_load(vcpu); 382 kvm_timer_vcpu_load(vcpu);
383 kvm_vcpu_load_sysregs(vcpu); 383 kvm_vcpu_load_sysregs(vcpu);
384 kvm_arch_vcpu_load_fp(vcpu); 384 kvm_arch_vcpu_load_fp(vcpu);
385 kvm_vcpu_pmu_restore_guest(vcpu);
385 386
386 if (single_task_running()) 387 if (single_task_running())
387 vcpu_clear_wfe_traps(vcpu); 388 vcpu_clear_wfe_traps(vcpu);
@@ -397,6 +398,7 @@ void kvm_arch_vcpu_put(struct kvm_vcpu *vcpu)
397 kvm_vcpu_put_sysregs(vcpu); 398 kvm_vcpu_put_sysregs(vcpu);
398 kvm_timer_vcpu_put(vcpu); 399 kvm_timer_vcpu_put(vcpu);
399 kvm_vgic_put(vcpu); 400 kvm_vgic_put(vcpu);
401 kvm_vcpu_pmu_restore_host(vcpu);
400 402
401 vcpu->cpu = -1; 403 vcpu->cpu = -1;
402 404