Skip to content

Commit 619f51d

Browse files
Wanpeng Libonzini
authored andcommitted
KVM: LAPIC: Drop pending LAPIC timer injection when canceling the timer
The timer is disarmed when switching between TSC deadline and other modes; however, the pending timer is still in-flight, so let's accurately remove any traces of the previous mode. Fixes: 4427593 ("KVM: x86: thoroughly disarm LAPIC timer around TSC deadline switch") Signed-off-by: Wanpeng Li <[email protected]> Signed-off-by: Paolo Bonzini <[email protected]>
1 parent 0547758 commit 619f51d

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

arch/x86/kvm/lapic.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1548,6 +1548,7 @@ static void cancel_apic_timer(struct kvm_lapic *apic)
15481548
if (apic->lapic_timer.hv_timer_in_use)
15491549
cancel_hv_timer(apic);
15501550
preempt_enable();
1551+
atomic_set(&apic->lapic_timer.pending, 0);
15511552
}
15521553

15531554
static void apic_update_lvtt(struct kvm_lapic *apic)

0 commit comments

Comments
 (0)