Messages in this thread | | | Date | Thu, 22 Sep 2022 12:49:43 -0300 | From | Jason Gunthorpe <> | Subject | Re: [PATCH v13 05/13] iommu: Add attach/detach_dev_pasid iommu interfaces |
| |
On Tue, Sep 06, 2022 at 08:44:50PM +0800, Lu Baolu wrote: > Attaching an IOMMU domain to a PASID of a device is a generic operation > for modern IOMMU drivers which support PASID-granular DMA address > translation. Currently visible usage scenarios include (but not limited): > > - SVA (Shared Virtual Address) > - kernel DMA with PASID > - hardware-assist mediated device > > This adds the set_dev_pasid domain ops for setting the domain onto a > PASID of a device and remove_dev_pasid iommu ops for removing any setup > on a PASID of device. This also adds interfaces for device drivers to > attach/detach/retrieve a domain for a PASID of a device. > > If multiple devices share a single group, it's fine as long the fabric > always routes every TLP marked with a PASID to the host bridge and only > the host bridge. For example, ACS achieves this universally and has been > checked when pci_enable_pasid() is called. As we can't reliably tell the > source apart in a group, all the devices in a group have to be considered > as the same source, and mapped to the same PASID table. > > Signed-off-by: Lu Baolu <baolu.lu@linux.intel.com> > Reviewed-by: Jean-Philippe Brucker <jean-philippe@linaro.org> > Reviewed-by: Kevin Tian <kevin.tian@intel.com> > Reviewed-by: Yi Liu <yi.l.liu@intel.com> > Tested-by: Zhangfei Gao <zhangfei.gao@linaro.org> > Tested-by: Tony Zhu <tony.zhu@intel.com> > --- > include/linux/iommu.h | 32 +++++++++++ > drivers/iommu/iommu.c | 130 ++++++++++++++++++++++++++++++++++++++++++ > 2 files changed, 162 insertions(+)
Reviewed-by: Jason Gunthorpe <jgg@nvidia.com>
Jason
| |