Skip to content

Commit

Permalink
iommu/vt-d: Unnecessary to handle default identity domain
Browse files Browse the repository at this point in the history
The iommu default domain framework has been designed to take
care of setting identity default domain type. It's unnecessary
to handle this again in the VT-d driver. Hence, remove it.

Signed-off-by: Lu Baolu <baolu.lu@linux.intel.com>
Signed-off-by: Joerg Roedel <jroedel@suse.de>
  • Loading branch information
Lu Baolu authored and Joerg Roedel committed Jan 24, 2020
1 parent 9235cb1 commit b89b660
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions drivers/iommu/intel-iommu.c
Original file line number Diff line number Diff line change
Expand Up @@ -387,7 +387,6 @@ static int intel_iommu_superpage = 1;
static int iommu_identity_mapping;
static int intel_no_bounce;

#define IDENTMAP_ALL 1
#define IDENTMAP_GFX 2
#define IDENTMAP_AZALIA 4

Expand Down Expand Up @@ -3079,8 +3078,7 @@ static int device_def_domain_type(struct device *dev)
return IOMMU_DOMAIN_DMA;
}

return (iommu_identity_mapping & IDENTMAP_ALL) ?
IOMMU_DOMAIN_IDENTITY : 0;
return 0;
}

static void intel_iommu_init_qi(struct intel_iommu *iommu)
Expand Down Expand Up @@ -3424,9 +3422,6 @@ static int __init init_dmars(void)
iommu->flush.flush_iotlb(iommu, 0, 0, 0, DMA_TLB_GLOBAL_FLUSH);
}

if (iommu_default_passthrough())
iommu_identity_mapping |= IDENTMAP_ALL;

#ifdef CONFIG_INTEL_IOMMU_BROKEN_GFX_WA
dmar_map_gfx = 0;
#endif
Expand Down Expand Up @@ -5038,7 +5033,7 @@ static int __init platform_optin_force_iommu(void)
* map for all devices except those marked as being untrusted.
*/
if (dmar_disabled)
iommu_identity_mapping |= IDENTMAP_ALL;
iommu_set_default_passthrough(false);

dmar_disabled = 0;
no_iommu = 0;
Expand Down

0 comments on commit b89b660

Please sign in to comment.