iommu/vt-d: Apply per-device dma_ops
authorLu Baolu <baolu.lu@linux.intel.com>
Wed, 6 May 2020 01:59:47 +0000 (09:59 +0800)
committerJoerg Roedel <jroedel@suse.de>
Wed, 13 May 2020 10:02:01 +0000 (12:02 +0200)
commit6fc7020cf298aaec343df423746b44d99c6efaa5
tree26723f040a13384564c3aa968df9b63748840446
parent14b3526d5909f01e1d1baa05f50952788bb7418e
iommu/vt-d: Apply per-device dma_ops

Current Intel IOMMU driver sets the system level dma_ops. This causes
each dma API to go through the IOMMU driver even the devices are using
identity mapped domains. This sets per-device dma_ops only if a device
is using a DMA domain. Otherwise, use the default system level dma_ops
for direct dma.

Signed-off-by: Lu Baolu <baolu.lu@linux.intel.com>
Tested-by: Daniel Drake <drake@endlessm.com>
Reviewed-by: Jon Derrick <jonathan.derrick@intel.com>
Reviewed-by: Jerry Snitselaar <jsnitsel@redhat.com>
Link: https://lore.kernel.org/r/20200506015947.28662-4-baolu.lu@linux.intel.com
Signed-off-by: Joerg Roedel <jroedel@suse.de>
drivers/iommu/intel-iommu.c