KVM: arm64: Pass pmu events to hyp via vcpu
authorFuad Tabba <tabba@google.com>
Tue, 10 May 2022 09:57:09 +0000 (09:57 +0000)
committerMarc Zyngier <maz@kernel.org>
Sun, 15 May 2022 10:26:41 +0000 (11:26 +0100)
commit84d751a019a9792f5b4884e1d598b603c360ec22
tree45c30035eb85762da5cf6b98ab2a4f339e059992
parente987a4c60f9755b2f7a19bf1b5ef2eb74c90579b
KVM: arm64: Pass pmu events to hyp via vcpu

Instead of the host accessing hyp data directly, pass the pmu
events of the current cpu to hyp via the vcpu.

This adds 64 bits (in two fields) to the vcpu that need to be
synced before every vcpu run in nvhe and protected modes.
However, it isolates the hypervisor from the host, which allows
us to use pmu in protected mode in a subsequent patch.

No visible side effects in behavior intended.

Signed-off-by: Fuad Tabba <tabba@google.com>
Reviewed-by: Oliver Upton <oupton@google.com>
Signed-off-by: Marc Zyngier <maz@kernel.org>
Link: https://lore.kernel.org/r/20220510095710.148178-4-tabba@google.com
arch/arm64/include/asm/kvm_host.h
arch/arm64/kvm/arm.c
arch/arm64/kvm/hyp/nvhe/switch.c
arch/arm64/kvm/pmu.c
include/kvm/arm_pmu.h