From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=51855 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OIp16-0004aN-HC for qemu-devel@nongnu.org; Sun, 30 May 2010 16:21:53 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OIp15-0004XM-D6 for qemu-devel@nongnu.org; Sun, 30 May 2010 16:21:52 -0400 Received: from mail-px0-f173.google.com ([209.85.212.173]:62147) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OIp15-0004XF-8d for qemu-devel@nongnu.org; Sun, 30 May 2010 16:21:51 -0400 Received: by pxi2 with SMTP id 2so1319627pxi.4 for ; Sun, 30 May 2010 13:21:50 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: <20100530200722.GA6243@redhat.com> References: <20100529144641.GF3604@redhat.com> <20100529163709.GJ3604@redhat.com> <20100530060255.GJ5474@redhat.com> <20100530123316.GB24302@redhat.com> <20100530134935.GC24302@redhat.com> <20100530200722.GA6243@redhat.com> From: Blue Swirl Date: Sun, 30 May 2010 20:21:30 +0000 Message-ID: Subject: Re: [Qemu-devel] Re: [RFT][PATCH 07/15] qemu_irq: Add IRQ handlers with delivery feedback Content-Type: text/plain; charset=UTF-8 List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Gleb Natapov Cc: Jan Kiszka , qemu-devel@nongnu.org, Juan Quintela On Sun, May 30, 2010 at 8:07 PM, Gleb Natapov wrote: > On Sun, May 30, 2010 at 07:37:59PM +0000, Blue Swirl wrote: >> On Sun, May 30, 2010 at 1:49 PM, Gleb Natapov wrote: >> > On Sun, May 30, 2010 at 12:56:26PM +0000, Blue Swirl wrote: >> >> >> Well, I'd like to get the test program also trigger it. Now I'm getting: >> >> >> apic: write: 00000350 = 00000000 >> >> >> apic: apic_reset_irq_delivered: old coalescing 0 >> >> >> apic: apic_local_deliver: vector 3 delivery mode 0 >> >> >> apic: apic_set_irq: coalescing 1 >> >> >> apic: apic_get_irq_delivered: returning coalescing 1 >> >> >> apic: apic_reset_irq_delivered: old coalescing 1 >> >> >> apic: apic_local_deliver: vector 3 delivery mode 0 >> >> >> apic: apic_set_irq: coalescing 0 >> >> >> apic: apic_get_irq_delivered: returning coalescing 0 >> >> >> apic: apic_reset_irq_delivered: old coalescing 0 >> >> >> apic: apic_local_deliver: vector 3 delivery mode 0 >> >> >> apic: apic_set_irq: coalescing 0 >> >> >> >> > So interrupt is _alway_ coalesced. If apic_get_irq_delivered() returns >> > 0 it means the interrupt was not delivered. >> >> That seems strange. I changed the program so that the handler gets >> executed, also output a dot to serial from the handler. I changed the >> frequency to 2Hz. >> >> Now, if I leave out -rtc-td-hack, I get the dots at 2Hz as expected. >> With -rtc-td-hack, the dots come out much faster. I added >> DEBUG_COALESCING also to RTC, with that enabled I get: >> qemu -L . -bios coalescing.bin -d in_asm,int -no-hpet -rtc-td-hack -serial stdio >> cmos: coalesced irqs scaled to 0 >> cmos: coalesced irqs increased to 1 >> cmos: injecting on ack >> .cmos: injecting on ack >> .cmos: injecting on ack >> .cmos: injecting on ack >> .cmos: injecting on ack >> .cmos: injecting on ack >> .cmos: injecting on ack >> .cmos: injecting on ack >> .cmos: injecting on ack >> .cmos: injecting on ack >> .cmos: injecting on ack >> .cmos: injecting on ack >> .cmos: injecting on ack >> .cmos: injecting on ack >> .cmos: injecting on ack >> .cmos: injecting on ack >> .cmos: injecting on ack >> .cmos: injecting on ack >> .cmos: injecting on ack >> .cmos: injecting on ack >> ..cmos: injecting from timer >> .cmos: coalesced irqs increased to 2 >> cmos: injecting on ack >> >> So, there are bogus injections. > > Looks like irr in apic is never cleared. Probably bug in userspace apic > emulation. I'll look into it. Try to route interrupt via APIC (not ExtInt), > or use qemu-kvm with in kernel irq chip. With APIC you mean Fixed? Then the IRQ is not delivered at all.