diff mbox

[Qemu-devel] KVM: Windows 64-bit troubles with user space irqchip

Message ID 4D4ABB67.9070208@siemens.com (mailing list archive)
State New, archived
Headers show

Commit Message

Jan Kiszka Feb. 3, 2011, 2:27 p.m. UTC
None
diff mbox

Patch

diff --git a/hw/apic.c b/hw/apic.c
index 05a115f..13bd7b4 100644
--- a/hw/apic.c
+++ b/hw/apic.c
@@ -582,6 +582,7 @@  int apic_get_interrupt(DeviceState *d)
 {
     APICState *s = DO_UPCAST(APICState, busdev.qdev, d);
     int intno;
+    int tpr;
 
     /* if the APIC is installed or enabled, we let the 8259 handle the
        IRQs */
@@ -594,8 +595,10 @@  int apic_get_interrupt(DeviceState *d)
     intno = get_highest_priority_int(s->irr);
     if (intno < 0)
         return -1;
-    if (s->tpr && intno <= s->tpr)
+    tpr = s->tpr >> 4;
+    if (tpr && (intno >> 4) <= tpr) {
         return s->spurious_vec & 0xff;
+    }
     reset_bit(s->irr, intno);
     set_bit(s->isr, intno);
     apic_update_irq(s);