>From c178d3d7033ca35e3302e1e6c8d2a4d906814b9a Mon Sep 17 00:00:00 2001 From: Lu Baolu Date: Thu, 7 Mar 2019 12:53:12 +0800 Subject: [PATCH 07/12] iommu/vt-d: Add is_identity_map ops entry This adds the is_identity_map ops entry for Intel IOMMU driver. Signed-off-by: Lu Baolu --- 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