From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Jfyx7-0001Ht-SW for qemu-devel@nongnu.org; Sun, 30 Mar 2008 10:56:09 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Jfyx6-0001GT-Ai for qemu-devel@nongnu.org; Sun, 30 Mar 2008 10:56:09 -0400 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Jfyx5-0001GP-V0 for qemu-devel@nongnu.org; Sun, 30 Mar 2008 10:56:07 -0400 Received: from e6.ny.us.ibm.com ([32.97.182.146]) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1Jfyx5-00033a-Cz for qemu-devel@nongnu.org; Sun, 30 Mar 2008 10:56:07 -0400 Received: from d01relay02.pok.ibm.com (d01relay02.pok.ibm.com [9.56.227.234]) by e6.ny.us.ibm.com (8.13.8/8.13.8) with ESMTP id m2UEwA3V000915 for ; Sun, 30 Mar 2008 10:58:10 -0400 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 v8.7) with ESMTP id m2UEu6QP217966 for ; Sun, 30 Mar 2008 10:56:06 -0400 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 m2UEu5we006979 for ; Sun, 30 Mar 2008 10:56:06 -0400 Message-ID: <47EFAA04.50903@us.ibm.com> Date: Sun, 30 Mar 2008 09:56:04 -0500 From: Anthony Liguori MIME-Version: 1.0 Subject: Re: [kvm-devel] [Qemu-devel] [PATCH 2/6] PCI DMA API References: <1206827760-4566-1-git-send-email-aliguori@us.ibm.com> <1206827760-4566-2-git-send-email-aliguori@us.ibm.com> <47EFA769.7090201@us.ibm.com> <47EFA86F.8020905@qumranet.com> In-Reply-To: <47EFA86F.8020905@qumranet.com> Content-Type: text/plain; charset=ISO-8859-1; 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: Avi Kivity Cc: Blue Swirl , kvm-devel@lists.sourceforge.net, Marcelo Tosatti , qemu-devel@nongnu.org, Aurelien Jarno Avi Kivity wrote: > Anthony Liguori wrote: > >>> This looks like it wouldn't scale to handle the Sparc systems. There >>> we want to make more translation steps from DVMA addresses to physical >>> in DMA controller and IOMMU and only in the final stage to void *. To >>> handle this, probably there should be an opaque parameter and some way >>> to register the translation function. Otherwise the API looks OK. >>> >>> >> I think having the PCI DMA API translate PhysIOVector => PhysIOVector >> would help. Then it becomes pretty easy to just call the DMA >> controller for additional translation from the IOMMU. >> >> Does that sound right? I don't quite understand what role the opaque >> parameter would serve. >> >> > > State for the dma controller. > > I think Blue is calling for chaining of dma mappings, no? Something > similar is being proposed for the Linux dma api. > > The way I envision chaining is: virtio-blk calls pci_device_dma_map with a PhysIOVector A pci_device_dma_map calls into PCI IOMMU (if necessary) to translate PhysIOVector A to PhysIOVector B pci_device_dma_map then calls into platform DMA engine to translate PhysIOVector B to PhysIOVector C pci_device_dma_map frees PhysIOVector B and returns PhysIOVector C Regards, Anthony Liguori