KVM: arm/arm64: Use kvm_arm_timer_set/get_reg for guest register traps
authorChristoffer Dall <cdall@linaro.org>
Sat, 17 Jun 2017 06:12:06 +0000 (23:12 -0700)
committerChristoffer Dall <christoffer.dall@linaro.org>
Mon, 6 Nov 2017 15:23:15 +0000 (16:23 +0100)
commitc1b135af8387bc6c6d43ed61a65647c68f231ea1
tree9368b09ce786d7c81f17b1eaeba853bb93fd6ecf
parent5c5196da4e966cc23af6a1576ad2a9e45bed3f99
KVM: arm/arm64: Use kvm_arm_timer_set/get_reg for guest register traps

When trapping on a guest access to one of the timer registers, we were
messing with the internals of the timer state from the sysregs handling
code, and that logic was about to receive more added complexity when
optimizing the timer handling code.

Therefore, since we already have timer register access functions (to
access registers from userspace), reuse those for the timer register
traps from a VM and let the timer code maintain its own consistency.

Signed-off-by: Christoffer Dall <cdall@linaro.org>
Acked-by: Marc Zyngier <marc.zyngier@arm.com>
arch/arm64/kvm/sys_regs.c