KVM: arm/arm64: Avoid phys timer emulation in vcpu entry/exit
authorChristoffer Dall <cdall@linaro.org>
Sun, 18 Jun 2017 08:42:55 +0000 (01:42 -0700)
committerChristoffer Dall <christoffer.dall@linaro.org>
Mon, 6 Nov 2017 15:23:16 +0000 (16:23 +0100)
commitbbdd52cfcba290560909498c7d5681f19894587b
treefe96c7c42ee4f850676027263e83ddbfa1e611db
parentcda93b7aa4657f2a9df28d56df8259226be8b0e9
KVM: arm/arm64: Avoid phys timer emulation in vcpu entry/exit

There is no need to schedule and cancel a hrtimer when entering and
exiting the guest, because we know when the physical timer is going to
fire when the guest programs it, and we can simply program the hrtimer
at that point.

Now when the register modifications from the guest go through the
kvm_arm_timer_set/get_reg functions, which always call
kvm_timer_update_state(), we can simply consider the timer state in this
function and schedule and cancel the timers as needed.

This avoids looking at the physical timer emulation state when entering
and exiting the VCPU, allowing for faster servicing of the VM when
needed.

Signed-off-by: Christoffer Dall <cdall@linaro.org>
Reviewed-by: Marc Zyngier <marc.zyngier@arm.com>
virt/kvm/arm/arch_timer.c