* [PATCH] iommu: fix trace_unmap() to report original iova
@ 2015-01-16 23:47 Shuah Khan
2015-01-19 14:04 ` Joerg Roedel
0 siblings, 1 reply; 3+ messages in thread
From: Shuah Khan @ 2015-01-16 23:47 UTC (permalink / raw)
To: joro, alex.williamson; +Cc: Shuah Khan, iommu, linux-kernel
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>
---
drivers/iommu/iommu.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/iommu/iommu.c b/drivers/iommu/iommu.c
index fbf8827..2eb7554 100644
--- a/drivers/iommu/iommu.c
+++ b/drivers/iommu/iommu.c
@@ -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);
--
2.1.0
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] iommu: fix trace_unmap() to report original iova
2015-01-16 23:47 [PATCH] iommu: fix trace_unmap() to report original iova Shuah Khan
@ 2015-01-19 14:04 ` Joerg Roedel
2015-01-19 14:21 ` Joerg Roedel
0 siblings, 1 reply; 3+ messages in thread
From: Joerg Roedel @ 2015-01-19 14:04 UTC (permalink / raw)
To: Shuah Khan; +Cc: alex.williamson, iommu, linux-kernel
On Fri, Jan 16, 2015 at 04:47:19PM -0700, Shuah Khan wrote:
> 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>
> ---
> drivers/iommu/iommu.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/iommu/iommu.c b/drivers/iommu/iommu.c
> index fbf8827..2eb7554 100644
> --- a/drivers/iommu/iommu.c
> +++ b/drivers/iommu/iommu.c
> @@ -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;
Instead of adding another variable I think it is better to just move the
trace_unmap call before the unmap loop. It can actually replace the
pr_debug there.
Joerg
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] iommu: fix trace_unmap() to report original iova
2015-01-19 14:04 ` Joerg Roedel
@ 2015-01-19 14:21 ` Joerg Roedel
0 siblings, 0 replies; 3+ messages in thread
From: Joerg Roedel @ 2015-01-19 14:21 UTC (permalink / raw)
To: Shuah Khan; +Cc: alex.williamson, iommu, linux-kernel
On Mon, Jan 19, 2015 at 03:04:00PM +0100, Joerg Roedel wrote:
> Instead of adding another variable I think it is better to just move the
> trace_unmap call before the unmap loop. It can actually replace the
> pr_debug there.
Okay, forget this. I just noticed that your follow-on patch requires
the trace_unmap call to stay there. I applied both patches to my core
branch.
Joerg
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2015-01-19 14:21 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-01-16 23:47 [PATCH] iommu: fix trace_unmap() to report original iova Shuah Khan
2015-01-19 14:04 ` Joerg Roedel
2015-01-19 14:21 ` Joerg Roedel
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox