• Christoffer Dall's avatar
    KVM: arm/arm64: Simplify bg_timer programming · accb99bc
    Christoffer Dall authored
    Instead of calling into kvm_timer_[un]schedule from the main kvm
    blocking path, test if the VCPU is on the wait queue from the load/put
    path and perform the background timer setup/cancel in this path.
    
    This has the distinct advantage that we no longer race between load/put
    and schedule/unschedule and programming and canceling of the bg_timer
    always happens when the timer state is not loaded.
    
    Note that we must now remove the checks in kvm_timer_blocking that do
    not schedule a background timer if one of the timers can fire, because
    we no longer have a guarantee that kvm_vcpu_check_block() will be called
    before kvm_timer_blocking.
    Reported-by: default avatarAndre Przywara <andre.przywara@arm.com>
    Signed-off-by: default avatarChristoffer Dall <christoffer.dall@arm.com>
    Signed-off-by: default avatarMarc Zyngier <marc.zyngier@arm.com>
    accb99bc
arch_timer.c 24.5 KB