RFC: extend iommu_ops with domain attributes API

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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
--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux