[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] Re: Network connections stalling (due to lost interrupt

From: Jason Wessel
Subject: Re: [Qemu-devel] Re: Network connections stalling (due to lost interrupts/ticks?)
Date: Fri, 03 Aug 2007 07:18:50 -0500
User-agent: Thunderbird (X11/20070719)


Are you willing to try an experimental patch?

Perhaps you could try the attached patch and post back if it happens to solve your problem. There is most definitely a problem where qemu can get hung up indefinitely after an "interrupt storm". I had not ever submitted it because there is no clean way to do this via the opaque information that is passed around. It seems wrong to have to make the ioapic a global. If this does fix the problem perhaps someone will decide to fix this up in a cleaner fashion via the opaque structures.


Charles Duffy wrote:
Charles Duffy wrote:
There's a warning on startup that the system can't set a 1024Hz timer,
which persists even after I set /proc/sys/dev/rtc/max-user-freq to 1024,
and I occasionally get warnings at runtime ("Your time source seems to
be instable or some driver is hogging interrupts").

This was happening because my host kernel was compiled with
CONFIG_HPET_RTC_IRQ=y. I've disabled this option, recompiled and
rebooted, and it resolved the RTC warning (and apparently, the unstable
time source messages) -- but my network connections are still stalling.

Recover from an interupt flood by propagating the end of interrupt state. 

Signed-off-by: Jason Wessel <address@hidden>
 hw/apic.c |   23 +++++++++++++++++++++--
 hw/pc.c   |    2 +-
 2 files changed, 22 insertions(+), 3 deletions(-)

Index: qemu/hw/apic.c
--- qemu.orig/hw/apic.c
+++ qemu/hw/apic.c
@@ -332,6 +332,26 @@ static void apic_set_irq(APICState *s, i
+struct IOAPICState *ioapic;
+/* XXX Multi IOAPIC support */
+static void apic_propogate_eoi(int vector) {
+    uint32_t irr;
+    int pin;
+    if ((vector < 0x10) || (vector > 0xfe))
+        return;
+    irr = ioapic->irr;
+    while (irr) {
+        pin = ffs_bit(irr);
+        irr &= ~(1 << pin);
+        if ((ioapic->ioredtbl[pin] & 0xff) == vector) {
+            ioapic->irr &= ~(1 << pin);
+            break;
+        }
+    }
 static void apic_eoi(APICState *s)
     int isrv;
@@ -339,8 +359,7 @@ static void apic_eoi(APICState *s)
     if (isrv < 0)
     reset_bit(s->isr, isrv);
-    /* XXX: send the EOI packet to the APIC bus to allow the I/O APIC to
-            set the remote IRR bit for level triggered interrupts. */
+    apic_propogate_eoi(isrv);
Index: qemu/hw/pc.c
--- qemu.orig/hw/pc.c
+++ qemu/hw/pc.c
@@ -36,7 +36,7 @@
 static fdctrl_t *floppy_controller;
 static RTCState *rtc_state;
 static PITState *pit;
-static IOAPICState *ioapic;
+extern IOAPICState *ioapic;
 static PCIDevice *i440fx_state;
 static void ioport80_write(void *opaque, uint32_t addr, uint32_t data)

reply via email to

[Prev in Thread] Current Thread [Next in Thread]