arm64: arm_pmu: Add !VHE support for exclude_host/exclude_guest attributes
authorAndrew Murray <andrew.murray@arm.com>
Tue, 9 Apr 2019 19:22:13 +0000 (20:22 +0100)
committerMarc Zyngier <marc.zyngier@arm.com>
Wed, 24 Apr 2019 14:35:58 +0000 (15:35 +0100)
commitd1947bc4bc63e56014bb4d812e0db89944ed4a0f
tree61fe62bd264ccd2f02c460fd7929a9b11dd82ef1
parenteb41238cf19fda694e3a99c1f4f58bd88479a5ee
arm64: arm_pmu: Add !VHE support for exclude_host/exclude_guest attributes

Add support for the :G and :H attributes in perf by handling the
exclude_host/exclude_guest event attributes.

We notify KVM of counters that we wish to be enabled or disabled on
guest entry/exit and thus defer from starting or stopping events based
on their event attributes.

With !VHE we switch the counters between host/guest at EL2. We are able
to eliminate counters counting host events on the boundaries of guest
entry/exit when using :G by filtering out EL2 for exclude_host. When
using !exclude_hv there is a small blackout window at the guest
entry/exit where host events are not captured.

Signed-off-by: Andrew Murray <andrew.murray@arm.com>
Acked-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
arch/arm64/kernel/perf_event.c