Skip to contentSkip to conversation

spapr_iommu: Fix xlate trace to print translated address

PATCH Applied Alexey Kardashevskiy 3 participants 4 messages Aug 12, 2019 – Aug 13, 2019

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 spapr_iommu: Fix xlate trace to print translated address

Currently we basically print IO address twice, fix this.

Fixes 7e472264e9e2 ("PPC: spapr: iommu: rework traces")
---
 hw/ppc/spapr_iommu.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
hw/ppc/spapr_iommu.c +1 -1
index bd3d0256a65d..6fe57d799a10 100644
@@ -137,7 +137,7 @@ static IOMMUTLBEntry spapr_tce_translate_iommu(IOMMUMemoryRegion *iommu,
         ret.addr_mask = ~page_mask;
         ret.perm = spapr_tce_iommu_access_flags(tce);
     }
-    trace_spapr_iommu_xlate(tcet->liobn, addr, ret.iova, ret.perm,
+    trace_spapr_iommu_xlate(tcet->liobn, addr, ret.translated_addr, ret.perm,
                             ret.addr_mask);
 
     return ret;
Signature · 1 line
2.17.1
Reviewed-by on v1 1/1
#1 lore raw

Hi Alexey,

Quoted 13 lines · Alexey Kardashevskiy

Currently we basically print IO address twice, fix this.

Fixes 7e472264e9e2 ("PPC: spapr: iommu: rework traces")
---
 hw/ppc/spapr_iommu.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
hw/ppc/spapr_iommu.c +0 -0
index bd3d0256a65d..6fe57d799a10 100644

hw/ppc/spapr_iommu.c static IOMMUTLBEntry spapr_tce_translate_iommu(IOMMUMemoryRegion *iommu, · line 141

Quoted 6 lines
hw/ppc/spapr_iommu.c +1 -1
@@ -137,7 +137,7 @@ static IOMMUTLBEntry spapr_tce_translate_iommu(IOMMUMemoryRegion *iommu,
         ret.addr_mask = ~page_mask;
         ret.perm = spapr_tce_iommu_access_flags(tce);
     }
-    trace_spapr_iommu_xlate(tcet->liobn, addr, ret.iova, ret.perm,
+    trace_spapr_iommu_xlate(tcet->liobn, addr, ret.translated_addr, ret.perm,
                             ret.addr_mask);

But the trace format is:

spapr_iommu_xlate(uint64_t liobn, uint64_t ioba, uint64_t tce, unsigned perm, unsigned pgsize) "liobn=%"PRIx64" 0x%"PRIx64" -> 0x%"PRIx64" perm=%u mask=%x"

So this could be more appropriate:

trace_spapr_iommu_xlate(tcet->liobn, ret.iova, ret.translated_addr,

                          ret.perm, ret.addr_mask);

Anyhow your patch is an improvment, so regardless addr/ret.iova:

Quoted 3 lines
hw/ppc/spapr_iommu.c +0 -0
     return ret;
 
#2 lore raw
Quoted 29 lines · Philippe Mathieu-Daudé

Hi Alexey,

Quoted 13 lines · Alexey Kardashevskiy

Currently we basically print IO address twice, fix this.

Fixes 7e472264e9e2 ("PPC: spapr: iommu: rework traces")
---
  hw/ppc/spapr_iommu.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
hw/ppc/spapr_iommu.c +0 -0
index bd3d0256a65d..6fe57d799a10 100644

hw/ppc/spapr_iommu.c static IOMMUTLBEntry spapr_tce_translate_iommu(IOMMUMemoryRegion *iommu, · line 141

Quoted 6 lines
hw/ppc/spapr_iommu.c +1 -1
@@ -137,7 +137,7 @@ static IOMMUTLBEntry spapr_tce_translate_iommu(IOMMUMemoryRegion *iommu,
          ret.addr_mask = ~page_mask;
          ret.perm = spapr_tce_iommu_access_flags(tce);
      }
-    trace_spapr_iommu_xlate(tcet->liobn, addr, ret.iova, ret.perm,
+    trace_spapr_iommu_xlate(tcet->liobn, addr, ret.translated_addr, ret.perm,
                              ret.addr_mask);

But the trace format is:

spapr_iommu_xlate(uint64_t liobn, uint64_t ioba, uint64_t tce, unsigned perm, unsigned pgsize) "liobn=%"PRIx64" 0x%"PRIx64" -> 0x%"PRIx64" perm=%u mask=%x"

Quoted 6 lines

So this could be more appropriate:

   trace_spapr_iommu_xlate(tcet->liobn, ret.iova, ret.translated_addr,
                           ret.perm, ret.addr_mask);

Anyhow your patch is an improvment, so regardless addr/ret.iova:

I'd rather want to see the raw input data than with some bits removed.

Quoted 1 line

Thanks!

Quoted 4 lines
Quoted 4 lines
hw/ppc/spapr_iommu.c +0 -0
      return ret;
 
Signature · 1 line
Alexey
Applied
#3 lore raw
In reply to Alexey Kardashevskiy
Quoted 4 lines · Alexey Kardashevskiy

Currently we basically print IO address twice, fix this.

Fixes 7e472264e9e2 ("PPC: spapr: iommu: rework traces")

Applied to ppc-for-4.2, thanks.

Quoted 17 lines
---
 hw/ppc/spapr_iommu.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
hw/ppc/spapr_iommu.c +1 -1
index bd3d0256a65d..6fe57d799a10 100644
@@ -137,7 +137,7 @@ static IOMMUTLBEntry spapr_tce_translate_iommu(IOMMUMemoryRegion *iommu,
         ret.addr_mask = ~page_mask;
         ret.perm = spapr_tce_iommu_access_flags(tce);
     }
-    trace_spapr_iommu_xlate(tcet->liobn, addr, ret.iova, ret.perm,
+    trace_spapr_iommu_xlate(tcet->liobn, addr, ret.translated_addr, ret.perm,
                             ret.addr_mask);
 
     return ret;
Signature · 4 lines
David Gibson			| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au	| minimalist, thank you.  NOT _the_ _other_
				| _way_ _around_!
http://www.ozlabs.org/~dgibson