public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
* RFC: extend iommu_ops with domain attributes API
@ 2012-01-10 16:22 Stuart Yoder
  2012-01-12 14:47 ` Joerg Roedel
  2012-01-12 17:14 ` Alex Williamson
  0 siblings, 2 replies; 5+ messages in thread
From: Stuart Yoder @ 2012-01-10 16:22 UTC (permalink / raw)
  To: Alex Williamson, Alexey Kardashevskiy, Joerg Roedel, Scott Wood,
	Alexander Graf, kvm, iommu, varun.sethi

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);

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
       IOMMU_ATTR_PAMU_STASH,          // stash characteristics for a domain
       IOMMU_ATTR_ENABLE
   };

   The data for each attribute value is defined as:

   IOMMU_ATTR_PAMU_GEOMETRY - data is a struct:

      struct dma_geometry_attr {
          u64 iova;          // iova of the DMA domain
          u32 size;          // must be a power of 2 and be greater
                             // or equal than 4KB.
          u32 subwin_cnt;    // power of 2 between 1 and 256
      };

   IOMMU_ATTR_PAMU_STASH - data is a struct:

      struct dma_stash_attr {
          u32 vcpu;      // cpu number
          u32 cache;     // cache to stash to: 1=L1,2=L2,3=L3
      }

   IOMMU_ATTR_ENABLE - data is a u32:

       0=domain is disabled
       1=domain is enabled

Would like any feedback you have.

Thanks,
Stuart

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2012-01-12 21:28 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-01-10 16:22 RFC: extend iommu_ops with domain attributes API Stuart Yoder
2012-01-12 14:47 ` Joerg Roedel
2012-01-12 16:41   ` Scott Wood
2012-01-12 21:28     ` Stuart Yoder
2012-01-12 17:14 ` Alex Williamson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox