From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LrcuS-0006zv-Mx for qemu-devel@nongnu.org; Wed, 08 Apr 2009 14:54:04 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LrcuN-0006v7-MF for qemu-devel@nongnu.org; Wed, 08 Apr 2009 14:54:04 -0400 Received: from [199.232.76.173] (port=37198 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LrcuN-0006uz-F4 for qemu-devel@nongnu.org; Wed, 08 Apr 2009 14:53:59 -0400 Received: from yx-out-1718.google.com ([74.125.44.155]:8810) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1LrcuN-0007Cv-47 for qemu-devel@nongnu.org; Wed, 08 Apr 2009 14:53:59 -0400 Received: by yx-out-1718.google.com with SMTP id 34so156493yxf.82 for ; Wed, 08 Apr 2009 11:53:57 -0700 (PDT) Message-ID: <49DCF2C0.9070704@codemonkey.ws> Date: Wed, 08 Apr 2009 13:53:52 -0500 From: Anthony Liguori MIME-Version: 1.0 Subject: Re: [Qemu-devel] buffer alignment for block backends References: <49DCA80A.1020808@eu.citrix.com> In-Reply-To: <49DCA80A.1020808@eu.citrix.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit 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 Stefano Stabellini wrote: > Hi all, > I am having an issue with the alignment of the buffers given to the > block backends. In particular, at the moment we are allocating buffers > 512 bytes aligned while the backend I am working on (block-vbd) needs > page alignment. > There is no requirement for this. The block block-raw-posix backend deals with bouncing the buffers if it has to. A few places do qemu_memalign() allocs as an optimization to avoid the bouncing but it's not strictly required. > If you do not want to do that, another possible solution is to create a > new function called "qemu_blockalign" that would be implemented as > qemu_memalign(512, size); This is fine, but this is purely an optimization, it cannot be relied upon in the general case. > so we don't have to write 512 bytes everywhere > but only in one place, thus making life easier to people like me that > have to change the value for a special case. > > Thanks in advance for your sympathy :) > Why does your backend requirement page alignment and who's notion of page? Regards, Anthony Liguori > Stefano Stabellini > > >