Message ID | 20230209043153.14964-2-yi.l.liu@intel.com (mailing list archive) |
---|---|
State | New |
Headers | show |
Series | Add Intel VT-d nested translation | expand |
> From: Liu, Yi L <yi.l.liu@intel.com> > Sent: Thursday, February 9, 2023 12:32 PM > > From: Lu Baolu <baolu.lu@linux.intel.com> > > Introduce a new iommu_domain op to create domains owned by userspace, > e.g. through iommufd. These domains have a few different properties > compares to kernel owned domains: > > - They may be MANAGED domains, but created with special parameters. > For instance aperture size changes/number of levels, different > IOPTE formats, or other things necessary to make a vIOMMU work > what is *MANAGED* domain? today we only have the separation between DMA domain and UNMANAGED domain. soon with Jason's cleanup all domains are called UNMANAGED.
On 2023/2/10 16:24, Tian, Kevin wrote: >> From: Liu, Yi L <yi.l.liu@intel.com> >> Sent: Thursday, February 9, 2023 12:32 PM >> >> From: Lu Baolu <baolu.lu@linux.intel.com> >> >> Introduce a new iommu_domain op to create domains owned by userspace, >> e.g. through iommufd. These domains have a few different properties >> compares to kernel owned domains: >> >> - They may be MANAGED domains, but created with special parameters. >> For instance aperture size changes/number of levels, different >> IOPTE formats, or other things necessary to make a vIOMMU work >> > > what is *MANAGED* domain? > > today we only have the separation between DMA domain and > UNMANAGED domain. > > soon with Jason's cleanup all domains are called UNMANAGED. It should be UNMANAGED domain. Best regards, baolu
diff --git a/include/linux/iommu.h b/include/linux/iommu.h index 97b398d19fd2..214e3eb9bc86 100644 --- a/include/linux/iommu.h +++ b/include/linux/iommu.h @@ -230,6 +230,7 @@ struct iommu_iotlb_gather { * after use. Return the data buffer if success, or ERR_PTR on * failure. * @domain_alloc: allocate iommu domain + * @domain_alloc_user: allocate user iommu domain * @probe_device: Add device to iommu driver handling * @release_device: Remove device from iommu driver handling * @probe_finalize: Do final setup work after the device is added to an IOMMU @@ -262,6 +263,9 @@ struct iommu_ops { /* Domain allocation and freeing by the iommu driver */ struct iommu_domain *(*domain_alloc)(unsigned iommu_domain_type); + struct iommu_domain *(*domain_alloc_user)(struct device *dev, + struct iommu_domain *parent, + const void *user_data); struct iommu_device *(*probe_device)(struct device *dev); void (*release_device)(struct device *dev);