arm64: KVM: Add accessors to track guest/host only counters
authorAndrew Murray <andrew.murray@arm.com>
Tue, 9 Apr 2019 19:22:12 +0000 (20:22 +0100)
committerMarc Zyngier <marc.zyngier@arm.com>
Wed, 24 Apr 2019 14:35:30 +0000 (15:35 +0100)
commiteb41238cf19fda694e3a99c1f4f58bd88479a5ee
treec96096fc7b28a5d0d5969e882a9cd39d946544b1
parent630a16854d2d28d13e96ff27ab43cc5caa4609fc
arm64: KVM: Add accessors to track guest/host only counters

In order to effeciently switch events_{guest,host} perf counters at
guest entry/exit we add bitfields to kvm_cpu_context for guest and host
events as well as accessors for updating them.

A function is also provided which allows the PMU driver to determine
if a counter should start counting when it is enabled. With exclude_host,
we may only start counting when entering the guest.

Signed-off-by: Andrew Murray <andrew.murray@arm.com>
Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
arch/arm64/include/asm/kvm_host.h
arch/arm64/kvm/Makefile
arch/arm64/kvm/pmu.c [new file with mode: 0644]