]> git.baikalelectronics.ru Git - kernel.git/commit
arm64: KVM: Enable VHE support for :G/:H perf event modifiers
authorAndrew Murray <andrew.murray@arm.com>
Tue, 9 Apr 2019 19:22:15 +0000 (20:22 +0100)
committerMarc Zyngier <marc.zyngier@arm.com>
Wed, 24 Apr 2019 14:46:26 +0000 (15:46 +0100)
commitd5e977fb33fba6eff4332235afb6621e8ac0a908
treeb3ad2d97114ca99f78c6edcc76c7b0e1446df91b
parent990ebdfa94de986c252bf8ab3966d48169ac7024
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>
arch/arm/include/asm/kvm_host.h
arch/arm64/include/asm/kvm_host.h
arch/arm64/kernel/perf_event.c
arch/arm64/kvm/pmu.c
arch/arm64/kvm/sys_regs.c
virt/kvm/arm/arm.c