iommu: Fix trace_unmap() to report original iova
authorShuah Khan <shuahkh@osg.samsung.com>
Fri, 16 Jan 2015 23:47:19 +0000 (16:47 -0700)
committerJoerg Roedel <jroedel@suse.de>
Mon, 19 Jan 2015 14:19:31 +0000 (15:19 +0100)
iommu_unmap() calls trace_unmap() with changed iova and original
size. trace_unmap() should report original iova instead. Change
iommu_unmap() to call trace_unmap() with original iova.

Signed-off-by: Shuah Khan <shuahkh@osg.samsung.com>
Reported-by: Alex Williamson <alex.williamson@redhat.com>
Signed-off-by: Joerg Roedel <jroedel@suse.de>
drivers/iommu/iommu.c

index f7718d73e98470bdbe139805860ddeb9e63722bf..d4c3db5abf25a5b55a84772770711db7f75594de 100644 (file)
@@ -1094,6 +1094,7 @@ size_t iommu_unmap(struct iommu_domain *domain, unsigned long iova, size_t size)
 {
        size_t unmapped_page, unmapped = 0;
        unsigned int min_pagesz;
+       unsigned long orig_iova = iova;
 
        if (unlikely(domain->ops->unmap == NULL ||
                     domain->ops->pgsize_bitmap == 0UL))
@@ -1133,7 +1134,7 @@ size_t iommu_unmap(struct iommu_domain *domain, unsigned long iova, size_t size)
                unmapped += unmapped_page;
        }
 
-       trace_unmap(iova, 0, size);
+       trace_unmap(orig_iova, 0, size);
        return unmapped;
 }
 EXPORT_SYMBOL_GPL(iommu_unmap);