From 55d091d75abc677438feef803fa88b1facdc7cb2 Mon Sep 17 00:00:00 2001 From: Lu Baolu Date: Thu, 7 Mar 2019 12:53:12 +0800 Subject: [PATCH 6/9] 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 diff --git a/drivers/iommu/intel-iommu.c b/drivers/iommu/intel-iommu.c index 1db0ceb33020..e79df3cf548c 100644 --- a/drivers/iommu/intel-iommu.c +++ b/drivers/iommu/intel-iommu.c @@ -5344,6 +5344,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) { @@ -5455,6 +5460,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 = intel_iommu_pci_device_group, + .is_identity_map = intel_iommu_is_identity_map, .pgsize_bitmap = INTEL_IOMMU_PGSIZES, }; -- 2.17.1