From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LrwcP-0001if-Hc for qemu-devel@nongnu.org; Thu, 09 Apr 2009 11:56:45 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LrwcK-0001hA-Hc for qemu-devel@nongnu.org; Thu, 09 Apr 2009 11:56:45 -0400 Received: from [199.232.76.173] (port=43673 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LrwcK-0001gn-3y for qemu-devel@nongnu.org; Thu, 09 Apr 2009 11:56:40 -0400 Received: from yw-out-1718.google.com ([74.125.46.158]:43509) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1LrwcJ-0003oX-Ow for qemu-devel@nongnu.org; Thu, 09 Apr 2009 11:56:39 -0400 Received: by yw-out-1718.google.com with SMTP id 9so411524ywk.82 for ; Thu, 09 Apr 2009 08:56:39 -0700 (PDT) Message-ID: <49DE1AAB.90204@codemonkey.ws> Date: Thu, 09 Apr 2009 10:56:27 -0500 From: Anthony Liguori MIME-Version: 1.0 Subject: Re: [Qemu-devel] buffer alignment for block backends References: <49DCA80A.1020808@eu.citrix.com> <49DCF2C0.9070704@codemonkey.ws> <49DDC66F.2000404@eu.citrix.com> <49DDF3FF.8050706@codemonkey.ws> <20090409151944.GD5457@const.bordeaux.inria.fr> In-Reply-To: <20090409151944.GD5457@const.bordeaux.inria.fr> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit 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 Samuel Thibault wrote: > Anthony Liguori, le Thu 09 Apr 2009 08:11:27 -0500, a écrit : > >>> - ide.c:ide_init2 >>> >>> >> This buffer is only used when not doing DMA. When doing DMA, we are >> able to do zero-copy IO so the alignment of the request depends on how >> the guest aligned the request. I suspect you'll find a lot of guests >> that, in practice, do not align requests at 4k boundaries. >> > > Eeeeerrr, why shoudn't they? Guests usually work on pages, which are > already aligned on 4k boundaries. > Like if you do a 512-byte O_DIRECT write (in userspace) to a 512-byte, but not 4096-byte aligned buffer in Linux. This may not happen all the time, but if you don't handle this in your backend, you'll get a lot of lovely bug reports :-) Regards, Anthony Liguori