Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 8bdd77dd authored by Nadav Amit's avatar Nadav Amit Committed by David Woodhouse
Browse files

intel-iommu mistakenly uses offset_pfn when caching mode is enabled



intel_map_sg used offset_pfn which was set to zero when invalidating the IOTLB.
intel_map_sg now uses size variable for this matter.

Signed-off-by: default avatarNadav Amit <nadav.amit@gmail.com>
Signed-off-by: default avatarDavid Woodhouse <David.Woodhouse@intel.com>
parent a45946ab
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -2860,7 +2860,6 @@ static int intel_map_sg(struct device *hwdev, struct scatterlist *sglist, int ne
	struct dmar_domain *domain;
	size_t size = 0;
	int prot = 0;
	size_t offset_pfn = 0;
	struct iova *iova = NULL;
	int ret;
	struct scatterlist *sg;
@@ -2914,7 +2913,7 @@ static int intel_map_sg(struct device *hwdev, struct scatterlist *sglist, int ne

	/* it's a non-present to present mapping. Only flush if caching mode */
	if (cap_caching_mode(iommu->cap))
		iommu_flush_iotlb_psi(iommu, 0, start_vpfn, offset_pfn);
		iommu_flush_iotlb_psi(iommu, 0, start_vpfn, size);
	else
		iommu_flush_write_buffer(iommu);