Skip to content

Commit 75d1838

Browse files
LuBaolujoergroedel
authored andcommitted
iommu/vt-d: Fix dmar pte read access not set error
If the default DMA domain of a group doesn't fit a device, it will still sit in the group but use a private identity domain. When map/unmap/iova_to_phys come through iommu API, the driver should still serve them, otherwise, other devices in the same group will be impacted. Since identity domain has been mapped with the whole available memory space and RMRRs, we don't need to worry about the impact on it. Link: https://www.spinics.net/lists/iommu/msg40416.html Cc: Jerry Snitselaar <jsnitsel@redhat.com> Reported-by: Jerry Snitselaar <jsnitsel@redhat.com> Fixes: 942067f ("iommu/vt-d: Identify default domains replaced with private") Cc: stable@vger.kernel.org # v5.3+ Signed-off-by: Lu Baolu <baolu.lu@linux.intel.com> Reviewed-by: Jerry Snitselaar <jsnitsel@redhat.com> Tested-by: Jerry Snitselaar <jsnitsel@redhat.com> Signed-off-by: Joerg Roedel <jroedel@suse.de>
1 parent d8018a0 commit 75d1838

File tree

1 file changed

+0
-8
lines changed

1 file changed

+0
-8
lines changed

drivers/iommu/intel-iommu.c

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5478,9 +5478,6 @@ static int intel_iommu_map(struct iommu_domain *domain,
54785478
int prot = 0;
54795479
int ret;
54805480

5481-
if (dmar_domain->flags & DOMAIN_FLAG_LOSE_CHILDREN)
5482-
return -EINVAL;
5483-
54845481
if (iommu_prot & IOMMU_READ)
54855482
prot |= DMA_PTE_READ;
54865483
if (iommu_prot & IOMMU_WRITE)
@@ -5523,8 +5520,6 @@ static size_t intel_iommu_unmap(struct iommu_domain *domain,
55235520
/* Cope with horrid API which requires us to unmap more than the
55245521
size argument if it happens to be a large-page mapping. */
55255522
BUG_ON(!pfn_to_dma_pte(dmar_domain, iova >> VTD_PAGE_SHIFT, &level));
5526-
if (dmar_domain->flags & DOMAIN_FLAG_LOSE_CHILDREN)
5527-
return 0;
55285523

55295524
if (size < VTD_PAGE_SIZE << level_to_offset_bits(level))
55305525
size = VTD_PAGE_SIZE << level_to_offset_bits(level);
@@ -5556,9 +5551,6 @@ static phys_addr_t intel_iommu_iova_to_phys(struct iommu_domain *domain,
55565551
int level = 0;
55575552
u64 phys = 0;
55585553

5559-
if (dmar_domain->flags & DOMAIN_FLAG_LOSE_CHILDREN)
5560-
return 0;
5561-
55625554
pte = pfn_to_dma_pte(dmar_domain, iova >> VTD_PAGE_SHIFT, &level);
55635555
if (pte)
55645556
phys = dma_pte_addr(pte);

0 commit comments

Comments
 (0)