[PATCH 07/12] iommu/vt-d: Add is_identity_map ops entry

From: Lu Baolu
Date: Wed Mar 06 2019 - 23:53:12 EST


This adds the is_identity_map ops entry for Intel IOMMU driver.

Signed-off-by: Lu Baolu <baolu.lu@xxxxxxxxxxxxxxx>
---
drivers/iommu/intel-iommu.c | 6 ++++++
1 file changed, 6 insertions(+)

diff --git a/drivers/iommu/intel-iommu.c b/drivers/iommu/intel-iommu.c
index 282257e2628d..eb8aca8d1dc9 100644
--- a/drivers/iommu/intel-iommu.c
+++ b/drivers/iommu/intel-iommu.c
@@ -5181,6 +5181,11 @@ static void intel_iommu_apply_resv_region(struct device *dev,
WARN_ON_ONCE(reserve_iova(&dmar_domain->iovad, start, end) == NULL);
}

+static bool intel_iommu_is_identity_map(struct device *dev)
+{
+ return iommu_should_identity_map(dev, 1);
+}
+
#ifdef CONFIG_INTEL_IOMMU_SVM
int intel_iommu_enable_pasid(struct intel_iommu *iommu, struct intel_svm_dev *sdev)
{
@@ -5276,6 +5281,7 @@ const struct iommu_ops intel_iommu_ops = {
.put_resv_regions = intel_iommu_put_resv_regions,
.apply_resv_region = intel_iommu_apply_resv_region,
.device_group = pci_device_group,
+ .is_identity_map = intel_iommu_is_identity_map,
.pgsize_bitmap = INTEL_IOMMU_PGSIZES,
};

--
2.17.1


--------------52A37280C28FB8979E38AF0A
Content-Type: text/x-patch;
name="0008-iommu-vt-d-Enable-DMA-remapping-after-rmrr-mapped.patch"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
filename*0="0008-iommu-vt-d-Enable-DMA-remapping-after-rmrr-mapped.patch"