]> git.karo-electronics.de Git - karo-tx-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>
Sun, 18 May 2008 11:39:39 +0000 (14:39 +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 36809d79788bedffcd8332609c7313175aa09e3a..c297c50eba63535968f72c1596d6a969fb4eb9c9 100644 (file)
@@ -957,7 +957,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;