* Re: [Qemu-devel] enabling bus-master IDE driver
@ 2004-11-12 14:27 Juergen Keil
2004-11-12 18:02 ` Jason Brittain
0 siblings, 1 reply; 42+ messages in thread
From: Juergen Keil @ 2004-11-12 14:27 UTC (permalink / raw)
To: qemu-devel
> 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.
I guess Windows 2000/XP is confused about the fact that a qemu hdd now
supports ultra dma modes, but no multiword dma modes. Maybe the windows
ata driver gives up on dma as soon as it notices that the hdd drive does
not support any multiword dma modes?
Try to add a "put_le16(p + 63, 0x07);" to hw/ide.c ide_identify() and
ide_atapi_identify(). This announces support for multiword dma modes 0-2.
This change appears to enable DMA on Win 2000.
I'm currently using the following changes (note: this diff is against the
previous version of ide.c, qemu-cvs already contains a few of these changes),
and seem to get DMA with Win ME, Win 2000 and Solaris x86.
Index: hw/ide.c
===================================================================
RCS file: /cvsroot/qemu/qemu/hw/ide.c,v
retrieving revision 1.28
diff -u -B -r1.28 ide.c
--- hw/ide.c 9 Oct 2004 20:27:55 -0000 1.28
+++ hw/ide.c 12 Nov 2004 14:15:25 -0000
@@ -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 << 8 | 1 << 9); /* 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);
@@ -430,6 +430,8 @@
put_le16(p + 59, 0x100 | s->mult_sectors);
put_le16(p + 60, s->nb_sectors);
put_le16(p + 61, s->nb_sectors >> 16);
+ put_le16(p + 63, 0x07 /*| 0x4 << 8*/); /* Multiword DMA supported/selected
*/
+ put_le16(p + 64, 0x3f); /* PIO modes supported */
put_le16(p + 80, (1 << 1) | (1 << 2));
put_le16(p + 82, (1 << 14));
put_le16(p + 83, (1 << 14));
@@ -437,6 +439,8 @@
put_le16(p + 85, (1 << 14));
put_le16(p + 86, 0);
put_le16(p + 87, (1 << 14));
+ put_le16(p + 88, 0x3f | 0x20 << 8); /* UltraDMA modes supported/selected */
+ put_le16(p + 93, 1 | (1 << 1) | (1 << 3) | (1 << 13) | (1 << 14));
}
static void ide_atapi_identify(IDEState *s)
@@ -456,10 +460,10 @@
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 + 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 */
+ put_le16(p + 49, 1 << 8 | 1 << 9); /* DMA and LBA supported */
+ put_le16(p + 53, 7); /* words 64-70, 54-58, 88 valid */
+ put_le16(p + 63, 0x07 /*| 0x4 << 8*/); /* Multiword DMA supported/selected
*/
+ put_le16(p + 64, 0x3f); /* PIO modes supported */
put_le16(p + 65, 0xb4); /* minimum DMA multiword tx cycle time */
put_le16(p + 66, 0xb4); /* recommended DMA multiword tx cycle time */
put_le16(p + 67, 0x12c); /* minimum PIO cycle time without flow control */
@@ -469,6 +473,7 @@
put_le16(p + 72, 30); /* in ns */
put_le16(p + 80, 0x1e); /* support up to ATA/ATAPI-4 */
+ put_le16(p + 88, 0x3f | 0x20 << 8); /* UltraDMA modes supported/selected */
}
static void ide_set_signature(IDEState *s)
@@ -498,6 +503,10 @@
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);
@@ -1560,7 +1569,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:
@@ -2174,6 +2183,7 @@
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
^ permalink raw reply [flat|nested] 42+ messages in thread
* Re: [Qemu-devel] enabling bus-master IDE driver
2004-11-12 14:27 [Qemu-devel] enabling bus-master IDE driver Juergen Keil
@ 2004-11-12 18:02 ` Jason Brittain
0 siblings, 0 replies; 42+ messages in thread
From: Jason Brittain @ 2004-11-12 18:02 UTC (permalink / raw)
To: qemu-devel
Juergen Keil wrote:
>
>>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.
>
>
> I guess Windows 2000/XP is confused about the fact that a qemu hdd now
> supports ultra dma modes, but no multiword dma modes. Maybe the windows
> ata driver gives up on dma as soon as it notices that the hdd drive does
> not support any multiword dma modes?
>
> Try to add a "put_le16(p + 63, 0x07);" to hw/ide.c ide_identify() and
> ide_atapi_identify(). This announces support for multiword dma modes 0-2.
> This change appears to enable DMA on Win 2000.
>
>
> I'm currently using the following changes (note: this diff is against the
> previous version of ide.c, qemu-cvs already contains a few of these changes),
> and seem to get DMA with Win ME, Win 2000 and Solaris x86.
>
>
> Index: hw/ide.c
> ===================================================================
> RCS file: /cvsroot/qemu/qemu/hw/ide.c,v
> retrieving revision 1.28
> diff -u -B -r1.28 ide.c
> --- hw/ide.c 9 Oct 2004 20:27:55 -0000 1.28
> +++ hw/ide.c 12 Nov 2004 14:15:25 -0000
> @@ -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 << 8 | 1 << 9); /* 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);
> @@ -430,6 +430,8 @@
> put_le16(p + 59, 0x100 | s->mult_sectors);
> put_le16(p + 60, s->nb_sectors);
> put_le16(p + 61, s->nb_sectors >> 16);
> + put_le16(p + 63, 0x07 /*| 0x4 << 8*/); /* Multiword DMA supported/selected
> */
> + put_le16(p + 64, 0x3f); /* PIO modes supported */
> put_le16(p + 80, (1 << 1) | (1 << 2));
> put_le16(p + 82, (1 << 14));
> put_le16(p + 83, (1 << 14));
> @@ -437,6 +439,8 @@
> put_le16(p + 85, (1 << 14));
> put_le16(p + 86, 0);
> put_le16(p + 87, (1 << 14));
> + put_le16(p + 88, 0x3f | 0x20 << 8); /* UltraDMA modes supported/selected */
> + put_le16(p + 93, 1 | (1 << 1) | (1 << 3) | (1 << 13) | (1 << 14));
> }
>
> static void ide_atapi_identify(IDEState *s)
> @@ -456,10 +460,10 @@
> 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 + 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 */
> + put_le16(p + 49, 1 << 8 | 1 << 9); /* DMA and LBA supported */
> + put_le16(p + 53, 7); /* words 64-70, 54-58, 88 valid */
> + put_le16(p + 63, 0x07 /*| 0x4 << 8*/); /* Multiword DMA supported/selected
> */
> + put_le16(p + 64, 0x3f); /* PIO modes supported */
> put_le16(p + 65, 0xb4); /* minimum DMA multiword tx cycle time */
> put_le16(p + 66, 0xb4); /* recommended DMA multiword tx cycle time */
> put_le16(p + 67, 0x12c); /* minimum PIO cycle time without flow control */
> @@ -469,6 +473,7 @@
> put_le16(p + 72, 30); /* in ns */
>
> put_le16(p + 80, 0x1e); /* support up to ATA/ATAPI-4 */
> + put_le16(p + 88, 0x3f | 0x20 << 8); /* UltraDMA modes supported/selected */
> }
>
> static void ide_set_signature(IDEState *s)
> @@ -498,6 +503,10 @@
> 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);
> @@ -1560,7 +1569,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:
> @@ -2174,6 +2183,7 @@
> 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
This is interesting..
I carefully applied these changes to my ide.c and retried:
Host: Linux 2.6 (Fedora Core 2)
Guest: XP corp.
It now says "Current Transfer Mode: Multi-Word DMA Mode 2".
I'm not real sure how I test to see if disk access is faster,
or by how much, but this appears to be progress for XP.
Host: Linux 2.6 (Fedora Core 2)
Guest: Linux 2.6
Upon boot I used hdparm to show the settings for /dev/hda. It
said that DMA was on. So I did some hdparm -t /dev/hda timings.
It is now half the speed it was when I used the source from CVS
HEAD (~25MB/s now, compared with ~45MB/s when I tested CVS HEAD).
I used hdparm to turn off DMA, and to list the settings again
to verify the change took affect. Then I did more hdparm -t
timings. Transfer rate went down to 10MB/s. Turning it back on
with hdparm brings it back up to ~25MB/s. So, compared with
what's in CVS HEAD, this appears significantly slower for Linux.
--
Jason Brittain
^ permalink raw reply [flat|nested] 42+ messages in thread
* Re: [Qemu-devel] enabling bus-master IDE driver
@ 2004-11-26 10:48 Juergen Keil
2004-11-28 20:09 ` Juergen Lock
0 siblings, 1 reply; 42+ messages in thread
From: Juergen Keil @ 2004-11-26 10:48 UTC (permalink / raw)
To: qemu-devel
> On Tue, Nov 23, 2004 at 04:03:39PM +0000, Norikatsu Shigemura wrote:
> > On Tue, 16 Nov 2004 20:41:35 +0100
> > Juergen Lock <qemu-l@jelal.kn-bremen.de> wrote:
> > > > > It now says "Current Transfer Mode: Multi-Word DMA Mode 2".
> > > > > I'm not real sure how I test to see if disk access is faster,
> > > > > or by how much, but this appears to be progress for XP.
> > > > Windows 2000 isn't that verbose - it simply prints "DMA mode".
> > > > Interesting that XP has enabled "Multi-Word DMA Mode 2".
> > > >...
> > > FreeBSD guests (at least 5.3-BETA1) say they use WDMA2, which i guess
> > > is the same:
> >
> > Your patch works quite good. I confirmed that it works on
> > Windows XP SP2 and FreeBSD 5.3-RELEASE as guest OSs, and
> > host's cpu loadavg reduced(MAX: 97% -> 30% on boot, etc..).
> >
> > # http://people.FreeBSD.org/~nork/qemu/qemu05.png but Japanese
> >
> > May I commit your patch as ports/emulators/qemu/files/patch-hw::ide.c?
> >
> Mmmh actually I was waiting for words from people in the know about
> this, like is WDMA2 really the best we're gonna get? Since linux guests'
> DMA was reported to be faster without the patch...
FreeBSD identifies QEMU's pci-ide controller as an "Intel PIIX3" chipset,
and has built-in knowledge that the PIIX3 does not support UDMA modes.
WDMA2 is the fastest dma transfer rate that is supported by the PIIX3
(according to freebsd source, I didn't verify this but I guess it's correct).
So that's why freebsd is using WDMA2.
See function ata_intel_ident() in sys/dev/ata/ata-chipcet.c:
http://www.freebsd.org/cgi/cvsweb.cgi/src/sys/dev/ata/ata-chipset.c?rev=1.92&con
tent-type=text/x-cvsweb-markup
I don't think that you'll notice a difference in speed or performance inside
qemu between multiword dma and ultra dma modes. qemu does not emulate the
ide hardware at such a low level that the dma transfer modes on the bus
matters. The important thing is that the ide dma commands are used, so that
the hw/ide.c will move data to/from pc memory. If a pio mode is used
the guest os' interrupt handler moves the data word-by-word to or from the
ide controller hardware, using emulated x86 instructions, and that is quite
expensive.
-------------
Btw. FreeBSD 5.2.1 does not enable DMA on the QEMU-HDD, it uses PIO4 mode.
Trying to enable DMA with "atacontrol mode 0 WDMA2 BIOSPIO" crashes
the FreeBSD kernel (-> a FreeBSD kernel problem).
Problem: PCI busmastering is not enabled in the PCI command register.
It seems the BIOS is supposed to enable busmastering, but bochs bios
apparently doesn't enable pci-ide busmastering. ata-pci.c function
ata_pci_attach() does not set ctrl->r_io1 which would be needed in
ata_pci_allocated() to allocate and enable DMA (ctrl->dmainit() is not
called).
As a workaround, always enable busmastering on qemu's pci-ide device.
Default to WDMA2 mode (the real Intel PIIX3 hardware which we
emulate does not support UDMA modes).
(The following patch needs to be applied on top of the previous version
of the pci-ide busmastering dma patch)
diff -ru /home/jk/src/qemu-cvs/hw/ide.c ./hw/ide.c
--- /home/jk/src/qemu-cvs/hw/ide.c 2004-11-18 22:23:13.000000000 +0100
+++ ./hw/ide.c 2004-11-21 11:26:56.143862000 +0100
@@ -430,7 +430,7 @@
put_le16(p + 59, 0x100 | s->mult_sectors);
put_le16(p + 60, s->nb_sectors);
put_le16(p + 61, s->nb_sectors >> 16);
- put_le16(p + 63, 0x07 /*| 0x4 << 8*/); /* Multiword DMA supported/selected
*/
+ put_le16(p + 63, 0x07 | 0x4 << 8); /* Multiword DMA supported/selected */
put_le16(p + 64, 0x03); /* PIO modes 3,4 supported */
put_le16(p + 80, (1 << 1) | (1 << 2));
put_le16(p + 82, (1 << 14));
@@ -439,7 +439,7 @@
put_le16(p + 85, (1 << 14));
put_le16(p + 86, 0);
put_le16(p + 87, (1 << 14));
- put_le16(p + 88, 0x3f | 0x20 << 8); /* UltraDMA modes supported/selected */
+ put_le16(p + 88, 0x3f /*| 0x20 << 8*/); /* UltraDMA modes
supported/selected */
put_le16(p + 93, 1 | (1 << 1) | (1 << 3) | (1 << 13) | (1 << 14));
}
@@ -462,7 +462,7 @@
put_le16(p + 48, 1); /* dword I/O (XXX: should not be set on CDROM) */
put_le16(p + 49, 1 << 8 | 1 << 9); /* DMA and LBA supported */
put_le16(p + 53, 7); /* words 64-70, 54-58, 88 valid */
- put_le16(p + 63, 0x07 /*| 0x4 << 8*/); /* Multiword DMA supported/selected
*/
+ put_le16(p + 63, 0x07 | 0x4 << 8); /* Multiword DMA supported/selected */
put_le16(p + 64, 0x03); /* PIO modes 3,4 supported */
put_le16(p + 65, 0xb4); /* minimum DMA multiword tx cycle time */
put_le16(p + 66, 0xb4); /* recommended DMA multiword tx cycle time */
@@ -473,7 +473,7 @@
put_le16(p + 72, 30); /* in ns */
put_le16(p + 80, 0x1e); /* support up to ATA/ATAPI-4 */
- put_le16(p + 88, 0x3f | 0x20 << 8); /* UltraDMA modes supported/selected */
+ put_le16(p + 88, 0x3f /*| 0x20 << 8*/); /* UltraDMA modes
supported/selected */
}
static void ide_set_signature(IDEState *s)
@@ -2192,6 +2192,12 @@
ide_init2(&d->ide_if[2], 16, hd_table[2], hd_table[3]);
}
+
+// PCI 0x04: command(word), 0x06(word): status
+#define PCI_COMMAND_IOACCESS 0x0001
+#define PCI_COMMAND_MEMACCESS 0x0002
+#define PCI_COMMAND_BUSMASTER 0x0004
+
/* hd_table must contain 4 block drivers */
/* NOTE: for the PIIX3, the IRQs and IOports are hardcoded */
void pci_piix3_ide_init(PCIBus *bus, BlockDriverState **hd_table)
@@ -2209,6 +2215,8 @@
pci_conf[0x01] = 0x80;
pci_conf[0x02] = 0x10;
pci_conf[0x03] = 0x70;
+ pci_conf[0x04] = PCI_COMMAND_IOACCESS | PCI_COMMAND_MEMACCESS \
+ | PCI_COMMAND_BUSMASTER;
pci_conf[0x09] = 0x8a; // programming interface = PCI_IDE bus master is sup
ported
pci_conf[0x0a] = 0x01; // class_sub = PCI_IDE
pci_conf[0x0b] = 0x01; // class_base = PCI_mass_storage
^ permalink raw reply [flat|nested] 42+ messages in thread
* Re: [Qemu-devel] enabling bus-master IDE driver
2004-11-26 10:48 Juergen Keil
@ 2004-11-28 20:09 ` Juergen Lock
0 siblings, 0 replies; 42+ messages in thread
From: Juergen Lock @ 2004-11-28 20:09 UTC (permalink / raw)
To: Juergen Keil; +Cc: qemu-devel
On Fri, Nov 26, 2004 at 04:14:35PM +0000, Juergen Keil wrote:
>...
> FreeBSD identifies QEMU's pci-ide controller as an "Intel PIIX3" chipset,
> and has built-in knowledge that the PIIX3 does not support UDMA modes.
> WDMA2 is the fastest dma transfer rate that is supported by the PIIX3
> (according to freebsd source, I didn't verify this but I guess it's correct).
> So that's why freebsd is using WDMA2.
>
Ah, I see.
> See function ata_intel_ident() in sys/dev/ata/ata-chipcet.c:
>
> http://www.freebsd.org/cgi/cvsweb.cgi/src/sys/dev/ata/ata-chipset.c?rev=1.92&con
> tent-type=text/x-cvsweb-markup
>
>
>
> I don't think that you'll notice a difference in speed or performance inside
> qemu between multiword dma and ultra dma modes. qemu does not emulate the
> ide hardware at such a low level that the dma transfer modes on the bus
> matters. The important thing is that the ide dma commands are used, so that
> the hw/ide.c will move data to/from pc memory. If a pio mode is used
> the guest os' interrupt handler moves the data word-by-word to or from the
> ide controller hardware, using emulated x86 instructions, and that is quite
> expensive.
>
Thats what i thought as well, but do you have an explanation for the fact
that with the (previous) patch linux guest's DMA was reported to be slower
here than without?
> -------------
>
> Btw. FreeBSD 5.2.1 does not enable DMA on the QEMU-HDD, it uses PIO4 mode.
>
> Trying to enable DMA with "atacontrol mode 0 WDMA2 BIOSPIO" crashes
> the FreeBSD kernel (-> a FreeBSD kernel problem).
>
> Problem: PCI busmastering is not enabled in the PCI command register.
> It seems the BIOS is supposed to enable busmastering, but bochs bios
> apparently doesn't enable pci-ide busmastering. ata-pci.c function
> ata_pci_attach() does not set ctrl->r_io1 which would be needed in
> ata_pci_allocated() to allocate and enable DMA (ctrl->dmainit() is not
> called).
>
> As a workaround, always enable busmastering on qemu's pci-ide device.
>
> Default to WDMA2 mode (the real Intel PIIX3 hardware which we
> emulate does not support UDMA modes).
>
> (The following patch needs to be applied on top of the previous version
> of the pci-ide busmastering dma patch)
I had to hand-apply this as well, your mailer seems to distort patches...
I'll append a cumulative version (both patches) below.
But, with this patch, FreeBSD 5.2.1 with device atapicam in the kernel
(tested with FreeSBIE-1.0) panics with a integer divide fault in
__qdivrem+59 (long long devide helper function i think), if I pass it
a -hda, and before that (booting with -v) i see it detecting a da0 disk
GEOM: new disk da0
where it tries to
(da0:ata1:0:0:0): SYNCHRONIZE CACHE. CDB: 35 0 0 0 0 0 0 0 0 0
(da0:ata1:0:0:0): error code 0
two times. ata1, so atapicam somehow detected the cdrom as da0 instead of
as cd0...
And, FreeSBIE-20040919 (a 6.0-CURRENT snapshot which also has atapicam
in the kernel) detects a da0 and panics too, even with just the old patch.
(current process 35, swi3: cambio)
Ok and now i just tested a 5.3-RC2 kernel with atapicam. It doesnt
panic but says:
GEOM: new disk da0
da0 at ata1 bus 0 target 0 lun 0
da0: < > Fixed Direct Access SCSI-0 device
da0: 16.000MB/s transfers
da0: 0MB (1 0 byte sectors: 0H 0S/T 0C)
so it looks like they fixed the zero divide bug, but the wrong detection
of the cdrom as da0 is still present with this patch.
Index: qemu/hw/ide.c
@@ -430,6 +430,8 @@
put_le16(p + 59, 0x100 | s->mult_sectors);
put_le16(p + 60, s->nb_sectors);
put_le16(p + 61, s->nb_sectors >> 16);
+ put_le16(p + 63, 0x07 | 0x4 << 8); /* Multiword DMA supported/selected */
+ put_le16(p + 64, 0x3f); /* PIO modes supported */
put_le16(p + 80, (1 << 1) | (1 << 2));
put_le16(p + 82, (1 << 14));
put_le16(p + 83, (1 << 14));
@@ -437,7 +439,7 @@
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 + 88, 0x3f /*| (0x20 << 8)*/); /* UltraDMA modes supported/selected */
put_le16(p + 93, 1 | (1 << 14) | 0x2000 | 0x4000);
}
@@ -458,10 +460,10 @@
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 + 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 */
+ put_le16(p + 49, 1 << 9 | 1 << 8); /* DMA and LBA supported */
+ put_le16(p + 53, 7); /* words 64-70, 54-58, 88 valid */
+ put_le16(p + 63, 7 | 0x4 << 8); /* Multiword DMA supported/selected */
+ put_le16(p + 64, 0x3f); /* PIO modes supported */
put_le16(p + 65, 0xb4); /* minimum DMA multiword tx cycle time */
put_le16(p + 66, 0xb4); /* recommended DMA multiword tx cycle time */
put_le16(p + 67, 0x12c); /* minimum PIO cycle time without flow control */
@@ -471,6 +473,7 @@
put_le16(p + 72, 30); /* in ns */
put_le16(p + 80, 0x1e); /* support up to ATA/ATAPI-4 */
+ put_le16(p + 88, 0x3f /*| 0x20 << 8*/); /* UltraDMA modes supported/selected */
}
static void ide_set_signature(IDEState *s)
@@ -500,6 +503,10 @@
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);
@@ -2142,6 +2149,12 @@
}
}
+
+// PCI 0x04: command(word), 0x06(word): status
+#define PCI_COMMAND_IOACCESS 0x0001
+#define PCI_COMMAND_MEMACCESS 0x0002
+#define PCI_COMMAND_BUSMASTER 0x0004
+
/* hd_table must contain 4 block drivers */
void pci_ide_init(PCIBus *bus, BlockDriverState **hd_table)
{
@@ -2202,6 +2215,9 @@
pci_conf[0x01] = 0x80;
pci_conf[0x02] = 0x10;
pci_conf[0x03] = 0x70;
+ pci_conf[0x04] = PCI_COMMAND_IOACCESS | PCI_COMMAND_MEMACCESS \
+ | PCI_COMMAND_BUSMASTER;
+ 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
^ permalink raw reply [flat|nested] 42+ messages in thread
* Re: [Qemu-devel] enabling bus-master IDE driver
@ 2004-11-12 19:07 Juergen Keil
2004-11-16 19:41 ` Juergen Lock
0 siblings, 1 reply; 42+ messages in thread
From: Juergen Keil @ 2004-11-12 19:07 UTC (permalink / raw)
To: qemu-devel
> > + put_le16(p + 63, 0x07 /*| 0x4 << 8*/); /* Multiword DMA
supported/selected */
...
> > + put_le16(p + 88, 0x3f | 0x20 << 8); /* UltraDMA modes
supported/selected */
> This is interesting..
>
> I carefully applied these changes to my ide.c and retried:
>
> Host: Linux 2.6 (Fedora Core 2)
> Guest: XP corp.
> It now says "Current Transfer Mode: Multi-Word DMA Mode 2".
> I'm not real sure how I test to see if disk access is faster,
> or by how much, but this appears to be progress for XP.
Windows 2000 isn't that verbose - it simply prints "DMA mode".
Interesting that XP has enabled "Multi-Word DMA Mode 2".
Setting word 63 to a value of 0x07 should announce the support
for multiword dma modes 0..2. And no multiword dma mode is
selected. The commented out "0x4 << 8" part would enable
multiword dma mode 2. I've commented it out becuase qemu's hdd
is supposed to support ultra dma modes.
I did change the value for word 88 - the ultra dma modes.
CVS HEAD sets it to ultra dma modes 0..4 supported, and ultra dma
mode 5 selected. I'm not sure, but it sounds wrong to select
a dma mode that is not supported by the drive.
CVS HEAD: put_le16(p + 88, 0x1f | (1 << 13));
I've changed it to ultra dma modes 0..5 supported, and ultra dma
mode 5 selected:
put_le16(p + 88, 0x3f | 0x20 << 8);
Maybe windows checks the ata/atapi version field in word 80?
qemu's hdd only supports ata/atapi-1 and ata/atapi-2. Ultra dma
might not exist in the ata/atapi-2 standard.
^ permalink raw reply [flat|nested] 42+ messages in thread
* Re: [Qemu-devel] enabling bus-master IDE driver
2004-11-12 19:07 Juergen Keil
@ 2004-11-16 19:41 ` Juergen Lock
2004-11-23 5:12 ` Norikatsu Shigemura
0 siblings, 1 reply; 42+ messages in thread
From: Juergen Lock @ 2004-11-16 19:41 UTC (permalink / raw)
To: Juergen Keil; +Cc: qemu-devel
On Sat, Nov 13, 2004 at 01:43:35AM +0000, Juergen Keil wrote:
>
>
> > > + put_le16(p + 63, 0x07 /*| 0x4 << 8*/); /* Multiword DMA
> supported/selected */
> ...
> > > + put_le16(p + 88, 0x3f | 0x20 << 8); /* UltraDMA modes
> supported/selected */
>
> > This is interesting..
> >
> > I carefully applied these changes to my ide.c and retried:
> >
> > Host: Linux 2.6 (Fedora Core 2)
> > Guest: XP corp.
> > It now says "Current Transfer Mode: Multi-Word DMA Mode 2".
> > I'm not real sure how I test to see if disk access is faster,
> > or by how much, but this appears to be progress for XP.
>
> Windows 2000 isn't that verbose - it simply prints "DMA mode".
>
> Interesting that XP has enabled "Multi-Word DMA Mode 2".
>...
FreeBSD guests (at least 5.3-BETA1) say they use WDMA2, which i guess
is the same:
Copyright (c) 1992-2004 The FreeBSD Project.
Copyright (c) 1979, 1980, 1983, 1986, 1988, 1989, 1991, 1992, 1993, 1994
The Regents of the University of California. All rights reserved.
FreeBSD 5.3-BETA1 #0: Sat Aug 21 08:19:34 UTC 2004
root@mack.dcsl.buffalo.edu:/usr/obj/usr/src/sys/GENERIC
...
atapci0: <Intel PIIX3 WDMA2 controller> port 0xc000-0xc00f,0x376,0x170-0x177,0x3f6,0x1f0-0x1f7 at device 1.1 on pci0
atapci0: Reserved 0x10 bytes for rid 0x20 type 4 at 0xc000
ata0: channel #0 on atapci0
atapci0: Reserved 0x8 bytes for rid 0x10 type 4 at 0x1f0
atapci0: Reserved 0x1 bytes for rid 0x14 type 4 at 0x3f6
ata0: reset tp1 mask=03 ostat0=50 ostat1=00
ata0-master: stat=0x50 err=0x01 lsb=0x00 msb=0x00
ata0-slave: stat=0x00 err=0x01 lsb=0xff msb=0xff
ata0: reset tp2 stat0=50 stat1=00 devices=0x1<ATA_MASTER>
ata0: [MPSAFE]
ata1: channel #1 on atapci0
atapci0: Reserved 0x8 bytes for rid 0x18 type 4 at 0x170
atapci0: Reserved 0x1 bytes for rid 0x1c type 4 at 0x376
ata1: reset tp1 mask=03 ostat0=00 ostat1=00
ata1-master: stat=0x00 err=0x01 lsb=0x14 msb=0xeb
ata1-slave: stat=0x00 err=0x01 lsb=0xff msb=0xff
ata1: reset tp2 stat0=00 stat1=00 devices=0x4<ATAPI_MASTER>
ata1: [MPSAFE]
...
ata0-master: pio=0x0c wdma=0x22 udma=0x45 cable=80pin
ata0-master: setting PIO4 on Intel PIIX3 chip
ata0-master: setting WDMA2 on Intel PIIX3 chip
ad0: <QEMU HARDDISK/0.6.1> ATA-2 disk at ata0-master
ad0: 488MB (1000000 sectors), 992 C, 16 H, 63 S, 512 B
ad0: 16 secs/int, 1 depth queue, WDMA2
...
ata1-master: pio=0x0c wdma=0x22 udma=0x45 cable=40pin
ATAPI_RESET time = 0us
ata1-master: setting PIO4 on Intel PIIX3 chip
ata1-master: setting WDMA2 on Intel PIIX3 chip
acd0: <QEMU CD-ROM/0.6.1> CDROM drive at ata1 as master
acd0: read 689KB/s (689KB/s), 512KB buffer, WDMA2
acd0: Reads:
acd0: Writes:
acd0: Mechanism: ejectable tray, unlocked
acd0: Medium: no/blank disc
...
Here is a version of the patch that applies to 0.6.1 and cvs (up to now)
so others can test it more easily (with dma for cdrom), tell me if i
applied something wrong:
Index: qemu/hw/ide.c
@@ -430,6 +430,8 @@
put_le16(p + 59, 0x100 | s->mult_sectors);
put_le16(p + 60, s->nb_sectors);
put_le16(p + 61, s->nb_sectors >> 16);
+ put_le16(p + 63, 0x07 /*| 0x4 << 8*/); /* Multiword DMA supported/selected */
+ put_le16(p + 64, 0x3f); /* PIO modes supported */
put_le16(p + 80, (1 << 1) | (1 << 2));
put_le16(p + 82, (1 << 14));
put_le16(p + 83, (1 << 14));
@@ -437,7 +439,7 @@
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 + 88, 0x3f | (1 << 13)); /* UltraDMA modes supported/selected */
put_le16(p + 93, 1 | (1 << 14) | 0x2000 | 0x4000);
}
@@ -458,10 +460,10 @@
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 + 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 */
+ put_le16(p + 49, 1 << 9 | 1 << 8); /* DMA and LBA supported */
+ put_le16(p + 53, 7); /* words 64-70, 54-58, 88 valid */
+ put_le16(p + 63, 7 /*| 0x4 << 8*/); /* Multiword DMA supported/selected */
+ put_le16(p + 64, 0x3f); /* PIO modes supported */
put_le16(p + 65, 0xb4); /* minimum DMA multiword tx cycle time */
put_le16(p + 66, 0xb4); /* recommended DMA multiword tx cycle time */
put_le16(p + 67, 0x12c); /* minimum PIO cycle time without flow control */
@@ -471,6 +473,7 @@
put_le16(p + 72, 30); /* in ns */
put_le16(p + 80, 0x1e); /* support up to ATA/ATAPI-4 */
+ put_le16(p + 88, 0x3f | 0x20 << 8); /* UltraDMA modes supported/selected */
}
static void ide_set_signature(IDEState *s)
@@ -500,6 +503,10 @@
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);
@@ -2176,6 +2183,7 @@
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
^ permalink raw reply [flat|nested] 42+ messages in thread
* Re: [Qemu-devel] enabling bus-master IDE driver
2004-11-16 19:41 ` Juergen Lock
@ 2004-11-23 5:12 ` Norikatsu Shigemura
2004-11-25 21:12 ` Juergen Lock
0 siblings, 1 reply; 42+ messages in thread
From: Norikatsu Shigemura @ 2004-11-23 5:12 UTC (permalink / raw)
To: qemu-l; +Cc: qemu-devel
On Tue, 16 Nov 2004 20:41:35 +0100
Juergen Lock <qemu-l@jelal.kn-bremen.de> wrote:
> > > It now says "Current Transfer Mode: Multi-Word DMA Mode 2".
> > > I'm not real sure how I test to see if disk access is faster,
> > > or by how much, but this appears to be progress for XP.
> > Windows 2000 isn't that verbose - it simply prints "DMA mode".
> > Interesting that XP has enabled "Multi-Word DMA Mode 2".
> >...
> FreeBSD guests (at least 5.3-BETA1) say they use WDMA2, which i guess
> is the same:
Your patch works quite good. I confirmed that it works on
Windows XP SP2 and FreeBSD 5.3-RELEASE as guest OSs, and
host's cpu loadavg reduced(MAX: 97% -> 30% on boot, etc..).
# http://people.FreeBSD.org/~nork/qemu/qemu05.png but Japanese
May I commit your patch as ports/emulators/qemu/files/patch-hw::ide.c?
^ permalink raw reply [flat|nested] 42+ messages in thread
* Re: [Qemu-devel] enabling bus-master IDE driver
2004-11-23 5:12 ` Norikatsu Shigemura
@ 2004-11-25 21:12 ` Juergen Lock
0 siblings, 0 replies; 42+ messages in thread
From: Juergen Lock @ 2004-11-25 21:12 UTC (permalink / raw)
To: Norikatsu Shigemura; +Cc: qemu-devel
On Tue, Nov 23, 2004 at 04:03:39PM +0000, Norikatsu Shigemura wrote:
> On Tue, 16 Nov 2004 20:41:35 +0100
> Juergen Lock <qemu-l@jelal.kn-bremen.de> wrote:
> > > > It now says "Current Transfer Mode: Multi-Word DMA Mode 2".
> > > > I'm not real sure how I test to see if disk access is faster,
> > > > or by how much, but this appears to be progress for XP.
> > > Windows 2000 isn't that verbose - it simply prints "DMA mode".
> > > Interesting that XP has enabled "Multi-Word DMA Mode 2".
> > >...
> > FreeBSD guests (at least 5.3-BETA1) say they use WDMA2, which i guess
> > is the same:
>
> Your patch works quite good. I confirmed that it works on
> Windows XP SP2 and FreeBSD 5.3-RELEASE as guest OSs, and
> host's cpu loadavg reduced(MAX: 97% -> 30% on boot, etc..).
>
> # http://people.FreeBSD.org/~nork/qemu/qemu05.png but Japanese
>
> May I commit your patch as ports/emulators/qemu/files/patch-hw::ide.c?
>
Mmmh actually I was waiting for words from people in the know about
this, like is WDMA2 really the best we're gonna get? Since linux guests'
DMA was reported to be faster without the patch...
Juergen
^ permalink raw reply [flat|nested] 42+ messages in thread
* Re: [Qemu-devel] enabling bus-master IDE driver
@ 2004-11-05 15:37 Juergen Keil
2004-11-05 15:43 ` zitu
2004-11-05 15:45 ` zitu
0 siblings, 2 replies; 42+ messages in thread
From: Juergen Keil @ 2004-11-05 15:37 UTC (permalink / raw)
To: qemu-devel
> Quoting zitu <zitu@free.fr>:
> > >
> > > 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
Aha, and Windows uses these commands, on small HDDs <= 128GB ?
> 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 ???
The *_EXT versions are apparently for HDDs with capacities >128GB, these
need 48-bit LBA addresses to access the HDD space over the 128GB mark.
I guess that Solaris/Linux uses the commands with the smaller 28-bit
LBA disk addresses for small disks with capacities <= 128GB.
An interesting experiment would be to setup a QEMU HDD image > 128GB,
then try Solaris x86/Linux with such a big disk and check if it still
works. Probably not.
^ permalink raw reply [flat|nested] 42+ messages in thread
* Re: [Qemu-devel] enabling bus-master IDE driver
2004-11-05 15:37 Juergen Keil
@ 2004-11-05 15:43 ` zitu
2004-11-05 15:45 ` zitu
1 sibling, 0 replies; 42+ messages in thread
From: zitu @ 2004-11-05 15:43 UTC (permalink / raw)
To: Juergen Keil, qemu-devel
Quoting Juergen Keil <jk@tools.de>:
> > WIN_WRITEDMA_EXT & WIN_READDMA_EXT cases are not defined in hw/ide.c
>
> Aha, and Windows uses these commands, on small HDDs <= 128GB ?
Apparently no... I realized after I wrote this email that WIN_WRITEDMA
should be the right command to invoke,
>
>
> > 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 ???
>
> The *_EXT versions are apparently for HDDs with capacities >128GB, these
> need 48-bit LBA addresses to access the HDD space over the 128GB mark.
>
> I guess that Solaris/Linux uses the commands with the smaller 28-bit
> LBA disk addresses for small disks with capacities <= 128GB.
>
> An interesting experiment would be to setup a QEMU HDD image > 128GB,
> then try Solaris x86/Linux with such a big disk and check if it still
> works. Probably not.
>
>
>
> _______________________________________________
> Qemu-devel mailing list
> Qemu-devel@nongnu.org
> http://lists.nongnu.org/mailman/listinfo/qemu-devel
>
--
^ permalink raw reply [flat|nested] 42+ messages in thread
* Re: [Qemu-devel] enabling bus-master IDE driver
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
1 sibling, 1 reply; 42+ messages in thread
From: zitu @ 2004-11-05 15:45 UTC (permalink / raw)
To: Juergen Keil, qemu-devel
Quoting Juergen Keil <jk@tools.de>:
> > WIN_WRITEDMA_EXT & WIN_READDMA_EXT cases are not defined in hw/ide.c
>
> Aha, and Windows uses these commands, on small HDDs <= 128GB ?
I realized after I wrote this email that WIN_WRITEDMA should be the
right command invoked. I added some printf, nope, it's never called.
WIN_READ on the contrary is always called. I'm poking around the
command now to make it like it's DMA'ed.
> The *_EXT versions are apparently for HDDs with capacities >128GB, these
> need 48-bit LBA addresses to access the HDD space over the 128GB mark.
I wrote my previous email too soon, without experimenting much. I'll be
more careful.
Zitu
--
^ permalink raw reply [flat|nested] 42+ messages in thread
* Re: [Qemu-devel] enabling bus-master IDE driver
2004-11-05 15:45 ` zitu
@ 2004-11-05 15:52 ` Jens Axboe
2004-11-05 16:10 ` zitu
0 siblings, 1 reply; 42+ messages in thread
From: Jens Axboe @ 2004-11-05 15:52 UTC (permalink / raw)
To: qemu-devel
On Fri, Nov 05 2004, zitu wrote:
> Quoting Juergen Keil <jk@tools.de>:
> > > WIN_WRITEDMA_EXT & WIN_READDMA_EXT cases are not defined in hw/ide.c
> >
> > Aha, and Windows uses these commands, on small HDDs <= 128GB ?
At least Linux 2.6 will use them on any capacity drive, if the drive has
support for lba48. You can do bigger transfers that way,
WIN_READDMA/WRITEDMA can only do 128kb at the time.
But qemu does not flag lba48 support, so neither Linux nor Windows
should use the _EXT commands regardless.
--
Jens Axboe
^ permalink raw reply [flat|nested] 42+ messages in thread
* Re: [Qemu-devel] enabling bus-master IDE driver
2004-11-05 15:52 ` Jens Axboe
@ 2004-11-05 16:10 ` zitu
2004-11-05 17:30 ` Damien Mascord
0 siblings, 1 reply; 42+ messages in thread
From: zitu @ 2004-11-05 16:10 UTC (permalink / raw)
To: qemu-devel
>From a clean and quick boot with shutdown of XP, this is the type of access
to a 512MB hdd image:
3028 WIN_READ
500 WIN_WRITE
1 WIN_SPECIFY
70 WIN_PACKETCMD
4 WIN_PIDENTIFY
1 WIN_IDLEIMMEDIATE
194 WIN_CHECKPOWERMODE1
1 WIN_FLUSH_CACHE
3 WIN_IDENTIFY
3 WIN_SETFEATURES
No DMA... How do I make the system recognize DMA capability then ?
WIN_READ_DMA and WIN_WRITE_DMA exist, but never get called... :(
Zitu
--
^ permalink raw reply [flat|nested] 42+ messages in thread
* [Qemu-devel] enabling bus-master IDE driver
@ 2004-11-04 20:35 Simon Frew
2004-11-05 13:32 ` zitu
0 siblings, 1 reply; 42+ messages in thread
From: Simon Frew @ 2004-11-04 20:35 UTC (permalink / raw)
To: qemu-devel
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
^ permalink raw reply [flat|nested] 42+ messages in thread
* Re: [Qemu-devel] enabling bus-master IDE driver
2004-11-04 20:35 Simon Frew
@ 2004-11-05 13:32 ` zitu
2004-11-05 15:02 ` zitu
0 siblings, 1 reply; 42+ messages in thread
From: zitu @ 2004-11-05 13:32 UTC (permalink / raw)
To: qemu-devel
Quoting Simon Frew <thargthedestroyer@hotmail.com>:
> 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!
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.
>
> 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
--
^ permalink raw reply [flat|nested] 42+ messages in thread
* Re: [Qemu-devel] enabling bus-master IDE driver
2004-11-05 13:32 ` zitu
@ 2004-11-05 15:02 ` zitu
2004-11-06 1:53 ` Jason Brittain
0 siblings, 1 reply; 42+ messages in thread
From: zitu @ 2004-11-05 15:02 UTC (permalink / raw)
To: qemu-devel
Quoting zitu <zitu@free.fr>:
> >
> > 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
--
^ permalink raw reply [flat|nested] 42+ messages in thread
* Re: [Qemu-devel] enabling bus-master IDE driver
2004-11-05 15:02 ` zitu
@ 2004-11-06 1:53 ` Jason Brittain
2004-11-06 14:27 ` Johannes Schindelin
0 siblings, 1 reply; 42+ messages in thread
From: Jason Brittain @ 2004-11-06 1:53 UTC (permalink / raw)
To: qemu-devel
zitu wrote:
> Quoting zitu <zitu@free.fr>:
>
>>>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 ???
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.
--
Jason Brittain
^ permalink raw reply [flat|nested] 42+ messages in thread
* Re: [Qemu-devel] enabling bus-master IDE driver
2004-11-06 1:53 ` Jason Brittain
@ 2004-11-06 14:27 ` Johannes Schindelin
2004-11-06 21:52 ` Jason Brittain
2004-11-06 21:57 ` James Boddington
0 siblings, 2 replies; 42+ messages in thread
From: Johannes Schindelin @ 2004-11-06 14:27 UTC (permalink / raw)
To: qemu-devel
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 would expect a different error if the drive
is not capable of doing DMA.
Ciao,
Dscho
^ permalink raw reply [flat|nested] 42+ messages in thread
* Re: [Qemu-devel] enabling bus-master IDE driver
2004-11-06 14:27 ` Johannes Schindelin
@ 2004-11-06 21:52 ` Jason Brittain
2004-11-07 9:03 ` Jens Axboe
2004-11-06 21:57 ` James Boddington
1 sibling, 1 reply; 42+ messages in thread
From: Jason Brittain @ 2004-11-06 21:52 UTC (permalink / raw)
To: qemu-devel
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 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?
--
Jason Brittain
^ permalink raw reply [flat|nested] 42+ messages in thread
* Re: [Qemu-devel] enabling bus-master IDE driver
2004-11-06 21:52 ` Jason Brittain
@ 2004-11-07 9:03 ` Jens Axboe
2004-11-07 9:21 ` Jens Axboe
` (2 more replies)
0 siblings, 3 replies; 42+ messages in thread
From: Jens Axboe @ 2004-11-07 9:03 UTC (permalink / raw)
To: qemu-devel
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
^ permalink raw reply [flat|nested] 42+ messages in thread
* Re: [Qemu-devel] enabling bus-master IDE driver
2004-11-07 9:03 ` Jens Axboe
@ 2004-11-07 9:21 ` Jens Axboe
2004-11-07 9:38 ` Jens Axboe
2004-11-07 11:02 ` James Boddington
2004-11-10 1:41 ` James Boddington
2 siblings, 1 reply; 42+ messages in thread
From: Jens Axboe @ 2004-11-07 9:21 UTC (permalink / raw)
To: qemu-devel
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.
--
Jens Axboe
^ permalink raw reply [flat|nested] 42+ messages in thread
* Re: [Qemu-devel] enabling bus-master IDE driver
2004-11-07 9:21 ` Jens Axboe
@ 2004-11-07 9:38 ` Jens Axboe
2004-11-07 11:01 ` Hetz Ben Hamo
0 siblings, 1 reply; 42+ messages in thread
From: Jens Axboe @ 2004-11-07 9:38 UTC (permalink / raw)
To: qemu-devel
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
^ permalink raw reply [flat|nested] 42+ messages in thread
* Re: [Qemu-devel] enabling bus-master IDE driver
2004-11-07 9:38 ` Jens Axboe
@ 2004-11-07 11:01 ` Hetz Ben Hamo
2004-11-07 11:16 ` Jens Axboe
0 siblings, 1 reply; 42+ messages in thread
From: Hetz Ben Hamo @ 2004-11-07 11:01 UTC (permalink / raw)
To: qemu-devel
> > > - 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
^ permalink raw reply [flat|nested] 42+ messages in thread
* Re: [Qemu-devel] enabling bus-master IDE driver
2004-11-07 11:01 ` Hetz Ben Hamo
@ 2004-11-07 11:16 ` Jens Axboe
2004-11-08 10:15 ` zitu
` (2 more replies)
0 siblings, 3 replies; 42+ messages in thread
From: Jens Axboe @ 2004-11-07 11:16 UTC (permalink / raw)
To: Hetz Ben Hamo; +Cc: qemu-devel
On Sun, Nov 07 2004, Hetz Ben Hamo wrote:
> > > > - 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.28 ide.c
--- hw/ide.c 9 Oct 2004 20:27:55 -0000 1.28
+++ hw/ide.c 7 Nov 2004 11:19:52 -0000
@@ -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:
--
Jens Axboe
^ permalink raw reply [flat|nested] 42+ messages in thread
* Re: [Qemu-devel] enabling bus-master IDE driver
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-11 17:29 ` Jason Brittain
2 siblings, 1 reply; 42+ messages in thread
From: zitu @ 2004-11-08 10:15 UTC (permalink / raw)
To: qemu-devel, Jens Axboe
Quoting Jens Axboe <qemu@kernel.dk>:
> On Sun, Nov 07 2004, Hetz Ben Hamo wrote:
> > > > > - 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
--
^ permalink raw reply [flat|nested] 42+ messages in thread
* RE: [Qemu-devel] enabling bus-master IDE driver
2004-11-08 10:15 ` zitu
@ 2004-11-08 16:51 ` Andreas Bollhalder
0 siblings, 0 replies; 42+ messages in thread
From: Andreas Bollhalder @ 2004-11-08 16:51 UTC (permalink / raw)
To: qemu-devel
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: qemu-devel-bounces+bolle=geodb.org@nongnu.org
[mailto:qemu-devel-bounces+bolle=geodb.org@nongnu.org] On Behalf Of
zitu
Sent: Monday, November 08, 2004 11:15 AM
To: qemu-devel@nongnu.org; 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 <qemu@kernel.dk>:
> On Sun, Nov 07 2004, Hetz Ben Hamo wrote:
> > > > > - 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
--
_______________________________________________
Qemu-devel mailing list
Qemu-devel@nongnu.org
http://lists.nongnu.org/mailman/listinfo/qemu-devel
^ permalink raw reply [flat|nested] 42+ messages in thread
* Re: [Qemu-devel] enabling bus-master IDE driver
2004-11-07 11:16 ` Jens Axboe
2004-11-08 10:15 ` zitu
@ 2004-11-09 7:38 ` Paul Jakma
2004-11-09 10:28 ` Hetz Ben Hamo
2004-11-11 17:29 ` Jason Brittain
2 siblings, 1 reply; 42+ messages in thread
From: Paul Jakma @ 2004-11-09 7:38 UTC (permalink / raw)
To: Jens Axboe; +Cc: 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
On Sun, 7 Nov 2004, Jens Axboe wrote:
> Here you go.
>
> 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 11:19:52 -0000
> @@ -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:
>
>
--
Paul Jakma paul@clubi.ie paul@jakma.org Key ID: 64A2FF6A
Fortune:
It is not enough to have great qualities, we should also have the
management of them.
-- La Rochefoucauld
^ permalink raw reply [flat|nested] 42+ messages in thread
* Re: [Qemu-devel] enabling bus-master IDE driver
2004-11-09 7:38 ` Paul Jakma
@ 2004-11-09 10:28 ` Hetz Ben Hamo
2004-11-09 13:53 ` Paul Jakma
0 siblings, 1 reply; 42+ messages in thread
From: Hetz Ben Hamo @ 2004-11-09 10:28 UTC (permalink / raw)
To: Paul Jakma, Fabrice Bellard; +Cc: qemu-devel
Where's your patch?
Also, I'm CC'ing Fabrice..
Thanks,
Hetz
On Tuesday 09 November 2004 09:38, Paul Jakma wrote:
> 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
>
> On Sun, 7 Nov 2004, Jens Axboe wrote:
> > Here you go.
> >
> > 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 11:19:52 -0000
> > @@ -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:
^ permalink raw reply [flat|nested] 42+ messages in thread
* Re: [Qemu-devel] enabling bus-master IDE driver
2004-11-09 10:28 ` Hetz Ben Hamo
@ 2004-11-09 13:53 ` Paul Jakma
0 siblings, 0 replies; 42+ messages in thread
From: Paul Jakma @ 2004-11-09 13:53 UTC (permalink / raw)
To: Hetz Ben Hamo; +Cc: qemu-devel
On Tue, 9 Nov 2004, Hetz Ben Hamo wrote:
> 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).
> 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'.
> Thanks,
> Hetz
regards,
--
Paul Jakma paul@clubi.ie paul@jakma.org Key ID: 64A2FF6A
Fortune:
You may call me by my name, Wirth, or by my value, Worth.
- Nicklaus Wirth
^ permalink raw reply [flat|nested] 42+ messages in thread
* Re: [Qemu-devel] enabling bus-master IDE driver
2004-11-07 11:16 ` Jens Axboe
2004-11-08 10:15 ` zitu
2004-11-09 7:38 ` Paul Jakma
@ 2004-11-11 17:29 ` Jason Brittain
2004-11-11 19:06 ` Jens Axboe
2 siblings, 1 reply; 42+ messages in thread
From: Jason Brittain @ 2004-11-11 17:29 UTC (permalink / raw)
To: qemu-devel
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.
--
Jason Brittain
Jens Axboe wrote:
> On Sun, Nov 07 2004, Hetz Ben Hamo wrote:
>
>>>>>- 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.28 ide.c
> --- hw/ide.c 9 Oct 2004 20:27:55 -0000 1.28
> +++ hw/ide.c 7 Nov 2004 11:19:52 -0000
> @@ -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:
>
^ permalink raw reply [flat|nested] 42+ messages in thread
* Re: [Qemu-devel] enabling bus-master IDE driver
2004-11-11 17:29 ` Jason Brittain
@ 2004-11-11 19:06 ` Jens Axboe
2004-11-11 19:02 ` Jason Brittain
0 siblings, 1 reply; 42+ messages in thread
From: Jens Axboe @ 2004-11-11 19:06 UTC (permalink / raw)
To: qemu-devel
On Thu, Nov 11 2004, Jason Brittain wrote:
> 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.
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.
--
Jens Axboe
^ permalink raw reply [flat|nested] 42+ messages in thread
* Re: [Qemu-devel] enabling bus-master IDE driver
2004-11-11 19:06 ` Jens Axboe
@ 2004-11-11 19:02 ` Jason Brittain
2004-11-11 19:16 ` Jens Axboe
0 siblings, 1 reply; 42+ messages in thread
From: Jason Brittain @ 2004-11-11 19:02 UTC (permalink / raw)
To: qemu-devel
Jens Axboe wrote:
> On Thu, Nov 11 2004, Jason Brittain wrote:
>
>>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.
>
>
> 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:
--- hw/ide.c-bad 2004-11-11 07:54:34.000000000 -0800
+++ hw/ide.c 2004-11-11 08:56:23.000000000 -0800
@@ -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.
--
Jason Brittain
^ permalink raw reply [flat|nested] 42+ messages in thread
* Re: [Qemu-devel] enabling bus-master IDE driver
2004-11-11 19:02 ` Jason Brittain
@ 2004-11-11 19:16 ` Jens Axboe
2004-11-12 8:42 ` Jens Axboe
0 siblings, 1 reply; 42+ messages in thread
From: Jens Axboe @ 2004-11-11 19:16 UTC (permalink / raw)
To: qemu-devel
On Thu, Nov 11 2004, Jason Brittain wrote:
> Jens Axboe wrote:
> >On Thu, Nov 11 2004, Jason Brittain wrote:
> >
> >>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.
> >
> >
> >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:
>
> --- hw/ide.c-bad 2004-11-11 07:54:34.000000000 -0800
> +++ hw/ide.c 2004-11-11 08:56:23.000000000 -0800
> @@ -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.
Ah thanks, I'll apply the fix and attempt a new install.
--
Jens Axboe
^ permalink raw reply [flat|nested] 42+ messages in thread
* Re: [Qemu-devel] enabling bus-master IDE driver
2004-11-11 19:16 ` Jens Axboe
@ 2004-11-12 8:42 ` Jens Axboe
0 siblings, 0 replies; 42+ messages in thread
From: Jens Axboe @ 2004-11-12 8:42 UTC (permalink / raw)
To: qemu-devel
On Thu, Nov 11 2004, Jens Axboe wrote:
> On Thu, Nov 11 2004, Jason Brittain wrote:
> > Jens Axboe wrote:
> > >On Thu, Nov 11 2004, Jason Brittain wrote:
> > >
> > >>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.
> > >
> > >
> > >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:
> >
> > --- hw/ide.c-bad 2004-11-11 07:54:34.000000000 -0800
> > +++ hw/ide.c 2004-11-11 08:56:23.000000000 -0800
> > @@ -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.
>
> 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'
--
Jens Axboe
^ permalink raw reply [flat|nested] 42+ messages in thread
* Re: [Qemu-devel] enabling bus-master IDE driver
2004-11-07 9:03 ` Jens Axboe
2004-11-07 9:21 ` Jens Axboe
@ 2004-11-07 11:02 ` James Boddington
2004-11-10 1:41 ` James Boddington
2 siblings, 0 replies; 42+ messages in thread
From: James Boddington @ 2004-11-07 11:02 UTC (permalink / raw)
To: qemu-devel
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 */
>
Just had it work, hdparm -t /dev/hda is now reporting nearly double the
speed.
--
James
^ permalink raw reply [flat|nested] 42+ messages in thread
* Re: [Qemu-devel] enabling bus-master IDE driver
2004-11-07 9:03 ` Jens Axboe
2004-11-07 9:21 ` Jens Axboe
2004-11-07 11:02 ` James Boddington
@ 2004-11-10 1:41 ` James Boddington
2 siblings, 0 replies; 42+ messages in thread
From: James Boddington @ 2004-11-10 1:41 UTC (permalink / raw)
To: qemu-devel
Jens Axboe wrote:
> 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 */
>
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
diff -u -r1.29 ide.c
--- hw/ide.c 9 Nov 2004 22:04:05 -0000 1.29
+++ hw/ide.c 10 Nov 2004 01:19:32 -0000
@@ -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 */
--
James
^ permalink raw reply [flat|nested] 42+ messages in thread
* Re: [Qemu-devel] enabling bus-master IDE driver
2004-11-06 14:27 ` Johannes Schindelin
2004-11-06 21:52 ` Jason Brittain
@ 2004-11-06 21:57 ` James Boddington
2004-11-06 22:11 ` James Boddington
1 sibling, 1 reply; 42+ messages in thread
From: James Boddington @ 2004-11-06 21:57 UTC (permalink / raw)
To: qemu-devel
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 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:pio
I found 2000 is using pio as well.
--
James
^ permalink raw reply [flat|nested] 42+ messages in thread
* Re: [Qemu-devel] enabling bus-master IDE driver
2004-11-06 21:57 ` James Boddington
@ 2004-11-06 22:11 ` James Boddington
2004-11-06 23:46 ` zitu
0 siblings, 1 reply; 42+ messages in thread
From: James Boddington @ 2004-11-06 22:11 UTC (permalink / raw)
To: qemu-devel
James Boddington wrote:
> 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.
--
James
^ permalink raw reply [flat|nested] 42+ messages in thread
* Re: [Qemu-devel] enabling bus-master IDE driver
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
0 siblings, 2 replies; 42+ messages in thread
From: zitu @ 2004-11-06 23:46 UTC (permalink / raw)
To: qemu-devel
Quoting James Boddington <boddingt@optusnet.com.au>:
> James Boddington wrote:
>
> > 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
--
^ permalink raw reply [flat|nested] 42+ messages in thread
* Re: [Qemu-devel] enabling bus-master IDE driver
2004-11-06 23:46 ` zitu
@ 2004-11-07 0:41 ` jeebs
2004-11-07 7:12 ` Jason Brittain
1 sibling, 0 replies; 42+ messages in thread
From: jeebs @ 2004-11-07 0:41 UTC (permalink / raw)
To: qemu-devel
From: "zitu"
>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
http://www.microsoft.com/whdc/driver/kernel/KB-drv.mspx
http://www.microsoft.com/whdc/archive/default.mspx
^ permalink raw reply [flat|nested] 42+ messages in thread
* Re: [Qemu-devel] enabling bus-master IDE driver
2004-11-06 23:46 ` zitu
2004-11-07 0:41 ` jeebs
@ 2004-11-07 7:12 ` Jason Brittain
1 sibling, 0 replies; 42+ messages in thread
From: Jason Brittain @ 2004-11-07 7:12 UTC (permalink / raw)
To: qemu-devel
zitu wrote:
> Quoting James Boddington <boddingt@optusnet.com.au>:
>
>>James Boddington wrote:
>>
>>>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 :)
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.
--
Jason Brittain
^ permalink raw reply [flat|nested] 42+ messages in thread
end of thread, other threads:[~2004-11-28 20:11 UTC | newest]
Thread overview: 42+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-11-12 14:27 [Qemu-devel] enabling bus-master IDE driver Juergen Keil
2004-11-12 18:02 ` Jason Brittain
-- strict thread matches above, loose matches on Subject: below --
2004-11-26 10:48 Juergen Keil
2004-11-28 20:09 ` Juergen Lock
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-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-04 20:35 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
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
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).