From mboxrd@z Thu Jan 1 00:00:00 1970 From: Joerg Roedel Subject: Re: RFC: extend iommu_ops with domain attributes API Date: Thu, 12 Jan 2012 15:47:47 +0100 Message-ID: <20120112144747.GA25119@8bytes.org> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Alex Williamson , Alexey Kardashevskiy , Joerg Roedel , Scott Wood , Alexander Graf , kvm@vger.kernel.org, iommu@lists.linux-foundation.org, varun.sethi@freescale.com To: Stuart Yoder Return-path: Received: from 8bytes.org ([88.198.83.132]:56899 "EHLO 8bytes.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753452Ab2ALOrt (ORCPT ); Thu, 12 Jan 2012 09:47:49 -0500 Content-Disposition: inline In-Reply-To: Sender: kvm-owner@vger.kernel.org List-ID: On Tue, Jan 10, 2012 at 10:22:36AM -0600, Stuart Yoder wrote: > As we work on mapping the Freescale IOMMU (called PAMU) into the existing > Linux iommu infrastructure, one issue is that we have additional domain > attributes that need to be set. This was discussed briefly a month ago > or so and I believe there was a need for a similar mechanism by IBM. > > We are proposing a couple of APIs to be added to iommu_ops to > get/set domain attributes: > > int domain_set_attr(struct iommu_domain *domain, int attr_type, void *data); > int domain_get_attr(struct iommu_domain *domain, int attr_type, void *data); Yes, something similar to that interface is required to support GART-like IOMMUs too. I prefer to split the attr-type into generic ones supported by many IOMMU drivers and implementation specific ones required by your PAMU for example. > A couple of the attributes I'm considering PAMU specific with a generic > enable attribute: > > enum iommu_attr_type { > IOMMU_ATTR_PAMU_GEOMETRY, // the PAMU geometry for the domain This should be a generic attribute. It makes sense for nearly all IOMMUs to export geometry information. > IOMMU_ATTR_PAMU_STASH, // stash characteristics for a domain That one is fine. > IOMMU_ATTR_ENABLE I do not get the need of this one. Can you explain why you need to enable/disable a domain? What happens on the hardware side when you do that? Joerg