Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.33) id 1C2X2O-0002rC-3z for qemu-devel@nongnu.org; Wed, 01 Sep 2004 11:28:40 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.33) id 1C2X2M-0002qo-D9 for qemu-devel@nongnu.org; Wed, 01 Sep 2004 11:28:39 -0400 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1C2X2M-0002qe-Ax for qemu-devel@nongnu.org; Wed, 01 Sep 2004 11:28:38 -0400 Received: from [192.76.135.70] (helo=kurt.tools.de) by monty-python.gnu.org with esmtp (TLSv1:DES-CBC3-SHA:168) (Exim 4.34) id 1C2WxH-0002rC-93 for qemu-devel@nongnu.org; Wed, 01 Sep 2004 11:23:24 -0400 Received: from tiger2.tools.intra (tiger2.tools.intra [172.20.0.11]) by kurt.tools.de (8.12.11/8.12.11) with ESMTP id i81FNDCa004447 for ; Wed, 1 Sep 2004 17:23:14 +0200 (MEST) Received: from tiger2.tools.intra (tiger2.tools.intra [IPv6:2::20:208:c7ff:feaa:83b8]) by tiger2.tools.intra (8.12.10+Sun/8.12.10) with SMTP id i81FNDLj008562 for ; Wed, 1 Sep 2004 17:23:13 +0200 (CEST) Message-Id: <200409011523.i81FNDLj008562@tiger2.tools.intra> Date: Wed, 1 Sep 2004 17:23:13 +0200 (CEST) From: Juergen Keil Subject: Re: [Qemu-devel] qemu and solaris, suggested pci-ide PATCH MIME-Version: 1.0 Content-Type: TEXT/plain; charset=ISO-8859-1 Content-Transfer-Encoding: QUOTED-PRINTABLE Content-MD5: qFirgANyGwOHvqKGeLK/jQ== Reply-To: Juergen Keil , 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 Hi, I'm playing with qemu 0.6.0 running on a Solaris x86 system, trying to install Solaris 9 / 10 x86 in qemu. I've run into the problem with timeout errors beeing reported by the Solaris ata driver when the pci-ide hardware device is in use in qemu (-pci). The timeouts are not reported when an isa ide device is in use (-isa). This problem was reported earlier, for example here: > From: =09Paul Jakma > Subject: =09[Qemu-devel] qemu and solaris > Date: =09Mon, 19 Jul 2004 16:11:00 +0100 (IST) > > - PCI IDE does not work. Drive access times out and pci-ide (eventually) = will=20 > print out error code=3D0x03. > > With the ISA 'ata' driver it works fine. As far as I understand it, the Solaris ata driver does not use DMA transfers with the "pci-ide" qemu hardware, because the "bus master support indicator" bit in pci configuration space offset 09h is not set. The message from the Solaris 10 b63 kernel is something like: "ATA DMA off: cntrl not Bus Master DMA capable" So it'll fall back to PIO mode transfers. PIO transfers may be slow, but that's OK, so far. In the ata interrupt handler, the Solaris ata driver checks the "bus master status register" when it receives an ide interrupt, and expects to see the bit 2 set (BM_STATUS_INT, 0x04). Problem is, the qemu pci-ide hardware does not set the BM_STATUS_INT bit when it generates an interrupt for a completed ide command (For booting from the cdrom, this would be an ATAPI INQUIRY command). The BM_STATUS_INT bit is only set when an ide DMA transfer completes. The following patch fixes the problem for me. It asserts the IDE interrupt status bit 2 in the "bus master ide status register" whenever an interrupt is generated. With this patch installed, Solaris x86 is able to boot both from the qemu cdrom and qemu hdd in -pci mode. Index: ide.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /cvsroot/qemu/qemu/hw/ide.c,v retrieving revision 1.26 diff -u -B -6 -r1.26 ide.c --- ide.c 25 Jun 2004 14:54:19 -0000 1.26 +++ ide.c 1 Sep 2004 15:02:03 -0000 @@ -495,12 +495,16 @@ s->error =3D ABRT_ERR; } =20 static inline void ide_set_irq(IDEState *s) { if (!(s->cmd & IDE_CMD_DISABLE_IRQ)) { + BMDMAState *bm =3D s->bmdma; + if(bm) + bm->status |=3D BM_STATUS_INT; + #ifdef TARGET_PPC if (s->openpic)=20 openpic_set_irq(s->openpic, s->irq, 1); else=20 #endif if (s->irq =3D=3D 16) -- J=FCrgen Keil =09=09jk@tools.de Tools GmbH=09=09=09+49 (228) 9858011