KVM: arm64: timers: Allow physical offset without CNTPOFF_EL2
authorMarc Zyngier <maz@kernel.org>
Thu, 30 Mar 2023 17:47:45 +0000 (18:47 +0100)
committerMarc Zyngier <maz@kernel.org>
Thu, 30 Mar 2023 18:01:09 +0000 (19:01 +0100)
commitc605ee245097d02ed5933e63ac601a8571712457
tree5a35a28bef8ead75576483e2d24e67bcc3b77267
parent2b4825a8694018901e641ccc2eafd0fff58d1415
KVM: arm64: timers: Allow physical offset without CNTPOFF_EL2

CNTPOFF_EL2 is awesome, but it is mostly vapourware, and no publicly
available implementation has it. So for the common mortals, let's
implement the emulated version of this thing.

It means trapping accesses to the physical counter and timer, and
emulate some of it as necessary.

As for CNTPOFF_EL2, nobody sets the offset yet.

Reviewed-by: Colton Lewis <coltonlewis@google.com>
Signed-off-by: Marc Zyngier <maz@kernel.org>
Link: https://lore.kernel.org/r/20230330174800.2677007-6-maz@kernel.org
arch/arm64/include/asm/sysreg.h
arch/arm64/kvm/arch_timer.c
arch/arm64/kvm/hyp/nvhe/timer-sr.c
arch/arm64/kvm/sys_regs.c