From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LBDXH-0002Qu-0P for qemu-devel@nongnu.org; Fri, 12 Dec 2008 14:18:51 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LBDXE-0002Or-4V for qemu-devel@nongnu.org; Fri, 12 Dec 2008 14:18:50 -0500 Received: from [199.232.76.173] (port=50803 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LBDXD-0002OX-Po for qemu-devel@nongnu.org; Fri, 12 Dec 2008 14:18:47 -0500 Received: from an-out-0708.google.com ([209.85.132.241]:10744) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1LBDXD-0000Zi-GN for qemu-devel@nongnu.org; Fri, 12 Dec 2008 14:18:47 -0500 Received: by an-out-0708.google.com with SMTP id c38so767298ana.37 for ; Fri, 12 Dec 2008 11:18:46 -0800 (PST) Message-ID: <4942B913.8010306@codemonkey.ws> Date: Fri, 12 Dec 2008 13:18:43 -0600 From: Anthony Liguori MIME-Version: 1.0 Subject: Re: [Qemu-devel] [PATCH 2 of 5] add can_dma/post_dma for direct IO References: In-Reply-To: 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: Blue Swirl Cc: chrisw@redhat.com, Gerd Hoffmann , qemu-devel@nongnu.org, kvm@vger.kernel.org, avi@redhat.com Blue Swirl wrote: > On 12/12/08, Andrea Arcangeli wrote: > >> From: Andrea Arcangeli >> >> Add can_dma and post_dma methods needed before/after direct IO to guest >> physical memory. >> >> Signed-off-by: Andrea Arcangeli >> > > >> + /* nonlinear range */ >> + if (pd_first != pd) >> + return NULL; >> > > In my tests on Sparc32, IOMMU can map a linear DVMA range to several > non-linear physical pages, so this case should be handled correctly. > I think we should go back to Fabrice's earliest suggestion here. We should just have a simple map/unmap lock/unlock API for physical memory. That should be the base API IMHO. As long the map function goes from guest physical => host virtual, it can work for everything we care about. This is orthogonal to an API dealing with scatter/gather lists and translation to and from them. Regards, Anthony Liguori