]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
KVM: arm64: timer: Don't adjust the EL2 virtual timer offset
authorMarc Zyngier <maz@kernel.org>
Tue, 4 Feb 2025 11:00:50 +0000 (11:00 +0000)
committerMarc Zyngier <maz@kernel.org>
Tue, 4 Feb 2025 15:10:38 +0000 (15:10 +0000)
commit0e459810285503fb354537e84049e212c5917c33
tree69038801ab13b444bf1f50a2467bb4cc6b88bd68
parent1b8705ad5365b5333240b46d5cd24e88ef2ddb14
KVM: arm64: timer: Don't adjust the EL2 virtual timer offset

The way we deal with the EL2 virtual timer is a bit odd.

We try to cope with E2H being flipped, and adjust which offset
applies to that timer depending on the current E2H value. But that's
a complexity we shouldn't have to worry about.

What we have to deal with is either E2H being RES1, in which case
there is no offset, or E2H being RES0, and the virtual timer simply
does not exist.

Drop the adjusting of the timer offset, which makes things a bit
simpler. At the same time, make sure that accessing the HV timer
when E2H is RES0 results in an UNDEF in the guest.

Suggested-by: Oliver Upton <oliver.upton@linux.dev>
Reviewed-by: Oliver Upton <oliver.upton@linux.dev>
Link: https://lore.kernel.org/r/20250204110050.150560-4-maz@kernel.org
Signed-off-by: Marc Zyngier <maz@kernel.org>
arch/arm64/kvm/arch_timer.c
arch/arm64/kvm/sys_regs.c