spapr_iommu: Fix xlate trace to print translated address
PATCH 1/1 spapr_iommu: Fix xlate trace to print translated address
Currently we basically print IO address twice, fix this.
--- hw/ppc/spapr_iommu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
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);return ret;
Signature · 1 line
2.17.1
Hi Alexey,
Quoted 13 lines · Alexey Kardashevskiy
Currently we basically print IO address twice, fix this.
Fixes 7e472264e9e2 ("PPC: spapr: iommu: rework traces")Signed-off-by Alexey Kardashevskiy <[email protected]>--- hw/ppc/spapr_iommu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)hw/ppc/spapr_iommu.c +0
-0
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
-0return ret;
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")Signed-off-by Alexey Kardashevskiy <[email protected]>--- hw/ppc/spapr_iommu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)hw/ppc/spapr_iommu.c +0
-0hw/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
Reviewed-by Philippe Mathieu-Daudé <[email protected]>
Thanks!
Quoted 4 lines
Quoted 4 lines
hw/ppc/spapr_iommu.c +0
-0return ret;
Signature · 1 line
Alexey
David Gibson
AppliedQuoted 4 lines · Alexey Kardashevskiy
Currently we basically print IO address twice, fix this.
Fixes 7e472264e9e2 ("PPC: spapr: iommu: rework traces")Signed-off-by Alexey Kardashevskiy <[email protected]>
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@@ -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