[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 2/6] system/physmem: IOMMU: Invoke the translate_size function if
From: |
Ethan Chen |
Subject: |
[PATCH 2/6] system/physmem: IOMMU: Invoke the translate_size function if it is implemented |
Date: |
Wed, 25 Oct 2023 13:14:26 +0800 |
Signed-off-by: Ethan Chen <ethan84@andestech.com>
---
system/physmem.c | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/system/physmem.c b/system/physmem.c
index fc2b0fee01..53b6ab735c 100644
--- a/system/physmem.c
+++ b/system/physmem.c
@@ -432,8 +432,13 @@ static MemoryRegionSection
address_space_translate_iommu(IOMMUMemoryRegion *iomm
iommu_idx = imrc->attrs_to_index(iommu_mr, attrs);
}
- iotlb = imrc->translate(iommu_mr, addr, is_write ?
- IOMMU_WO : IOMMU_RO, iommu_idx);
+ if (imrc->translate_size) {
+ iotlb = imrc->translate_size(iommu_mr, addr, *plen_out, is_write ?
+ IOMMU_WO : IOMMU_RO, iommu_idx);
+ } else {
+ iotlb = imrc->translate(iommu_mr, addr, is_write ?
+ IOMMU_WO : IOMMU_RO, iommu_idx);
+ }
if (!(iotlb.perm & (1 << is_write))) {
goto unassigned;
--
2.34.1
- [PATCH 0/6] Support RISC-V IOPMP, Ethan Chen, 2023/10/25
- [PATCH 4/6] Add RISC-V IOPMP support, Ethan Chen, 2023/10/25
- [PATCH 2/6] system/physmem: IOMMU: Invoke the translate_size function if it is implemented,
Ethan Chen <=
- Re: [PATCH 2/6] system/physmem: IOMMU: Invoke the translate_size function if it is implemented, Peter Xu, 2023/10/25
- Re: [PATCH 2/6] system/physmem: IOMMU: Invoke the translate_size function if it is implemented, Ethan Chen, 2023/10/26
- Re: [PATCH 2/6] system/physmem: IOMMU: Invoke the translate_size function if it is implemented, Peter Xu, 2023/10/27
- Re: [PATCH 2/6] system/physmem: IOMMU: Invoke the translate_size function if it is implemented, Peter Xu, 2023/10/27
- Re: [PATCH 2/6] system/physmem: IOMMU: Invoke the translate_size function if it is implemented, Ethan Chen, 2023/10/30
- Re: [PATCH 2/6] system/physmem: IOMMU: Invoke the translate_size function if it is implemented, Peter Xu, 2023/10/30
- Re: [PATCH 2/6] system/physmem: IOMMU: Invoke the translate_size function if it is implemented, Ethan Chen, 2023/10/31
[PATCH 3/6] exec/memattrs: Add iopmp source id to MemTxAttrs, Ethan Chen, 2023/10/25