iommu: Add device-centric DMA ownership interfaces
authorLu Baolu <baolu.lu@linux.intel.com>
Tue, 29 Nov 2022 20:29:25 +0000 (16:29 -0400)
committerJason Gunthorpe <jgg@nvidia.com>
Tue, 29 Nov 2022 20:34:15 +0000 (16:34 -0400)
commit89395ccedbc153fecbc29342fbb94a6dfadf24cd
tree0e22b091269e9272e05c947ec9caeef33e9f04bf
parent4989764d8ed3d3d1024e4e831ff2affc40ee01d6
iommu: Add device-centric DMA ownership interfaces

These complement the group interfaces used by VFIO and are for use by
iommufd. The main difference is that multiple devices in the same group
can all share the ownership by passing the same ownership pointer.

Move the common code into shared functions.

Link: https://lore.kernel.org/r/2-v6-a196d26f289e+11787-iommufd_jgg@nvidia.com
Tested-by: Nicolin Chen <nicolinc@nvidia.com>
Tested-by: Yi Liu <yi.l.liu@intel.com>
Tested-by: Lixiao Yang <lixiao.yang@intel.com>
Tested-by: Matthew Rosato <mjrosato@linux.ibm.com>
Reviewed-by: Kevin Tian <kevin.tian@intel.com>
Reviewed-by: Eric Auger <eric.auger@redhat.com>
Signed-off-by: Lu Baolu <baolu.lu@linux.intel.com>
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
drivers/iommu/iommu.c
include/linux/iommu.h