]> www.infradead.org Git - users/dwmw2/linux.git/commitdiff
KVM: LAPIC: ignore pending timers if LVTT is disabled
authorMarcelo Tosatti <mtosatti@redhat.com>
Wed, 14 May 2008 05:29:06 +0000 (02:29 -0300)
committerAvi Kivity <avi@qumranet.com>
Wed, 14 May 2008 07:53:34 +0000 (10:53 +0300)
Only use the APIC pending timers count to break out of HLT emulation if
the timer vector is enabled.

Certain configurations of Windows simply mask out the vector without
disabling the timer.

Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
Signed-off-by: Avi Kivity <avi@qumranet.com>
arch/x86/kvm/lapic.c

index 7652f88ff1c803e8f01a7e04e101324971021335..d41e34c8de5614db6d78ff8e5213f2d28b47cb5b 100644 (file)
@@ -961,7 +961,7 @@ int apic_has_pending_timer(struct kvm_vcpu *vcpu)
 {
        struct kvm_lapic *lapic = vcpu->arch.apic;
 
-       if (lapic)
+       if (lapic && apic_enabled(lapic) && apic_lvt_enabled(lapic, APIC_LVTT))
                return atomic_read(&lapic->timer.pending);
 
        return 0;