From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=37305 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OJWEz-0002iw-KW for qemu-devel@nongnu.org; Tue, 01 Jun 2010 14:31:06 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OJWEx-0006Qv-LF for qemu-devel@nongnu.org; Tue, 01 Jun 2010 14:31:05 -0400 Received: from mx1.redhat.com ([209.132.183.28]:63141) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OJWEx-0006Qc-Bd for qemu-devel@nongnu.org; Tue, 01 Jun 2010 14:31:03 -0400 Date: Tue, 1 Jun 2010 21:30:58 +0300 From: Gleb Natapov Subject: Re: [Qemu-devel] Re: [RFT][PATCH 07/15] qemu_irq: Add IRQ handlers with delivery feedback Message-ID: <20100601183058.GB6191@redhat.com> References: <20100530060255.GJ5474@redhat.com> <20100530123316.GB24302@redhat.com> <20100530134935.GC24302@redhat.com> <20100530200722.GA6243@redhat.com> <20100531051905.GD24302@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Blue Swirl Cc: Jan Kiszka , qemu-devel@nongnu.org, Juan Quintela On Tue, Jun 01, 2010 at 06:00:20PM +0000, Blue Swirl wrote: > >> > 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. > > You need to deliver it through IOAPIC. > > In this version, when USE_APIC is defined, IRQs are routed via IOAPIC > and APIC, PIC interrupts are disabled. Otherwise, IOAPIC and APIC are > left to reset state and PIC is used. > > With the PIC version, there are bogus injections. With IOAPIC and APIC > dots come at 2Hz. -enable-kvm has no effect. I looked into this briefly. Virtual wire case is not handled correctly, and pic lacks coalescing detection at all (the reason BTW because proper solution was rejected, so only hack required by Windows was added). Windows routes RTC interrupts through IOAPIC and this case works as you can see. -enable-kvm on qemu should not make any difference since it uses the same userspace pic/ioapic/apic code as TCG. It would be interesting to try with qemu-kvm which uses in-kernel irq chips by default. BTW I managed to compile you test program with gcc 4.2. 4.4 and 4.3 produced non-working binaries for me. -- Gleb.