Re: [PATCH v4 10/20] KVM: arm/arm64: Use separate timer for phys timer emulation

Marc Zyngier
2017-10-25T13:59:13Z

On Fri, Oct 20 2017 at 1:49:29 pm BST, Christoffer Dall <christoffer.dall@linaro.org> wrote:
> From: Christoffer Dall <cdall@linaro.org>
>
> 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.
>
> Signed-off-by: Christoffer Dall <cdall@linaro.org>

Acked-by: Marc Zyngier <marc.zyngier@arm.com>

M.
--
Jazz is not dead. It just smells funny.