hw/arm/smmuv3: Pass the actual perm to returned IOMMUTLBEntry in smmuv3_translate()
PATCH v2 1/1 hw/arm/smmuv3: Pass the actual perm to returned IOMMUTLBEntry in smmuv3_translate()
From: Xiang Chen <[email protected]>
It always calls the IOMMU MR translate() callback with flag=IOMMU_NONE in memory_region_iommu_replay(). Currently, smmuv3_translate() return an IOMMUTLBEntry with perm set to IOMMU_NONE even if the translation success, whereas it is expected to return the actual permission set in the table entry.
So pass the actual perm to returned IOMMUTLBEntry in the table entry.
--- hw/arm/smmuv3.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
hw/arm/smmuv3.c +1 -1
@@ -760,7 +760,7 @@ epilogue:qemu_mutex_unlock (&s->mutex);switch (status) {case SMMU_TRANS_SUCCESS : - entry.perm = flag; + entry.perm = cached_entry->entry.perm; entry.translated_addr = cached_entry->entry.translated_addr + (addr & cached_entry->entry.addr_mask); entry.addr_mask = cached_entry->entry.addr_mask;
Signature · 1 line
2.33.0
Peter Maydell
AppliedQuoted 10 lines · chenxiang via
From: Xiang Chen <[email protected]>
It always calls the IOMMU MR
translate()callback with flag=IOMMU_NONE inmemory_region_iommu_replay(). Currently,smmuv3_translate()return an IOMMUTLBEntry with perm set toIOMMU_NONEeven if the translation success, whereas it is expected to return the actual permission set in the table entry.
So pass the actual perm to returned IOMMUTLBEntry in the table entry.
Quoted 3 lines
Signed-off-by Xiang Chen <[email protected]>Reviewed-by Eric Auger <[email protected]>---
Applied to target-arm.next, thanks.
-- PMM