From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:55167) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RYKzX-0002xF-7I for qemu-devel@nongnu.org; Wed, 07 Dec 2011 12:09:16 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RYKzS-0008VX-Er for qemu-devel@nongnu.org; Wed, 07 Dec 2011 12:09:11 -0500 Received: from db3ehsobe005.messaging.microsoft.com ([213.199.154.143]:36176 helo=DB3EHSOBE005.bigfish.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RYKzS-0008VM-2N for qemu-devel@nongnu.org; Wed, 07 Dec 2011 12:09:06 -0500 Date: Wed, 7 Dec 2011 17:38:42 +0100 From: Joerg Roedel Message-ID: <20111207163842.GC29680@amd.com> References: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Disposition: inline In-Reply-To: Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] vfio / iommu domain attributes List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Stuart Yoder Cc: chrisw@sous-sol.org, Alexey Kardashevskiy , kvm@vger.kernel.org, pmac@au1.ibm.com, linux-pci@vger.kernel.org, konrad.wilk@oracle.com, qemu-devel@nongnu.org, iommu@lists.linux-foundation.org, agraf@suse.de, aafabbri@cisco.com, B08248@freescale.com, Alex Williamson , avi@redhat.com, David Gibson , dwg@au1.ibm.com, B07421@freescale.com, benve@cisco.com On Wed, Dec 07, 2011 at 09:54:39AM -0600, Stuart Yoder wrote: > Alex, Alexey I'm wondering if you've had any new thoughts on this over > the last week. >=20 > For Freescale, our iommu domain attributes would look something like: > -domain iova base address > -domain iova window size I agree with that. > -domain enable/disable > -number of subwindows > -operation mapping table index > -stash destination CPU > -stash target (cache=E2=80=93 L1, L2, L3) Why does the user of the IOMMU-API need to have control over these things? > These are all things that need to be set by the creator of the domain. >=20 > Since the domain attributes are going to be so different for each platf= orm does > it make sense to define a new iommu_ops call back that just takes a voi= d pointer > that can be implemented in a platform specific way? For example: >=20 > struct iommu_ops { > [cut] > int (*domain_set_attrs)(struct iommu_domain *domain, > void *attrs); > int (*domain_get_attrs)(struct iommu_domain *domain, > void *attrs); > } A void pointer is certainly the worst choice for an interface. I think it is better to have at least a set of common attributes. Somthing like this: iommu_domain_set_attr(struct iommu_domain *domain, enum attr_type, void *= data) iommu_domain_get_attr(struct iommu_domain *domain, enum attr_type, void *= data) The iova base/size options make sense for more IOMMUs than just Freescale. For example it would allow to manage GART-like IOMMUs with the IOMMU-API too. Joerg --=20 AMD Operating System Research Center Advanced Micro Devices GmbH Einsteinring 24 85609 Dornach General Managers: Alberto Bozzo, Andrew Bowd Registration: Dornach, Landkr. Muenchen; Registerger. Muenchen, HRB Nr. 4= 3632