• Christoffer Dall's avatar
    KVM: arm/arm64: Use separate timer for phys timer emulation · f2a2129e
    Christoffer Dall authored
    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: default avatarMarc Zyngier <marc.zyngier@arm.com>
    Signed-off-by: default avatarChristoffer Dall <cdall@linaro.org>
    f2a2129e
arch_timer.c 21 KB