From: Jens Axboe <qemu@kernel.dk>
To: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] enabling bus-master IDE driver
Date: Sun, 7 Nov 2004 10:38:42 +0100 [thread overview]
Message-ID: <20041107093842.GD29120@suse.de> (raw)
In-Reply-To: <20041107092132.GC29120@suse.de>
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
next prev parent reply other threads:[~2004-11-07 9:48 UTC|newest]
Thread overview: 42+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-11-04 20:35 [Qemu-devel] enabling bus-master IDE driver Simon Frew
2004-11-05 13:32 ` zitu
2004-11-05 15:02 ` zitu
2004-11-06 1:53 ` Jason Brittain
2004-11-06 14:27 ` Johannes Schindelin
2004-11-06 21:52 ` Jason Brittain
2004-11-07 9:03 ` Jens Axboe
2004-11-07 9:21 ` Jens Axboe
2004-11-07 9:38 ` Jens Axboe [this message]
2004-11-07 11:01 ` Hetz Ben Hamo
2004-11-07 11:16 ` Jens Axboe
2004-11-08 10:15 ` zitu
2004-11-08 16:51 ` Andreas Bollhalder
2004-11-09 7:38 ` Paul Jakma
2004-11-09 10:28 ` Hetz Ben Hamo
2004-11-09 13:53 ` Paul Jakma
2004-11-11 17:29 ` Jason Brittain
2004-11-11 19:06 ` Jens Axboe
2004-11-11 19:02 ` Jason Brittain
2004-11-11 19:16 ` Jens Axboe
2004-11-12 8:42 ` Jens Axboe
2004-11-07 11:02 ` James Boddington
2004-11-10 1:41 ` James Boddington
2004-11-06 21:57 ` James Boddington
2004-11-06 22:11 ` James Boddington
2004-11-06 23:46 ` zitu
2004-11-07 0:41 ` jeebs
2004-11-07 7:12 ` Jason Brittain
-- strict thread matches above, loose matches on Subject: below --
2004-11-05 15:37 Juergen Keil
2004-11-05 15:43 ` zitu
2004-11-05 15:45 ` zitu
2004-11-05 15:52 ` Jens Axboe
2004-11-05 16:10 ` zitu
2004-11-05 17:30 ` Damien Mascord
2004-11-12 14:27 Juergen Keil
2004-11-12 18:02 ` Jason Brittain
2004-11-12 19:07 Juergen Keil
2004-11-16 19:41 ` Juergen Lock
2004-11-23 5:12 ` Norikatsu Shigemura
2004-11-25 21:12 ` Juergen Lock
2004-11-26 10:48 Juergen Keil
2004-11-28 20:09 ` Juergen Lock
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20041107093842.GD29120@suse.de \
--to=qemu@kernel.dk \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).