arm64: KVM: Enable !VHE support for :G/:H perf event modifiers
authorAndrew Murray <andrew.murray@arm.com>
Tue, 9 Apr 2019 19:22:14 +0000 (20:22 +0100)
committerMarc Zyngier <marc.zyngier@arm.com>
Wed, 24 Apr 2019 14:36:22 +0000 (15:36 +0100)
commit3d91befbb3a0fcec6e1eebde45c8074b88cc9441
treedc87926a4232a95959cc882fb6c9bed5be26a9dd
parentd1947bc4bc63e56014bb4d812e0db89944ed4a0f
arm64: KVM: Enable !VHE support for :G/:H perf event modifiers

Enable/disable event counters as appropriate when entering and exiting
the guest to enable support for guest or host only event counting.

For both VHE and non-VHE we switch the counters between host/guest at
EL2.

The PMU may be on when we change which counters are enabled however
we avoid adding an isb as we instead rely on existing context
synchronisation events: the eret to enter the guest (__guest_enter)
and eret in kvm_call_hyp for __kvm_vcpu_run_nvhe on returning.

Signed-off-by: Andrew Murray <andrew.murray@arm.com>
Reviewed-by: Suzuki K Poulose <suzuki.poulose@arm.com>
Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
arch/arm64/include/asm/kvm_host.h
arch/arm64/kvm/hyp/switch.c
arch/arm64/kvm/pmu.c