Skip to contentSkip to conversation

iommu: correct flush_unmaps pfn usage

PATCH Superseded Adam Morrison 2 participants 2 messages Dec 28, 2015 – Apr 11, 2016 1 message not in the archive IOMMU

v1 of 4 Superseded Latest is v4 →

lore
Share & tools
lore
#0 lore raw

PATCH 3/7 iommu: correct flush_unmaps pfn usage

From: Omer Peleg <omer-FrESSTt7Abv7r6psnUbsSmZHpeb/A1Y/@public.gmane.org>

Change flush_unmaps() to correctly pass iommu_flush_iotlb_psi() dma addresses. (Intel mm and dma have the same size for pages at the moment, but this usage improves consistency.)

[mad-FrESSTt7Abv7r6psnUbsSmZHpeb/A1Y/@public.gmane.org: rebased and reworded the commit message]
---
 drivers/iommu/intel-iommu.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/iommu/intel-iommu.c +2 -1
index 5b3530c..6d6229e 100644
@@ -3463,7 +3463,8 @@ static void flush_unmaps(struct deferred_flush_data *flush_data)
 			/* On real hardware multiple invalidations are expensive */
 			if (cap_caching_mode(iommu->cap))
 				iommu_flush_iotlb_psi(iommu, domain,
-					iova->pfn_lo, iova_size(iova),
+					mm_to_dma_pfn(iova->pfn_lo),
+					mm_to_dma_pfn(iova_size(iova)),
 					!freelist, 0);
 			else {
 				mask = ilog2(mm_to_dma_pfn(iova_size(iova)));
Signature · 1 line
1.9.1
Reviewed-by Ben Serebrin
#2 lore raw
In reply to a message not in the archive

Looks good.

Quoted 30 lines · Adam Morrison

From: Omer Peleg <omer-FrESSTt7Abv7r6psnUbsSmZHpeb/A1Y/@public.gmane.org>

Change flush_unmaps() to correctly pass iommu_flush_iotlb_psi() dma addresses. (Intel mm and dma have the same size for pages at the moment, but this usage improves consistency.)

[mad-FrESSTt7Abv7r6psnUbsSmZHpeb/A1Y/@public.gmane.org: rebased and reworded the commit message]
---
 drivers/iommu/intel-iommu.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/iommu/intel-iommu.c +2 -2
index 5b3530c..6d6229e 100644
@@ -3463,7 +3463,8 @@ static void flush_unmaps(struct deferred_flush_data *flush_data)
                        /* On real hardware multiple invalidations are expensive */
                        if (cap_caching_mode(iommu->cap))
                                iommu_flush_iotlb_psi(iommu, domain,
-                                       iova->pfn_lo, iova_size(iova),
+                                       mm_to_dma_pfn(iova->pfn_lo),
+                                       mm_to_dma_pfn(iova_size(iova)),
                                        !freelist, 0);
                        else {
                                mask = ilog2(mm_to_dma_pfn(iova_size(iova)));
--

1.9.1