qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] enabling bus-master IDE driver


From: Jens Axboe
Subject: Re: [Qemu-devel] enabling bus-master IDE driver
Date: Sun, 7 Nov 2004 10:03:28 +0100

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 */

-- 
Jens Axboe





reply via email to

[Prev in Thread] Current Thread [Next in Thread]