KVM: arm64: Reduce overhead of trapped timer sysreg accesses
authorMarc Zyngier <maz@kernel.org>
Thu, 12 Jan 2023 12:38:28 +0000 (12:38 +0000)
committerOliver Upton <oliver.upton@linux.dev>
Thu, 26 Jan 2023 18:48:47 +0000 (18:48 +0000)
commitfc6ee952cf0008fb4a60dd8e539d9f17decaabe5
tree46e7f3738e265c94bf8e2cee709672b34388e76a
parent4d74ecfa6458bf482d93ad9a98c7f0423ff0564b
KVM: arm64: Reduce overhead of trapped timer sysreg accesses

Each read/write to a trapped timer system register results
in a whole kvm_timer_vcpu_put/load() cycle which affects all
of the timers, and a bit more.

There is no need for such a thing, and we can limit the impact
to the timer being affected, and only this one.

This drastically simplifies the emulated case, and limits the
damage for trapped accesses. This also brings some performance
back for NV.

Whilst we're at it, fix a comment that didn't quite capture why
we always set CNTVOFF_EL2 to 0 when disabling the virtual timer.

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