From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.33) id 1CQjeY-0008Dk-UA for qemu-devel@nongnu.org; Sun, 07 Nov 2004 04:48:07 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.33) id 1CQjeX-0008DL-Qw for qemu-devel@nongnu.org; Sun, 07 Nov 2004 04:48:06 -0500 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1CQjeX-0008DI-AZ for qemu-devel@nongnu.org; Sun, 07 Nov 2004 04:48:05 -0500 Received: from [195.184.98.160] (helo=virtualhost.dk) by monty-python.gnu.org with esmtp (TLSv1:DES-CBC3-SHA:168) (Exim 4.34) id 1CQjVy-0000Eo-Bx for qemu-devel@nongnu.org; Sun, 07 Nov 2004 04:39:14 -0500 Received: from [62.242.22.158] (helo=zx2000.home.kernel.dk) by virtualhost.dk with esmtp (Exim 3.36 #1) id 1CQjVw-0006Vh-00 for qemu-devel@nongnu.org; Sun, 07 Nov 2004 10:39:12 +0100 Received: from axboe by zx2000.home.kernel.dk with local (Exim 4.30) id 1CQjVS-0007f0-Or for qemu-devel@nongnu.org; Sun, 07 Nov 2004 10:38:42 +0100 Date: Sun, 7 Nov 2004 10:38:42 +0100 From: Jens Axboe Subject: Re: [Qemu-devel] enabling bus-master IDE driver Message-ID: <20041107093842.GD29120@suse.de> References: <1099661520.418b80d07e377@imp5-q.free.fr> <1099666965.418b9615bb36d@imp5-q.free.fr> <418C2E7D.2040609@brittainweb.org> <418D478B.9090007@brittainweb.org> <20041107090328.GB29120@suse.de> <20041107092132.GC29120@suse.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20041107092132.GC29120@suse.de> Sender: Jens Axboe 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 On Sun, Nov 07 2004, Jens Axboe wrote: > On Sun, Nov 07 2004, Jens Axboe wrote: > > On Sat, Nov 06 2004, Jason Brittain wrote: > > > Johannes Schindelin wrote: > > > >Hi, > > > > > > > >On Fri, 5 Nov 2004, Jason Brittain wrote: > > > > > > > > > > > >>/dev/hda: > > > >> setting using_dma to 1 (on) > > > >> HDIO_SET_DMA failed: Operation not permitted > > > >> using_dma = 0 (off) > > > > > > > >Are you sure you did as guest root? This error could happen if you try to > > > >use hdparm as a plain user. > > > > > > I was most certainly logged in as root in the guest Linux > > > when I did that. > > > > I has nothing to do with user privilege, you are most likely getting > > EPERM because the drive doesn't flag dma capability. > > > > put_le16(p + 49, 1 << 9); /* LBA supported, no DMA */ > > > > mask that with 1 << 8 and it'll most likely work. > > > > Index: hw/ide.c > > =================================================================== > > RCS file: /cvsroot/qemu/qemu/hw/ide.c,v > > retrieving revision 1.28 > > diff -u -r1.28 ide.c > > --- hw/ide.c 9 Oct 2004 20:27:55 -0000 1.28 > > +++ hw/ide.c 7 Nov 2004 09:06:33 -0000 > > @@ -416,7 +416,7 @@ > > put_le16(p + 47, 0x8000 | MAX_MULT_SECTORS); > > #endif > > put_le16(p + 48, 1); /* dword I/O */ > > - put_le16(p + 49, 1 << 9); /* LBA supported, no DMA */ > > + put_le16(p + 49, 1 << 9 | 1 << 8); /* DMA and LBA supported */ > > put_le16(p + 51, 0x200); /* PIO transfer cycle */ > > put_le16(p + 52, 0x200); /* DMA transfer cycle */ > > put_le16(p + 53, 1); /* words 54-58 are valid */ > > Did a quick test on a rescue iso boot, works for me. hdparm -t went from > 55MiB/sec in pio to 100MiB/sec with sdma2. SETFEATURES also needs to set SEEK_STAT for successful completion. Then you can switch to udma2 as well. Index: hw/ide.c =================================================================== RCS file: /cvsroot/qemu/qemu/hw/ide.c,v retrieving revision 1.28 diff -u -r1.28 ide.c --- hw/ide.c 9 Oct 2004 20:27:55 -0000 1.28 +++ hw/ide.c 7 Nov 2004 09:41:16 -0000 @@ -1560,7 +1563,7 @@ case 0x82: /* write cache disable */ case 0xaa: /* read look-ahead enable */ case 0x55: /* read look-ahead disable */ - s->status = READY_STAT; + s->status = READY_STAT | SEEK_STAT; ide_set_irq(s); break; default: -- Jens Axboe