From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LQ4pB-0003PY-16 for qemu-devel@nongnu.org; Thu, 22 Jan 2009 14:02:45 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LQ4p8-0003OW-Im for qemu-devel@nongnu.org; Thu, 22 Jan 2009 14:02:44 -0500 Received: from [199.232.76.173] (port=44011 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LQ4p8-0003OQ-ER for qemu-devel@nongnu.org; Thu, 22 Jan 2009 14:02:42 -0500 Received: from e4.ny.us.ibm.com ([32.97.182.144]:49026) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1LQ4p7-0002yI-Ug for qemu-devel@nongnu.org; Thu, 22 Jan 2009 14:02:42 -0500 Received: from d01relay02.pok.ibm.com (d01relay02.pok.ibm.com [9.56.227.234]) by e4.ny.us.ibm.com (8.13.1/8.13.1) with ESMTP id n0MJ15dA014709 for ; Thu, 22 Jan 2009 14:01:05 -0500 Received: from d01av02.pok.ibm.com (d01av02.pok.ibm.com [9.56.224.216]) by d01relay02.pok.ibm.com (8.13.8/8.13.8/NCO v9.1) with ESMTP id n0MJ2erx195550 for ; Thu, 22 Jan 2009 14:02:40 -0500 Received: from d01av02.pok.ibm.com (loopback [127.0.0.1]) by d01av02.pok.ibm.com (8.12.11.20060308/8.13.3) with ESMTP id n0MJ1k3C002094 for ; Thu, 22 Jan 2009 14:01:46 -0500 Received: from squirrel.codemonkey.ws (sig-9-65-90-232.mts.ibm.com [9.65.90.232]) by d01av02.pok.ibm.com (8.12.11.20060308/8.12.11) with ESMTP id n0MJ1jUc001967 for ; Thu, 22 Jan 2009 14:01:45 -0500 Message-ID: <4978C2C3.7010904@us.ibm.com> Date: Thu, 22 Jan 2009 13:02:27 -0600 From: Anthony Liguori MIME-Version: 1.0 Subject: Re: [Qemu-devel] [PATCH] ide_dma_cancel will result in partial DMA transfer References: <20080829135249.GI24884@duo.random> <20080901104356.GD25764@duo.random> <20090114180648.GP9779@random.random> In-Reply-To: <20090114180648.GP9779@random.random> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: quoted-printable Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Andrea Arcangeli wrote: > From: Andrea Arcangeli > > The reason for not actually canceling the I/O is because with > virtualization and lots of VM running, a guest fs may mistake a > overload of the host, as an IDE timeout. So rather than canceling the > I/O, it's safer to wait I/O completion and simulate that the I/O has > completed just before the io cancellation was requested by the > guest. This way if ntfs or an app writes data without checking for > -EIO retval, and it thinks the write has succeeded, it's less likely > to run into troubles. Similar issues for reads. > > Furthermore because the DMA operation is splitted into many synchronous > aio_read/write if there's more than one entry in the SG table, without = this > patch the DMA would be cancelled in the middle, something we've no idea= if it > happens on real hardware too or not. Overall this seems a great risk fo= r zero > gain. > > This approach is sure safer than previous code given we can't pretend a= ll guest > fs code out there to check for errors and reply the DMA if it was compl= eted > partially, given a timeout would never materialize on a real harddisk u= nless > there are defective blocks (and defective blocks are practically only a= n issue > for reads never for writes in any recent hardware as writing to blocks = is the > way to fix them) or the harddisk breaks as a whole. > > Signed-off-by: Andrea Arcangeli > =20 I agree with the patch in principle but it doesn't build: /home/anthony/git/qemu/hw/ide.c: In function =91bmdma_cmd_writeb=92: /home/anthony/git/qemu/hw/ide.c:3053: error: implicit declaration of=20 function =91QEMU_WARN=92 Regards, Anthony Liguori