From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1F4jOt-000400-Tk for qemu-devel@nongnu.org; Thu, 02 Feb 2006 13:41:48 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1F4jOr-0003xb-Tb for qemu-devel@nongnu.org; Thu, 02 Feb 2006 13:41:47 -0500 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1F4jOr-0003xV-GI for qemu-devel@nongnu.org; Thu, 02 Feb 2006 13:41:45 -0500 Received: from [216.145.243.178] (helo=td01009.thindesktop.net) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA:32) (Exim 4.52) id 1F4jNj-0004ub-Kz for qemu-devel@nongnu.org; Thu, 02 Feb 2006 13:40:35 -0500 Received: from c-24-30-92-59.hsd1.ga.comcast.net ([24.30.92.59] helo=[10.1.0.1]) by td01009.thindesktop.net with esmtpa (Exim 4.52) id 1F4jLg-0003gs-CB for qemu-devel@nongnu.org; Thu, 02 Feb 2006 12:38:28 -0600 Message-ID: <43E251A3.2070706@win4lin.com> Date: Thu, 02 Feb 2006 13:38:27 -0500 From: "Leonardo E. Reiter" MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="------------050001040209080303030909" Subject: [Qemu-devel] [PATCH] -win2k-hack performance+DMA support Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: QEMU Developer Mailing List This is a multi-part message in MIME format. --------------050001040209080303030909 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit 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 --------------050001040209080303030909 Content-Type: text/x-patch; name="qemu-win2k-hack-perf.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="qemu-win2k-hack-perf.patch" 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) --------------050001040209080303030909--