* [Qemu-devel] [PATCH] -win2k-hack performance+DMA support
@ 2006-02-02 18:38 Leonardo E. Reiter
2006-02-09 14:03 ` Brad Campbell
0 siblings, 1 reply; 4+ messages in thread
From: Leonardo E. Reiter @ 2006-02-02 18:38 UTC (permalink / raw)
To: QEMU Developer Mailing List
[-- Attachment #1: Type: text/plain, Size: 718 bytes --]
Attached is a patch which greatly speeds up disk writes when using
-win2k-hack to install Windows 2000. It only delays every 16th
interrupt, which after rigorous testing is still enough to overcome the
"Windows 2000 disk full" bug. If you are really adventurous you can try
it every 32nd time, but for me that caused problems during some
installations, so I thought it was too aggressive.
This patch also adds -win2k-hack functionality to DMA writes, since DMA
now works in the latest CVS QEMU.
Enjoy,
Leo Reiter
--
Leonardo E. Reiter
Vice President of Product Development, CTO
Win4Lin, Inc.
Virtual Computing from Desktop to Data Center
Main: +1 512 339 7979
Fax: +1 512 532 6501
http://www.win4lin.com
[-- Attachment #2: qemu-win2k-hack-perf.patch --]
[-- Type: text/x-patch, Size: 1951 bytes --]
Index: hw/ide.c
===================================================================
RCS file: /cvsroot/qemu/qemu/hw/ide.c,v
retrieving revision 1.39
diff -a -u -r1.39 ide.c
--- hw/ide.c 1 Feb 2006 22:20:12 -0000 1.39
+++ hw/ide.c 2 Feb 2006 01:48:25 -0000
@@ -336,6 +336,7 @@
uint8_t *data_end;
uint8_t io_buffer[MAX_MULT_SECTORS*512 + 4];
QEMUTimer *sector_write_timer; /* only used for win2k instal hack */
+ uint32_t irq_count; /* counts IRQs when using win2k install hack */
} IDEState;
#define BM_STATUS_DMAING 0x01
@@ -712,7 +713,7 @@
ide_set_sector(s, sector_num + n);
#ifdef TARGET_I386
- if (win2k_install_hack) {
+ if (win2k_install_hack && ((++s->irq_count % 16) == 0)) {
/* It seems there is a bug in the Windows 2000 installer HDD
IDE driver which fills the disk with empty logs when the
IDE write IRQ comes too early. This hack tries to correct
@@ -750,7 +751,19 @@
if (n == 0) {
/* end of transfer */
s->status = READY_STAT | SEEK_STAT;
- ide_set_irq(s);
+#ifdef TARGET_I386
+ if (win2k_install_hack && ((++s->irq_count % 16) == 0)) {
+ /* It seems there is a bug in the Windows 2000 installer
+ HDD IDE driver which fills the disk with empty logs
+ when the IDE write IRQ comes too early. This hack tries
+ to correct that at the expense of slower write
+ performances. Use this option _only_ to install Windows
+ 2000. You must disable it for normal use. */
+ qemu_mod_timer(s->sector_write_timer,
+ qemu_get_clock(vm_clock) + (ticks_per_sec / 1000));
+ } else
+#endif
+ ide_set_irq(s);
return 0;
}
if (n > MAX_MULT_SECTORS)
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [Qemu-devel] [PATCH] -win2k-hack performance+DMA support
2006-02-02 18:38 [Qemu-devel] [PATCH] -win2k-hack performance+DMA support Leonardo E. Reiter
@ 2006-02-09 14:03 ` Brad Campbell
2006-02-09 19:35 ` Leonardo E. Reiter
2006-04-20 0:32 ` Troy Benjegerdes
0 siblings, 2 replies; 4+ messages in thread
From: Brad Campbell @ 2006-02-09 14:03 UTC (permalink / raw)
To: qemu-devel
Leonardo E. Reiter wrote:
> Attached is a patch which greatly speeds up disk writes when using
> -win2k-hack to install Windows 2000. It only delays every 16th
> interrupt, which after rigorous testing is still enough to overcome the
> "Windows 2000 disk full" bug. If you are really adventurous you can try
> it every 32nd time, but for me that caused problems during some
> installations, so I thought it was too aggressive.
>
> This patch also adds -win2k-hack functionality to DMA writes, since DMA
> now works in the latest CVS QEMU.
>
Using todays CVS, and kqemu in user mode only I tried to install Win2k-SP4 25 times all with disk
full errors until I applied this patch.
It would appear the installer will use DMA mode if it's available and therefore the existing
win2k-hack does not work.
Using this patch 5 out of 5 installs worked perfectly.
Thanks Leo :)
Regards,
Brad
--
"Human beings, who are almost unique in having the ability
to learn from the experience of others, are also remarkable
for their apparent disinclination to do so." -- Douglas Adams
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [Qemu-devel] [PATCH] -win2k-hack performance+DMA support
2006-02-09 14:03 ` Brad Campbell
@ 2006-02-09 19:35 ` Leonardo E. Reiter
2006-04-20 0:32 ` Troy Benjegerdes
1 sibling, 0 replies; 4+ messages in thread
From: Leonardo E. Reiter @ 2006-02-09 19:35 UTC (permalink / raw)
To: qemu-devel
No problem... hopefully Fabrice will apply this patch to CVS soon.
We've been testing/deploying this mechanism (every 16th interrupt) with
Win4Lin Pro for a long time now with no disk full problems, so I can
vouch that it's reliable (and quite fast compared to delaying on *every*
interrupt). As for the DMA reintroducing the problem, that's
understandable since Fabrice didn't originally implement the
win2k_install_hack check for the DMA callback in hw/ide.c. It was a
moot point since DMA didn't work with Windows 2000 anyway in QEMU CVS
until very recently, but since it does now, it will cause problems
unless it handles -win2k-hack as well.
- Leo Reiter
Brad Campbell wrote:
> Using todays CVS, and kqemu in user mode only I tried to install
> Win2k-SP4 25 times all with disk full errors until I applied this patch.
> It would appear the installer will use DMA mode if it's available and
> therefore the existing win2k-hack does not work.
>
> Using this patch 5 out of 5 installs worked perfectly.
>
> Thanks Leo :)
>
> Regards,
> Brad
--
Leonardo E. Reiter
Vice President of Product Development, CTO
Win4Lin, Inc.
Virtual Computing from Desktop to Data Center
Main: +1 512 339 7979
Fax: +1 512 532 6501
http://www.win4lin.com
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [Qemu-devel] [PATCH] -win2k-hack performance+DMA support
2006-02-09 14:03 ` Brad Campbell
2006-02-09 19:35 ` Leonardo E. Reiter
@ 2006-04-20 0:32 ` Troy Benjegerdes
1 sibling, 0 replies; 4+ messages in thread
From: Troy Benjegerdes @ 2006-04-20 0:32 UTC (permalink / raw)
To: qemu-devel
On Thu, Feb 09, 2006 at 06:03:53PM +0400, Brad Campbell wrote:
> Leonardo E. Reiter wrote:
> >Attached is a patch which greatly speeds up disk writes when using
> >-win2k-hack to install Windows 2000. It only delays every 16th
> >interrupt, which after rigorous testing is still enough to overcome the
> >"Windows 2000 disk full" bug. If you are really adventurous you can try
> >it every 32nd time, but for me that caused problems during some
> >installations, so I thought it was too aggressive.
> >
> >This patch also adds -win2k-hack functionality to DMA writes, since DMA
> >now works in the latest CVS QEMU.
> >
>
> Using todays CVS, and kqemu in user mode only I tried to install Win2k-SP4
> 25 times all with disk full errors until I applied this patch.
> It would appear the installer will use DMA mode if it's available and
> therefore the existing win2k-hack does not work.
>
> Using this patch 5 out of 5 installs worked perfectly.
>
> Thanks Leo :)
>
> Regards,
> Brad
with current CVS, I am unable to install win2k.. This patch appears to
be needed for win2k installs to work.
With this patch, I am able to install w2k with user-kqemu.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2006-04-20 0:32 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-02-02 18:38 [Qemu-devel] [PATCH] -win2k-hack performance+DMA support Leonardo E. Reiter
2006-02-09 14:03 ` Brad Campbell
2006-02-09 19:35 ` Leonardo E. Reiter
2006-04-20 0:32 ` Troy Benjegerdes
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).