enabling bus-master IDE driver
Hi, I'm new, just started using qemu; my configuration is:
host: smp linux 2.4.27 kernel (knoppix 3.6)
guest: win2k + sp2
hardware: amd athlon 1.8 1GB ram
Running qemu with 512mb ram. Seems to work fine, but guest o/s installation was very slow. So after reading through previous posts on here I found the patch posted previously to enable dma for ide, and have applied that to ide.c and rebuilt qemu. Then in windows go to device manager and see what it thinks is installed. Device manager says I have a Intel 82371SB PCI Bus Master IDE controller. So I right-click on "Primary IDE channel" and look in properties->advanced settings. Transfer Mode is set to "DMA if available" and current transfer mode says "PIO mode". So it still seems to be in PIO mode!
Does that mean that the patch doesn't work? Do I have to do something else to make dma work?
The patch I've used is here:
http://lists.gnu.org/archive/html/qemu-devel/2004-09/msg00099.html
qemu version is 0.6.0 downloaded yesterday.
I installed qemu as a non-root user and am not running as root. I have changed the rtc timer as it asked when I started it the first time. qemu invocation is
qemu -m 512 -hda disk.img -cdrom /dev/cdrom -boot c
where disk.img is the w2k disk image built by installing windows.
Please can someone tell me how to fully enable dma for disk access? I really want to improve the performance because it's slow.
_________________________________________________________________
Stay in touch with absent friends - get MSN Messenger http://www.msn.co.uk/messenger
Quoting Simon Frew <[email protected]>:
Quoted 11 lines
Running qemu with 512mb ram. Seems to work fine, but guest o/s installation was very slow. So after reading through previous posts on here I found the patch posted previously to enable dma for ide, and have applied that to
ide.c
and rebuilt qemu. Then in windows go to device manager and see what it thinks
is installed. Device manager says I have a Intel 82371SB PCI Bus Master IDE controller. So I right-click on "Primary IDE channel" and look inproperties->advancedsettings. Transfer Mode is set to "DMA if available" and current transfer mode says "PIO mode". So it still seems to be in PIO mode!
I have the same problem inside XP guest too. Linux guest seems really in DMA mode, since my transfer rates go from 17MB to 47MB on a 512MB hdd image.
Quoted 3 lines
Does that mean that the patch doesn't work? Do I have to do something else to make dma work?
I think this patch is almost complete for linux and solaris guests. Some more work/init is needed inside XP/NT/2K. Anyone around with this knowledge ?
Zitu
--
Quoting zitu <[email protected]>:
Quoted 7 lines
Quoted 3 lines
Does that mean that the patch doesn't work? Do I have to do something else to make dma work?
I think this patch is almost complete for linux and solaris guests. Some more work/init is needed inside XP/NT/2K. Anyone around with this knowledge ?
answering to myself... :)
WIN_WRITEDMA_EXT & WIN_READDMA_EXT cases are not defined in hw/ide.c I have no idea where to start to write a patch for these... :(
Until these and the atapi_dma are set/defined, no dma should work IMHO. And this seems not to be OS dependant.
Which means the linux figures I got were wrong ???
Zitu
--
Quoted 11 lines · zitu
Quoting zitu <[email protected]>:
Quoted 6 lines
Quoted 2 lines
Does that mean that the patch doesn't work? Do I have to do something else to make dma work?
I think this patch is almost complete for linux and solaris guests. Some more work/init is needed inside XP/NT/2K. Anyone around with this knowledge ?
answering to myself... :)
Quoted 7 lines
WIN_WRITEDMA_EXT&WIN_READDMA_EXTcases are not defined inhw/ide.cI have no idea where to start to write a patch for these... :(Until these and the
atapi_dmaare set/defined, no dma should work IMHO. And this seems not to be OS dependant.Which means the linux figures I got were wrong ???
My Linux (kernel 2.6) guest's disk seems slow too. I applied the DMA patch, and at first it seemed faster (it may be a bit faster). But, I tried using hdparm -d1 /dev/hda to make sure DMA was turned on in the guest Linux and it said:
/dev/hda:
setting using_dma to 1 (on)
HDIO_SET_DMA failed: Operation not permitted
using_dma = 0 (off)
So I'm pretty sure DMA doesn't work with this patch even with a Linux guest -- at least in my setup.
Signature · 1 line
Jason Brittain
Hi,
Quoted 4 lines · Jason Brittain
/dev/hda:
settingusing_dmato 1 (on)
HDIO_SET_DMAfailed: 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 would expect a different error if the drive is not capable of doing DMA.
Ciao,
Dscho
Quoted 11 lines · Johannes Schindelin
Hi,
Quoted 4 lines · Jason Brittain
/dev/hda:
settingusing_dmato 1 (on)
HDIO_SET_DMAfailed: Operation not permitted
using_dma= 0 (off)
Quoted 4 lines
Are you sure you did as guest root? This error could happen if you try to use hdparm as a plain user. I would expect a different error if the drive is not capable of doing DMA.
I am getting the same error with the latest from cvs and with 0.6.0. Tired both with and without the busmaster patch. Definately logged in as root.
This is what I get during boot.
PIIX3: IDE controller at PCI slot 0000:00:01.1
PIIX3: chipset revision 0
PIIX3: not 100% native mode: will probe irqs later
PCI: Setting latency timer of device 0000:00:01.1 to 64
ide0: BM-DMA at 0xc000-0xc007, BIOS settings: hda:pio, hdb:pio
ide1: BM-DMA at 0xc008-0xc00f, BIOS settings: hdc:pio, hdd:pioI found 2000 is using pio as well.
Signature · 1 line
James
Quoted 5 lines · Johannes Schindelin
Hi,
On Fri, 5 Nov 2004, Jason Brittain wrote:
Quoted 7 lines
Quoted 4 lines
/dev/hda:
settingusing_dmato 1 (on)
HDIO_SET_DMAfailed: 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.
Quoted 2 lines
I would expect a different error if the drive
is not capable of doing DMA.
Well, I haven't seen other situations where drives were incapable of DMA, so I don't know, but "Operation not permitted" seems to fit.
How else should I check whether DMA can be turned on?
Signature · 1 line
Jason Brittain
Quoted 2 lines · James Boddington
I found 2000 is using pio as well.
I'll change that. It is with 2000 + sp4. I am getting pio on the primary ide and dma on the secondary ide channel.
Signature · 1 line
James
Quoting James Boddington <[email protected]>:
Quoted 8 lines
Quoted 2 lines · James Boddington
I found 2000 is using pio as well.
I'll change that. It is with 2000 + sp4. I am getting pio on the primary ide and dma on the secondary ide channel.
on xp, it's PIO for both. DMA if available only on primary (hdd).
For linux guest, as root, hdparm -d0/-d1 doesn't work.
But with the DMA patch, you should see DMA is on with the following:
'hdparm /dev/hda'
It's also visible in /proc/ide/hda/settings :)
Based on the microsoft link I was sent yesterday, and numerous experiments, win95 native 82371SB driver is not working with qemu. The debug hint sent yesterday show dma capability at low level, but DMA is always disabled inside hardware manager.
Low level debug show real DMA access for both bbs-2.1 and dls-0.8.0 It's not just a kernel message or a hdparm.
This is an output of a linux session (dsl)
1 WIN_READ
1 WIN_READ_NATIVE_MAX
1 WIN_RECAL
1 WIN_SETMULT
1 WIN_SPECIFY
2 WIN_PIDENTIFY
4 WIN_IDENTIFY
240 WIN_PACKETCMD
2503 WIN_READDMA
If we had the win95 driver sources for 82371SB, we could find what is missing inside qemu's code "to please microsoft" guests.
Zitu
--
From: "zitu"
Quoted 2 lines
If we had the win95 driver sources for 82371SB, we could find what is missing inside qemu's code "to please microsoft" guests.
Perhaps some of these pages would help?
Microsoft fairly thoroughly documents the PC specs it expects developers to build to.
http://www.microsoft.com/whdc/default.mspx
(Some possibly useful sub sections include:)
http://www.microsoft.com/whdc/driver/foundation/SampleCode.mspx
http://www.microsoft.com/whdc/device/storage/default.mspx
http://www.microsoft.com/whdc/system/cec/default.mspx
Quoted 9 lines · zitu
Quoting James Boddington <[email protected]>:
Quoted 6 lines
Quoted 1 line · James Boddington
I found 2000 is using pio as well.
I'll change that. It is with 2000 + sp4. I am getting pio on the primary ide and dma on the secondary ide channel.
Quoted 7 lines
on xp, it's PIO for both. DMA if available only on primary (hdd).
For linux guest, as root, hdparm -d0/-d1 doesn't work.
But with the DMA patch, you should see DMA is on with the following:
'hdparm/dev/hda'
It's also visible in/proc/ide/hda/settings:)
Looks like mine (with the patch) shows DMA is off:
/dev/hda:
multcount = 16 (on)
IO_support = 0 (default 16-bit)
unmaskirq = 0 (off)
using_dma = 0 (off)
keepsettings = 0 (off)
readonly = 0 (off)
readahead = 256 (on)
geometry = 33288/16/63, sectors = 33554432, start = 0
And, I can set the IO_support to 1 with hdparm -c1 /dev/hda, but, as you say, I can't set using_dma to 1 with
hdparm -d1 /dev/hda. So, looks like it's off, and I can't turn it on. Should the IO_support = 1 help any with disk performance? It doesn't appear to.
Signature · 1 line
Jason Brittain
Quoted 11 lines · Jason Brittain
Quoted 10 lines · Johannes Schindelin
Hi,
Quoted 4 lines · Jason Brittain
/dev/hda:
settingusing_dmato 1 (on)HDIO_SET_DMAfailed: Operation not permittedusing_dma= 0 (off)
Quoted 5 lines
Quoted 2 lines
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
ide.c +1 -1
@@ -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 */
Signature · 1 line
Jens Axboe
Quoted 33 lines · Jens Axboe
Quoted 11 lines · Jason Brittain
Quoted 10 lines · Johannes Schindelin
Hi,
Quoted 4 lines · Jason Brittain
/dev/hda:
settingusing_dmato 1 (on)HDIO_SET_DMAfailed: Operation not permittedusing_dma= 0 (off)Quoted 5 lines
Quoted 2 lines
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.28ide.c
ide.c line 422
Quoted 8 lines
ide.c +1
-1@@ -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.
Signature · 1 line
Jens Axboe
Quoted 37 lines · Jens Axboe
Quoted 36 lines · Jens Axboe
Quoted 11 lines · Jason Brittain
Quoted 10 lines · Johannes Schindelin
Hi,
Quoted 4 lines · Jason Brittain
/dev/hda:
settingusing_dmato 1 (on)HDIO_SET_DMAfailed: Operation not permittedusing_dma= 0 (off)Quoted 5 lines
Quoted 2 lines
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.28ide.cide.c +0
-0@@ -416,7 +416,7 @@put_le16 (p +47 ,0x8000 |MAX_MULT_SECTORS );#endif put_le16 (p +48 ,1 );/* dword I/O */
Quoted 8 lines
ide.c line 422
Quoted 5 lines
ide.c +1
-1-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
ide.c +1 -1
@@ -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 :
Signature · 1 line
Jens Axboe
Quoted 2 lines
Quoted 2 lines
Review
Quoted 2 lines
(quoted diff) +1
-1- put_le16(p + 49, 1 << 9); /* LBA supported, no DMA */ + put_le16(p + 49, 1 << 9 | 1 << 8); /* DMA and LBA supported */
Care to put all the changes in 1 patch please, so I can put it on my web site?
Thanks,
Hetz
Quoted 38 lines · Jens Axboe
Quoted 13 lines · Jason Brittain
Quoted 11 lines · Johannes Schindelin
Hi,
Quoted 4 lines · Jason Brittain
/dev/hda:
settingusing_dmato 1 (on)HDIO_SET_DMAfailed: Operation not permittedusing_dma= 0 (off)Quoted 5 lines
Quoted 2 lines
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.28ide.c
ide.c line 422
Quoted 8 lines
ide.c +1
-1@@ -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 */
Just had it work, hdparm -t /dev/hda is now reporting nearly double the speed.
Signature · 1 line
James
Quoted 4 lines · Hetz Ben Hamo
Quoted 2 lines
Quoted 2 lines
Review
Quoted 2 lines
(quoted diff) +1
-1- put_le16(p + 49, 1 << 9); /* LBA supported, no DMA */ + put_le16(p + 49, 1 << 9 | 1 << 8); /* DMA and LBA supported */Care to put all the changes in 1 patch please, so I can put it on my web site?
Here you go.
Index: hw/ide.c
===================================================================
RCS file: /cvsroot/qemu/qemu/hw/ide.c,v
retrieving revision 1.28
ide.c +5 -3
@@ -416,10 +416,10 @@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 */ +put_le16 (p +53 ,1 |1 <<2 );/* words 54-58,88 are valid */ put_le16 (p +54 , s->cylinders);put_le16 (p +55 , s->heads);put_le16 (p +56 , s->sectors);
@@ -437,6 +437,8 @@put_le16 (p +85 , (1 <<14 ));put_le16 (p +86 ,0 );put_le16 (p +87 , (1 <<14 )); +put_le16 (p +88 ,0x1f | (1 <<13 )); +put_le16 (p +93 ,1 | (1 <<14 ) |0x2000 |0x4000 ); }static void ide_atapi_identify (IDEState *s)
@@ -1560,7 +1562,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 :
Signature · 1 line
Jens Axboe
Quoting Jens Axboe <[email protected]>:
Quoted 9 lines · Hetz Ben Hamo
Quoted 4 lines
Quoted 2 lines
Quoted 2 lines
ide.c line 419
Quoted 2 lines
ide.c +1
-1-put_le16 (p +49 ,1 <<9 );/* LBA supported, no DMA */ +put_le16 (p +49 ,1 <<9 |1 <<8 );/* DMA and LBA supported */ Care to put all the changes in 1 patch please, so I can put it on my web
site?
Here you go.
(...)
On win95 guest, I can mark dma box and it stays marked. But performance on hdd did not change much.
On win xp guest, I still stay on PIO mode, unfortunately.
On Linux, no change. My original patched version already had DMA ok.
Any chance you'd have a fix for xp guest ?
Thanks for the previous patch.
Zitu
--
Tried to load UDMA.SYS from FreeDOS. It complains about a too old BIOS doesn't load. Has anybody any experience with this ?
Andreas
-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of zitu
Sent: Monday, November 08, 2004 11:15 AM
To: [email protected]; Jens Axboe
Subject: Re: [Qemu-devel] enabling bus-master IDE driver
*This message was transferred with a trial version of CommuniGate(tm) Pro*
Quoting Jens Axboe <[email protected]>:
Quoted 3 lines · Hetz Ben Hamo
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Review
Quoted 2 lines
(quoted diff) +1
-1- put_le16(p + 49, 1 << 9); /* LBA supported, no DMA */ + put_le16(p + 49, 1 << 9 | 1 << 8); /* DMA and LBA
supported */
Quoted 2 lines
Quoted 2 lines
Care to put all the changes in 1 patch please, so I can put it on
my web
Quoted 4 lines
site?
Here you go.
(...)
On win95 guest, I can mark dma box and it stays marked. But performance on
hdd did not change much.
On win xp guest, I still stay on PIO mode, unfortunately.
On Linux, no change. My original patched version already had DMA ok.
Any chance you'd have a fix for xp guest ?
Thanks for the previous patch.
Zitu
--
_______________________________________________
Qemu-devel mailing list
[email protected]
http://lists.nongnu.org/mailman/listinfo/qemu-devel
Hi Jens,
The below patch, together with Juergen's PCI IDE busmaster patch, results in Solaris enabling DMA on the QEMU harddisk.
It still prints:
ata_set_feature: (0x66,0x0) failed
for both the harddisk and CDROM though. Also, it doesnt enable DMA on the CDROM (though, I strongly suspect that could be deliberate on the part of the Solaris kernel).
Thanks!
--paulj
Quoted 42 lines · Jens Axboe
Here you go.
Index:
hw/ide.c
===================================================================
RCS file: /cvsroot/qemu/qemu/hw/ide.c,v
retrieving revision 1.28
diff -u -r1.28ide.cide.c +5
-3@@ -416,10 +416,10 @@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 */ +put_le16 (p +53 ,1 |1 <<2 );/* words 54-58,88 are valid */ put_le16 (p +54 , s->cylinders);put_le16 (p +55 , s->heads);put_le16 (p +56 , s->sectors);@@ -437,6 +437,8 @@put_le16 (p +85 , (1 <<14 ));put_le16 (p +86 ,0 );put_le16 (p +87 , (1 <<14 )); +put_le16 (p +88 ,0x1f | (1 <<13 )); +put_le16 (p +93 ,1 | (1 <<14 ) |0x2000 |0x4000 ); }static void ide_atapi_identify (IDEState *s)@@ -1560,7 +1562,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 :
Signature · 5 lines
Paul Jakma [email protected] [email protected] Key ID: 64A2FF6A Fortune: It is not enough to have great qualities, we should also have the management of them. -- La Rochefoucauld
Where's your patch?
Also, I'm CC'ing Fabrice..
Thanks,
Hetz
Quoted 58 lines · Paul Jakma
Hi Jens,
The below patch, together with Juergen's PCI IDE busmaster patch, results in Solaris enabling DMA on the QEMU harddisk.
It still prints:
ata_set_feature: (0x66,0x0) failedfor both the harddisk and CDROM though. Also, it doesnt enable DMA on the CDROM (though, I strongly suspect that could be deliberate on the part of the Solaris kernel).
Thanks!
--paulj
Quoted 40 lines · Jens Axboe
Here you go.
Index:
hw/ide.c
===================================================================
RCS file: /cvsroot/qemu/qemu/hw/ide.c,v
retrieving revision 1.28
diff -u -r1.28ide.cide.c 7 Nov 2004 11:19:52 -0000 renamed from ide.c 9 Oct 2004 20:27:55 -0000 1.28 +5
-3@@ -416,10 +416,10 @@ 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 */ + put_le16(p + 53, 1 | 1 << 2); /* words 54-58,88 are valid */ put_le16(p + 54, s->cylinders); put_le16(p + 55, s->heads); put_le16(p + 56, s->sectors);@@ -437,6 +437,8 @@ put_le16(p + 85, (1 << 14)); put_le16(p + 86, 0); put_le16(p + 87, (1 << 14)); + put_le16(p + 88, 0x1f | (1 << 13)); + put_le16(p + 93, 1 | (1 << 14) | 0x2000 | 0x4000); } static void ide_atapi_identify(IDEState *s)@@ -1560,7 +1562,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:
Quoted 1 line · Hetz Ben Hamo
Where's your patch?
The patch I quoted was Jens', which he had posted to the list earlier. Juergen's should be in the archive (search for 'solaris' in text of emails).
Quoted 1 line
Also, I'm CC'ing Fabrice..
It would be nice to have these patches in CVS. Solaris wont work at all (well, not without serious tinkering of driver options and bootenv.rc) without Juergen's, Solaris is faster with Jens'.
Quoted 2 lines
Thanks,
Hetz
regards,
Signature · 4 lines
Paul Jakma [email protected] [email protected] Key ID: 64A2FF6A Fortune: You may call me by my name, Wirth, or by my value, Worth. - Nicklaus Wirth
Quoted 9 lines · Jens Axboe
Index:
hw/ide.c
===================================================================
RCS file: /cvsroot/qemu/qemu/hw/ide.c,v
retrieving revision 1.28
diff -u -r1.28ide.c
ide.c line 422
Quoted 8 lines
ide.c +1
-1@@ -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 */
I tried the same thing in ide_atapi_identify(). With this dma is now being set on the cdrom. Using an iso image in the host hard drive as a cd in qemu, hdparm -t is reporting a speed improvement.
Index: hw/ide.c
===================================================================
RCS file: /cvsroot/qemu/qemu/hw/ide.c,v
retrieving revision 1.29
ide.c 10 Nov 2004 01:19:32 -0000 renamed from ide.c 9 Nov 2004 22:04:05 -0000 1.29 +1 -1
@@ -458,7 +458,7 @@ padstr((uint8_t *)(p + 23), QEMU_VERSION, 8); /* firmware version */ padstr((uint8_t *)(p + 27), "QEMU CD-ROM", 40); /* model */ put_le16(p + 48, 1); /* dword I/O (XXX: should not be set on CDROM) */ - 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 + 53, 3); /* words 64-70, 54-58 valid */ put_le16(p + 63, 0x103); /* DMA modes XXX: may be incorrect */ put_le16(p + 64, 1); /* PIO modes */
Signature · 1 line
James
I just pulled the latest source from CVS (today's), and tried looking at DMA again.
Host: Linux 2.6 (Fedora Core 2)
Guest: XP corp.
It still says the primary IDE channel is in PIO mode, and doesn't seem any faster.
Host: Linux 2.6 (Fedora Core 2)
Guest: Linux 2.6
hdparm now reports that DMA is on for /dev/hda, and I can also turn it on and off. With it on, it's about twice as fast as it is with it off. So, this seems to work.
Cheers.
Signature · 1 line
Jason Brittain
Quoted 49 lines · Jens Axboe
Quoted 4 lines · Hetz Ben Hamo
Quoted 2 lines
Quoted 2 lines
ide.c line 419
Quoted 2 lines
ide.c +1
-1-put_le16 (p +49 ,1 <<9 );/* LBA supported, no DMA */ +put_le16 (p +49 ,1 <<9 |1 <<8 );/* DMA and LBA supported */ Care to put all the changes in 1 patch please, so I can put it on my web site?
Here you go.
Index:
hw/ide.c
===================================================================
RCS file: /cvsroot/qemu/qemu/hw/ide.c,v
retrieving revision 1.28
diff -u -r1.28ide.cide.c +5
-3@@ -416,10 +416,10 @@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 */ +put_le16 (p +53 ,1 |1 <<2 );/* words 54-58,88 are valid */ put_le16 (p +54 , s->cylinders);put_le16 (p +55 , s->heads);put_le16 (p +56 , s->sectors);@@ -437,6 +437,8 @@put_le16 (p +85 , (1 <<14 ));put_le16 (p +86 ,0 );put_le16 (p +87 , (1 <<14 )); +put_le16 (p +88 ,0x1f | (1 <<13 )); +put_le16 (p +93 ,1 | (1 <<14 ) |0x2000 |0x4000 ); }static void ide_atapi_identify (IDEState *s)@@ -1560,7 +1562,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 :
Quoted 8 lines · Jason Brittain
I just pulled the latest source from CVS (today's), and tried looking at DMA again.
Host: Linux 2.6 (Fedora Core 2)
Guest: XP corp.
It still says the primary IDE channel is in PIO mode, and doesn't seem any faster.
Quoted 5 lines
Host: Linux 2.6 (Fedora Core 2)
Guest: Linux 2.6
hdparm now reports that DMA is on for/dev/hda, and I can also turn it on and off. With it on, it's about twice as fast as it is with it off. So, this seems to work.
If I could install XP, I could take a look. But it will boot for me after install, just hangs. If I restart qemu, it complains about a bad boot loader.
If I get time I'll look into this.
Signature · 1 line
Jens Axboe
Quoted 17 lines · Jens Axboe
Quoted 8 lines · Jason Brittain
I just pulled the latest source from CVS (today's), and tried looking at DMA again.
Host: Linux 2.6 (Fedora Core 2)
Guest: XP corp.
It still says the primary IDE channel is in PIO mode, and doesn't seem any faster.Quoted 5 lines
Host: Linux 2.6 (Fedora Core 2)
Guest: Linux 2.6
hdparm now reports that DMA is on for/dev/hda, and I can also turn it on and off. With it on, it's about twice as fast as it is with it off. So, this seems to work.
Quoted 5 lines
If I could install XP, I could take a look. But it will boot for me after install, just hangs. If I restart qemu, it complains about a bad boot loader.
If I get time I'll look into this.
That's a known problem that aparently still isn't fixed in CVS. To fix it, apply this patch to your ide.c:
ide.c 2004-11-11 08:56:23.000000000 -0800 renamed from ide.c-bad 2004-11-11 07:54:34.000000000 -0800 +1 -1
@@ -1895,7 +1895,7 @@ s->heads = 16; s->sectors = 63; } - bdrv_set_geometry_hint(s->bs, s->cylinders, s->heads, s->sectors); + /*bdrv_set_geometry_hint(s->bs, s->cylinders, s->heads, s->sectors);*/ } if (bdrv_get_type_hint(s->bs) == BDRV_TYPE_CDROM) { s->is_cdrom = 1;
And, then you must reinstall XP in a new hd image. Old images are apparently corrupted, and will not work even with a patched qemu binary. I now keep my qemu patched this way and my XP boots fine.
Signature · 1 line
Jason Brittain
Quoted 37 lines · Jason Brittain
Quoted 17 lines · Jens Axboe
Quoted 8 lines · Jason Brittain
I just pulled the latest source from CVS (today's), and tried looking at DMA again.
Host: Linux 2.6 (Fedora Core 2)
Guest: XP corp.
It still says the primary IDE channel is in PIO mode, and doesn't seem any faster.Quoted 5 lines
Host: Linux 2.6 (Fedora Core 2)
Guest: Linux 2.6
hdparm now reports that DMA is on for/dev/hda, and I can also turn it on and off. With it on, it's about twice as fast as it is with it off. So, this seems to work.Quoted 5 lines
If I could install XP, I could take a look. But it will boot for me after install, just hangs. If I restart qemu, it complains about a bad boot loader.
If I get time I'll look into this.
That's a known problem that aparently still isn't fixed in CVS. To fix it, apply this patch to your
ide.c:ide.c 2004-11-11 08:56:23.000000000 -0800 renamed from ide.c-bad 2004-11-11 07:54:34.000000000 -0800 +1
-1@@ -1895,7 +1895,7 @@ s->heads = 16; s->sectors = 63; } - bdrv_set_geometry_hint(s->bs, s->cylinders, s->heads, s->sectors); + /*bdrv_set_geometry_hint(s->bs, s->cylinders, s->heads,s->sectors);*/
Quoted 8 lines
} if (bdrv_get_type_hint(s->bs) == BDRV_TYPE_CDROM) { s->is_cdrom = 1;And, then you must reinstall XP in a new hd image. Old images are apparently corrupted, and will not work even with a patched qemu binary. I now keep my qemu patched this way and my XP boots fine.
Ah thanks, I'll apply the fix and attempt a new install.
Signature · 1 line
Jens Axboe
Quoted 42 lines · Jens Axboe
Quoted 41 lines · Jason Brittain
Quoted 17 lines · Jens Axboe
Quoted 8 lines · Jason Brittain
I just pulled the latest source from CVS (today's), and tried looking at DMA again.
Host: Linux 2.6 (Fedora Core 2)
Guest: XP corp.
It still says the primary IDE channel is in PIO mode, and doesn't seem any faster.Quoted 5 lines
Host: Linux 2.6 (Fedora Core 2)
Guest: Linux 2.6
hdparm now reports that DMA is on for/dev/hda, and I can also turn it on and off. With it on, it's about twice as fast as it is with it off. So, this seems to work.Quoted 5 lines
If I could install XP, I could take a look. But it will boot for me after install, just hangs. If I restart qemu, it complains about a bad boot loader.
If I get time I'll look into this.
That's a known problem that aparently still isn't fixed in CVS. To fix it, apply this patch to your
ide.c:ide.c 2004-11-11 08:56:23.000000000 -0800 renamed from ide.c-bad 2004-11-11 07:54:34.000000000 -0800 +1
-1@@ -1895,7 +1895,7 @@ s->heads = 16; s->sectors = 63; } - bdrv_set_geometry_hint(s->bs, s->cylinders, s->heads, s->sectors); + /*bdrv_set_geometry_hint(s->bs, s->cylinders, s->heads,s->sectors);*/
} if (bdrv_get_type_hint(s->bs) == BDRV_TYPE_CDROM) { s->is_cdrom = 1;
Quoted 6 lines
Quoted 4 lines
And, then you must reinstall XP in a new hd image. Old images are apparently corrupted, and will not work even with a patched qemu binary. I now keep my qemu patched this way and my XP boots fine.
Ah thanks, I'll apply the fix and attempt a new install.
XP now installs, but gives me a license warning on the first boot. Something like 'An error has prevented windows from verifying the correctness of the license - error code 0x800703e6'
Signature · 1 line
Jens Axboe