]> git.baikalelectronics.ru Git - kernel.git/commit
KVM: arm/arm64: Use separate timer for phys timer emulation
authorChristoffer Dall <cdall@linaro.org>
Sun, 18 Jun 2017 07:32:08 +0000 (00:32 -0700)
committerChristoffer Dall <christoffer.dall@linaro.org>
Mon, 6 Nov 2017 15:23:12 +0000 (16:23 +0100)
commitba05faf3f61ead03250111d063c864e3d9e2881e
tree02b8a911c717be93bc7658b95560fb175047e74c
parent5b34a2777fb24352a8ece02f34c0d76296385913
KVM: arm/arm64: Use separate timer for phys timer emulation

We were using the same hrtimer for emulating the physical timer and for
making sure a blocking VCPU thread would be eventually woken up.  That
worked fine in the previous arch timer design, but as we are about to
actually use the soft timer expire function for the physical timer
emulation, change the logic to use a dedicated hrtimer.

This has the added benefit of not having to cancel any work in the sync
path, which in turn allows us to run the flush and sync with IRQs
disabled.

Note that the hrtimer used to program the host kernel's timer to
generate an exit from the guest when the emulated physical timer fires
never has to inject any work, and to share the soft_timer_cancel()
function with the bg_timer, we change the function to only cancel any
pending work if the pointer to the work struct is not null.

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