]> www.infradead.org Git - users/jedix/linux-maple.git/commit
KVM: arm64: nv: Handle CNTHCTL_EL2 specially
authorMarc Zyngier <maz@kernel.org>
Wed, 23 Oct 2024 14:53:14 +0000 (15:53 +0100)
committerOliver Upton <oliver.upton@linux.dev>
Thu, 31 Oct 2024 02:42:29 +0000 (02:42 +0000)
commit164b5e20cdf6038f1b38867d2f6252ec6f10c356
tree6894bd0f2d469d83a822f07475999655825d4663
parentdfeb91686992f5a973d09b66ddedf458de1acf08
KVM: arm64: nv: Handle CNTHCTL_EL2 specially

Accessing CNTHCTL_EL2 is fraught with danger if running with
HCR_EL2.E2H=1: half of the bits are held in CNTKCTL_EL1, and
thus can be changed behind our back, while the rest lives
in the CNTHCTL_EL2 shadow copy that is memory-based.

Yes, this is a lot of fun!

Make sure that we merge the two on read access, while we can
write to CNTKCTL_EL1 in a more straightforward manner.

Signed-off-by: Marc Zyngier <maz@kernel.org>
Link: https://lore.kernel.org/r/20241023145345.1613824-7-maz@kernel.org
Signed-off-by: Oliver Upton <oliver.upton@linux.dev>
arch/arm64/kvm/sys_regs.c
include/kvm/arm_arch_timer.h