Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.33) id 1C3DhJ-0002Ku-Au for qemu-devel@nongnu.org; Fri, 03 Sep 2004 09:01:46 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.33) id 1C3DhE-0002IC-TL for qemu-devel@nongnu.org; Fri, 03 Sep 2004 09:01:41 -0400 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1C3DhE-0002Hh-KR for qemu-devel@nongnu.org; Fri, 03 Sep 2004 09:01:40 -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 1C3DcA-0003W7-Hw for qemu-devel@nongnu.org; Fri, 03 Sep 2004 08:56:27 -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 i83CuInT000458 for ; Fri, 3 Sep 2004 14:56:18 +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 i83CuILj020249 for ; Fri, 3 Sep 2004 14:56:18 +0200 (CEST) Message-Id: <200409031256.i83CuILj020249@tiger2.tools.intra> Date: Fri, 3 Sep 2004 14:56:18 +0200 (CEST) From: Juergen Keil Subject: Re: [Qemu-devel] qemu and solaris, suggested pci-ide DMA PATCH MIME-Version: 1.0 Content-Type: TEXT/plain; charset=us-ascii Content-MD5: Im/aRGJ/01c9CH6RZauoOQ== 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 I wrote: > 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. The following patch changes the qemu pci-ide device to report a "pci buster master ide controller" instead of a "pci ide controller (without bus master support)". With that patch installed, a Solaris x86 guest os starts using DMA ide transfers. Maximum transfer rates on the qemu ide hdd doubles (I observe ~10MByte/sec in DMA mode vs. ~5MByte/sec in PIO mode). (The patch includes the busmaster status register patch I send two days ago, to enable the pci-ide controller for Solaris x86 in qemu "-pci" mode) Index: hw/ide.c =================================================================== RCS file: /cvsroot/qemu/qemu/hw/ide.c,v retrieving revision 1.26 diff -u -B -u -6 -r1.26 ide.c --- hw/ide.c 25 Jun 2004 14:54:19 -0000 1.26 +++ hw/ide.c 3 Sep 2004 12:45:14 -0000 @@ -495,12 +495,16 @@ s->error = ABRT_ERR; } static inline void ide_set_irq(IDEState *s) { if (!(s->cmd & IDE_CMD_DISABLE_IRQ)) { + BMDMAState *bm = s->bmdma; + if(bm) + bm->status |= BM_STATUS_INT; + #ifdef TARGET_PPC if (s->openpic) openpic_set_irq(s->openpic, s->irq, 1); else #endif if (s->irq == 16) @@ -2152,12 +2156,13 @@ NULL, NULL); pci_conf = d->dev.config; pci_conf[0x00] = 0x86; // Intel pci_conf[0x01] = 0x80; pci_conf[0x02] = 0x10; pci_conf[0x03] = 0x70; + pci_conf[0x09] = 0x8a; // programming interface = PCI_IDE bus master is supported pci_conf[0x0a] = 0x01; // class_sub = PCI_IDE pci_conf[0x0b] = 0x01; // class_base = PCI_mass_storage pci_conf[0x0e] = 0x00; // header_type pci_register_io_region((PCIDevice *)d, 4, 0x10, PCI_ADDRESS_SPACE_IO, bmdma_map);