From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1JfyqM-00079L-2x for qemu-devel@nongnu.org; Sun, 30 Mar 2008 10:49:10 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1JfyqK-00078E-4Z for qemu-devel@nongnu.org; Sun, 30 Mar 2008 10:49:09 -0400 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JfyqJ-000786-WA for qemu-devel@nongnu.org; Sun, 30 Mar 2008 10:49:08 -0400 Received: from e36.co.us.ibm.com ([32.97.110.154]) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1JfyqJ-0001m5-IE for qemu-devel@nongnu.org; Sun, 30 Mar 2008 10:49:07 -0400 Received: from d03relay02.boulder.ibm.com (d03relay02.boulder.ibm.com [9.17.195.227]) by e36.co.us.ibm.com (8.13.8/8.13.8) with ESMTP id m2UEn6El026784 for ; Sun, 30 Mar 2008 10:49:06 -0400 Received: from d03av04.boulder.ibm.com (d03av04.boulder.ibm.com [9.17.195.170]) by d03relay02.boulder.ibm.com (8.13.8/8.13.8/NCO v8.7) with ESMTP id m2UEn65s211792 for ; Sun, 30 Mar 2008 08:49:06 -0600 Received: from d03av04.boulder.ibm.com (loopback [127.0.0.1]) by d03av04.boulder.ibm.com (8.12.11.20060308/8.13.3) with ESMTP id m2UEn53C032094 for ; Sun, 30 Mar 2008 08:49:06 -0600 Message-ID: <47EFA860.5030809@us.ibm.com> Date: Sun, 30 Mar 2008 09:49:04 -0500 From: Anthony Liguori MIME-Version: 1.0 References: <1206827760-4566-1-git-send-email-aliguori@us.ibm.com> <1206827760-4566-2-git-send-email-aliguori@us.ibm.com> <47EF6A9A.3090709@qumranet.com> In-Reply-To: <47EF6A9A.3090709@qumranet.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: [Qemu-devel] Re: [kvm-devel] [PATCH 2/6] PCI DMA API 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: kvm-devel@lists.sourceforge.net, Marcelo Tosatti , qemu-devel@nongnu.org, Aurelien Jarno Avi Kivity wrote: > Anthony Liguori wrote: >> This patch introduces a PCI DMA API and some generic code to support >> other DMA >> APIs. Two types are introduced: PhysIOVector and IOVector. A DMA API >> maps a PhysIOVector, which is composed of target_phys_addr_t, into an >> IOVector, >> which is composed of void *. >> >> This enables zero-copy IO to be preformed without introducing >> assumptions of >> phys_ram_base. This API is at the PCI device level to enable support of >> per-device IOMMU remapping. >> >> >> + >> +typedef struct IOVector >> +{ >> + int num; >> + struct IOVectorElement { >> + void *base; >> + size_t len; >> + } sg[0]; >> +} IOVector; >> + >> > > Can we use 'struct iovec' for the element type (with accessors for > setting base+len, and reading base or len, so we can substitute the > Windows version for that platform)? That will allow using the vector > without additional translation or casts. If we switch to PhysIOVector => PhysIOVector, then the IO infrastructure can convert it to whatever it wants (including a struct iovec). Regards, Anthony Liguori