RE: [PATCH v10 04/12] iommu: Add attach/detach_dev_pasid iommu interface

From: Tian, Kevin
Date: Wed Jul 06 2022 - 21:51:36 EST


> From: Lu Baolu <baolu.lu@xxxxxxxxxxxxxxx>
> Sent: Tuesday, July 5, 2022 1:07 PM
>
> 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 a pair of domain ops for this purpose and adds the interfaces
> for device drivers to attach/detach a domain to/from a {device, PASID}.
> Some buses, like PCI, route packets without considering the PASID value.
> Thus a DMA target address with PASID might be treated as P2P if the
> address falls into the MMIO BAR of other devices in the group. To make
> things simple, these interfaces only apply to devices belonging to the
> singleton groups, and the singleton is immutable in fabric (i.e. not
> affected by hotplug).
>
> Signed-off-by: Lu Baolu <baolu.lu@xxxxxxxxxxxxxxx>
> Reviewed-by: Jean-Philippe Brucker <jean-philippe@xxxxxxxxxx>
> Tested-by: Zhangfei Gao <zhangfei.gao@xxxxxxxxxx>
> Tested-by: Tony Zhu <tony.zhu@xxxxxxxxx>

Reviewed-by: Kevin Tian <kevin.tian@xxxxxxxxx>