iommu/vt-d: Add set_dev_pasid callback for dma domain
authorLu Baolu <baolu.lu@linux.intel.com>
Wed, 9 Aug 2023 12:48:00 +0000 (20:48 +0800)
committerJoerg Roedel <jroedel@suse.de>
Wed, 9 Aug 2023 15:44:39 +0000 (17:44 +0200)
commit7d0c9da6c1509664d96488042bacc02308ca33b2
tree1bdd929f47795d6c4d29170b04996ffeb91b4a72
parent37f900e7180ac67c73dcfae308625c87194025c0
iommu/vt-d: Add set_dev_pasid callback for dma domain

This allows the upper layers to set a domain to a PASID of a device
if the PASID feature is supported by the IOMMU hardware. The typical
use cases are, for example, kernel DMA with PASID and hardware
assisted mediated device drivers.

The attaching device and pasid information is tracked in a per-domain
list and is used for IOTLB and devTLB invalidation.

Signed-off-by: Lu Baolu <baolu.lu@linux.intel.com>
Signed-off-by: Jacob Pan <jacob.jun.pan@linux.intel.com>
Reviewed-by: Kevin Tian <kevin.tian@intel.com>
Link: https://lore.kernel.org/r/20230802212427.1497170-8-jacob.jun.pan@linux.intel.com
Signed-off-by: Joerg Roedel <jroedel@suse.de>
drivers/iommu/intel/iommu.c
drivers/iommu/intel/iommu.h