* [PATCH v2] hw/arm/smmuv3: Pass the actual perm to returned IOMMUTLBEntry in smmuv3_translate()
@ 2022-04-16 7:38 chenxiang via
2022-04-22 9:19 ` Peter Maydell
0 siblings, 1 reply; 2+ messages in thread
From: chenxiang via @ 2022-04-16 7:38 UTC (permalink / raw)
To: eric.auger; +Cc: linuxarm, qemu-devel, Xiang Chen
From: Xiang Chen <chenxiang66@hisilicon.com>
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.
Signed-off-by: Xiang Chen <chenxiang66@hisilicon.com>
Reviewed-by: Eric Auger <eric.auger@redhat.com>
---
hw/arm/smmuv3.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/hw/arm/smmuv3.c b/hw/arm/smmuv3.c
index 674623aabe..707eb430c2 100644
--- a/hw/arm/smmuv3.c
+++ b/hw/arm/smmuv3.c
@@ -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;
--
2.33.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH v2] hw/arm/smmuv3: Pass the actual perm to returned IOMMUTLBEntry in smmuv3_translate()
2022-04-16 7:38 [PATCH v2] hw/arm/smmuv3: Pass the actual perm to returned IOMMUTLBEntry in smmuv3_translate() chenxiang via
@ 2022-04-22 9:19 ` Peter Maydell
0 siblings, 0 replies; 2+ messages in thread
From: Peter Maydell @ 2022-04-22 9:19 UTC (permalink / raw)
To: chenxiang; +Cc: eric.auger, linuxarm, qemu-devel
On Sat, 16 Apr 2022 at 08:46, chenxiang via <qemu-devel@nongnu.org> wrote:
>
> From: Xiang Chen <chenxiang66@hisilicon.com>
>
> 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.
>
> Signed-off-by: Xiang Chen <chenxiang66@hisilicon.com>
> Reviewed-by: Eric Auger <eric.auger@redhat.com>
> ---
Applied to target-arm.next, thanks.
-- PMM
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2022-04-22 9:26 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-04-16 7:38 [PATCH v2] hw/arm/smmuv3: Pass the actual perm to returned IOMMUTLBEntry in smmuv3_translate() chenxiang via
2022-04-22 9:19 ` Peter Maydell
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).