From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LtOuy-0001yK-An for qemu-devel@nongnu.org; Mon, 13 Apr 2009 12:21:56 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LtOut-0001wT-L2 for qemu-devel@nongnu.org; Mon, 13 Apr 2009 12:21:56 -0400 Received: from [199.232.76.173] (port=38396 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LtOut-0001wI-DQ for qemu-devel@nongnu.org; Mon, 13 Apr 2009 12:21:51 -0400 Received: from e37.co.us.ibm.com ([32.97.110.158]:57319) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1LtOus-0005kd-Vt for qemu-devel@nongnu.org; Mon, 13 Apr 2009 12:21:51 -0400 Received: from d03relay04.boulder.ibm.com (d03relay04.boulder.ibm.com [9.17.195.106]) by e37.co.us.ibm.com (8.13.1/8.13.1) with ESMTP id n3DGLHeY024434 for ; Mon, 13 Apr 2009 10:21:17 -0600 Received: from d03av03.boulder.ibm.com (d03av03.boulder.ibm.com [9.17.195.169]) by d03relay04.boulder.ibm.com (8.13.8/8.13.8/NCO v9.2) with ESMTP id n3DGLWxH218496 for ; Mon, 13 Apr 2009 10:21:32 -0600 Received: from d03av03.boulder.ibm.com (loopback [127.0.0.1]) by d03av03.boulder.ibm.com (8.12.11.20060308/8.13.3) with ESMTP id n3DGLVR3026033 for ; Mon, 13 Apr 2009 10:21:31 -0600 Message-ID: <49E3669E.6020404@us.ibm.com> Date: Mon, 13 Apr 2009 12:21:50 -0400 From: Beth Kon MIME-Version: 1.0 Subject: Re: [Qemu-devel] [PATCH] Fix timer interrupt routing for non-ACPI guest References: <1239419318.20633.10.camel@localhost.localdomain> In-Reply-To: <1239419318.20633.10.camel@localhost.localdomain> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: bochs-developers@lists.sourceforge.net Ed Swierk wrote: > Qemu 0.10.2 is unable to boot a non-ACPI kernel due to a BIOS bug: > > ENABLING IO-APIC IRQs > ..TIMER: vector=0x31 apic1=0 pin1=0 apic2=-1 pin2=-1 > ..MP-BIOS bug: 8254 timer not connected to IO-APIC > ...trying to set up timer (IRQ0) through the 8259A ... > ..... (found apic 0 pin 0) ... > ....... failed. > ...trying to set up timer as Virtual Wire IRQ... > > The interrupt routing table in the MPTABLE needs to route the timer > interrupt (IRQ 0) to IOAPIC pin 2. > > A similar bug was recently fixed in the ACPI table code. This patch > fixes the problem for non-ACPI guests. > > Signed-off-by: Ed Swierk > > --- > diff --git a/bios/rombios32.c b/bios/rombios32.c > index 7be4216..13d5435 100644 > --- a/bios/rombios32.c > +++ b/bios/rombios32.c > @@ -1173,7 +1173,7 @@ static void mptable_init(void) > putb(&q, 0); /* flags: po=0, el=0 */ > putb(&q, 0); > putb(&q, 0); /* source bus ID = ISA */ > - putb(&q, i); /* source bus IRQ */ > + putb(&q, i == 2 ? 0 : i); /* source bus IRQ */ > putb(&q, ioapic_id); /* dest I/O APIC ID */ > putb(&q, i); /* dest I/O APIC interrupt in */ > } > > > > This was an oversight on my part when I submitted the HPET patches for qemu. I properly modified the ACPI configuration, but missed the non-ACPI case. This patch is not quite correct and I will submit the necessary patch shortly. A bit of the history... This issue surfaced when I implemented the HPET and discovered that Win2k8 would only work if the HPET interrupt was routed to IOAPIC inti2. This is a common configuration (overriding irq0->inti2). The HPET spec states that "Timer 0 will be routed to IRQ0 in the Non-APIC or IRQ2 in the I/O APIC", and Windows appears to expect it regardless of how overrides are reported by the BIOS. So the decision was made to always have the override.