KVM: arm64: nv: timers: Support hyp timer emulation
authorMarc Zyngier <maz@kernel.org>
Thu, 30 Mar 2023 17:47:57 +0000 (18:47 +0100)
committerMarc Zyngier <maz@kernel.org>
Thu, 30 Mar 2023 18:01:10 +0000 (19:01 +0100)
commit81dc9504a7006b484cfcf074796094ee526b0c45
treec37c08f09c10a94f729d72457c43172fc287b3de
parent1e0eec09d43a55125ff80e40b2d6e2f369a338b9
KVM: arm64: nv: timers: Support hyp timer emulation

Emulating EL2 also means emulating the EL2 timers. To do so, we expand
our timer framework to deal with at most 4 timers. At any given time,
two timers are using the HW timers, and the two others are purely
emulated.

The role of deciding which is which at any given time is left to a
mapping function which is called every time we need to make such a
decision.

Reviewed-by: Colton Lewis <coltonlewis@google.com>
Co-developed-by: Christoffer Dall <christoffer.dall@arm.com>
Signed-off-by: Christoffer Dall <christoffer.dall@arm.com>
Signed-off-by: Marc Zyngier <maz@kernel.org>
Link: https://lore.kernel.org/r/20230330174800.2677007-18-maz@kernel.org
arch/arm64/include/asm/kvm_host.h
arch/arm64/include/uapi/asm/kvm.h
arch/arm64/kvm/arch_timer.c
arch/arm64/kvm/hyp/include/hyp/switch.h
arch/arm64/kvm/trace_arm.h
arch/arm64/kvm/vgic/vgic.c
include/kvm/arm_arch_timer.h
include/kvm/arm_vgic.h