From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Lt7Vz-0001sv-UI for qemu-devel@nongnu.org; Sun, 12 Apr 2009 17:46:59 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Lt7Vu-0001rA-Vf for qemu-devel@nongnu.org; Sun, 12 Apr 2009 17:46:59 -0400 Received: from [199.232.76.173] (port=38180 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Lt7Vu-0001r6-Ss for qemu-devel@nongnu.org; Sun, 12 Apr 2009 17:46:54 -0400 Received: from mail-qy0-f111.google.com ([209.85.221.111]:47300) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1Lt7Vu-0003UI-FD for qemu-devel@nongnu.org; Sun, 12 Apr 2009 17:46:54 -0400 Received: by qyk9 with SMTP id 9so2999864qyk.4 for ; Sun, 12 Apr 2009 14:46:52 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: <6F64D9258BE74551983017A7F9B94472@FSCPC> References: <1239419318.20633.10.camel@localhost.localdomain> <6F64D9258BE74551983017A7F9B94472@FSCPC> Date: Sun, 12 Apr 2009 14:46:52 -0700 Message-ID: <9ae48b020904121446k70ca257v30a17754f374ce5a@mail.gmail.com> From: Ed Swierk Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Subject: [Qemu-devel] Re: [PATCH] Fix timer interrupt routing for non-ACPI guest Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Sebastian Herbszt Cc: bochs-developers@lists.sourceforge.net, qemu-devel@nongnu.org On Sun, Apr 12, 2009 at 6:51 AM, Sebastian Herbszt wrote: > 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=3D0x31 apic1=3D0 pin1=3D0 apic2=3D= -1 pin2=3D-1 >> ..MP-BIOS bug: 8254 timer not connected to IO-APIC ...trying to set up t= imer >> (IRQ0) through the 8259A ... ..... (found apic 0 pin 0) ... ....... fail= ed. >> ...trying to set up timer as Virtual Wire IRQ... > > I tried Linux 2.6.27.7 and it seems to hang after > "...trying to set up timer as Virtual Wire IRQ...". > > On 2.6.25.5 it managed to use Virtual Wire mode: > > ..TIMER: vector=3D0x31 apic1=3D0 pin1=3D0 apic2=3D-1 pin2=3D-1 > ..MP-BIOS bug: 8254 timer not connected to IO-APIC > ...trying to set up timer (IRQ0) through the 8259A ... =A0failed. > ...trying to set up timer as Virtual Wire IRQ... works. > testing the IO APIC....................... > .................................... done. Hmm, I guess the kernel got more picky since 2.6.25. >> The interrupt routing table in the MPTABLE needs to route the timer >> interrupt (IRQ 0) to IOAPIC pin 2. > > Do you refer here to "5.3 Assigning of I/O Interrupts to the APIC I/O Uni= t" > from MultiProcessor Specification 1.4 or some other documentation? I confess I haven't checked actual documentation; instead I've referred to code from Coreboot that seems to work. For example the bus_isa interrupts at http://tracker.coreboot.org/trac/coreboot/browser/trunk/coreboot-v2/src/mai= nboard/msi/ms9185/mptable.c . >> A similar bug was recently fixed in the ACPI table code. > > Can you point me to the patch? See the change to acpi_bios_init() in http://git.kernel.org/?p=3Dvirt/bochs/bochs.git;a=3Dcommitdiff;h=3Db494def0= e417778ed814692ce1db06cca3a757cf . >> This patch fixes the problem for non-ACPI guests. > > Linux displays the following without any patch: > > Int: type 0, pol 0, trig 0, bus 00, IRQ 00, APIC ID 1, APIC INT 00 > Int: type 0, pol 0, trig 0, bus 00, IRQ 01, APIC ID 1, APIC INT 01 > Int: type 0, pol 0, trig 0, bus 00, IRQ 02, APIC ID 1, APIC INT 02 > Int: type 0, pol 0, trig 0, bus 00, IRQ 03, APIC ID 1, APIC INT 03 > ... > ..TIMER: vector=3D0x31 apic1=3D0 pin1=3D0 apic2=3D-1 pin2=3D-1 > > [older Linux output] > IRQ to pin mappings: > IRQ0 -> 0:0 > IRQ1 -> 0:1 > IRQ2 -> 0:2 > IRQ3 -> 0:3 > > With your patch it's: > > Int: type 0, pol 0, trig 0, bus 00, IRQ 00, APIC ID 1, APIC INT 00 > Int: type 0, pol 0, trig 0, bus 00, IRQ 01, APIC ID 1, APIC INT 01 > Int: type 0, pol 0, trig 0, bus 00, IRQ 00, APIC ID 1, APIC INT 02 > Int: type 0, pol 0, trig 0, bus 00, IRQ 03, APIC ID 1, APIC INT 03 > ... > ..TIMER: vector=3D0x31 apic1=3D0 pin1=3D0 apic2=3D-1 pin2=3D-1 > > [older Linux output] > IRQ to pin mappings: > IRQ0 -> 0:0-> 0:2 > IRQ1 -> 0:1 > IRQ3 -> 0:3 > > Is this mapping correct or should it rather be the following? > > ..TIMER: vector=3D0x31 apic1=3D0 pin1=3D2 apic2=3D-1 pin2=3D-1 > > IRQ0 -> 0:2 > IRQ1 -> 0:1 > IRQ3 -> 0:3 I suspect the latter is correct but I don't know that it really makes a difference, at least to Linux. --Ed