iommu.lists.linux-foundation.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/1] iommu/vt-d: Fix misuse of iommu_domain_identity_map()
@ 2020-06-18 23:36 Lu Baolu
  2020-06-19  0:53 ` Jerry Snitselaar
  0 siblings, 1 reply; 2+ messages in thread
From: Lu Baolu @ 2020-06-18 23:36 UTC (permalink / raw)
  To: Joerg Roedel; +Cc: Alex Williamson, iommu, Tom Murphy, linux-kernel

The iommu_domain_identity_map() helper takes start/end PFN as arguments.
Fix a misuse case where the start and end addresses are passed.

Fixes: e70b081c6f376 ("iommu/vt-d: Remove IOVA handling code from the non-dma_ops path")
Cc: Tom Murphy <murphyt7@tcd.ie>
Reported-by: Alex Williamson <alex.williamson@redhat.com>
Signed-off-by: Lu Baolu <baolu.lu@linux.intel.com>
---
 drivers/iommu/intel/iommu.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/iommu/intel/iommu.c b/drivers/iommu/intel/iommu.c
index f16bf63ea9fd..d759e7234e98 100644
--- a/drivers/iommu/intel/iommu.c
+++ b/drivers/iommu/intel/iommu.c
@@ -2701,7 +2701,9 @@ static int __init si_domain_init(int hw)
 				    end >> agaw_to_width(si_domain->agaw)))
 				continue;
 
-			ret = iommu_domain_identity_map(si_domain, start, end);
+			ret = iommu_domain_identity_map(si_domain,
+					mm_to_dma_pfn(start >> PAGE_SHIFT),
+					mm_to_dma_pfn(end >> PAGE_SHIFT));
 			if (ret)
 				return ret;
 		}
-- 
2.17.1

_______________________________________________
iommu mailing list
iommu@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/iommu

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH 1/1] iommu/vt-d: Fix misuse of iommu_domain_identity_map()
  2020-06-18 23:36 [PATCH 1/1] iommu/vt-d: Fix misuse of iommu_domain_identity_map() Lu Baolu
@ 2020-06-19  0:53 ` Jerry Snitselaar
  0 siblings, 0 replies; 2+ messages in thread
From: Jerry Snitselaar @ 2020-06-19  0:53 UTC (permalink / raw)
  To: Lu Baolu; +Cc: Tom Murphy, Alex Williamson, iommu, linux-kernel

On Fri Jun 19 20, Lu Baolu wrote:
>The iommu_domain_identity_map() helper takes start/end PFN as arguments.
>Fix a misuse case where the start and end addresses are passed.
>
>Fixes: e70b081c6f376 ("iommu/vt-d: Remove IOVA handling code from the non-dma_ops path")
>Cc: Tom Murphy <murphyt7@tcd.ie>
>Reported-by: Alex Williamson <alex.williamson@redhat.com>
>Signed-off-by: Lu Baolu <baolu.lu@linux.intel.com>

Reviewed-by: Jerry Snitselaar <jsnitsel@redhat.com>

_______________________________________________
iommu mailing list
iommu@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/iommu

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-06-19  0:53 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-06-18 23:36 [PATCH 1/1] iommu/vt-d: Fix misuse of iommu_domain_identity_map() Lu Baolu
2020-06-19  0:53 ` Jerry Snitselaar

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).