[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 09/11] memory: Add iova to IOMMUTLBEntry
From: |
David Gibson |
Subject: |
[Qemu-devel] [PATCH 09/11] memory: Add iova to IOMMUTLBEntry |
Date: |
Tue, 14 May 2013 19:13:55 +1000 |
Currently, the IOMMUTLBEntry structure contains the translated address,
but not the IOVA (original untranslated address). We're going to need it
for upcoming changes, so add it in here, and populate it correctly in our
one existing iommu implementation.
Signed-off-by: David Gibson <address@hidden>
---
hw/ppc/spapr_iommu.c | 2 ++
include/exec/memory.h | 2 +-
2 files changed, 3 insertions(+), 1 deletion(-)
diff --git a/hw/ppc/spapr_iommu.c b/hw/ppc/spapr_iommu.c
index 90469b3..07a6307 100644
--- a/hw/ppc/spapr_iommu.c
+++ b/hw/ppc/spapr_iommu.c
@@ -80,6 +80,7 @@ static IOMMUTLBEntry spapr_tce_translate_iommu(MemoryRegion
*iommu, hwaddr addr)
if (tcet->bypass) {
return (IOMMUTLBEntry) {
+ .iova = 0,
.translated_addr = 0,
.addr_mask = ~(hwaddr)0,
.perm = { true, true },
@@ -102,6 +103,7 @@ static IOMMUTLBEntry spapr_tce_translate_iommu(MemoryRegion
*iommu, hwaddr addr)
#endif
return (IOMMUTLBEntry) {
+ .iova = addr & ~SPAPR_TCE_PAGE_MASK,
.translated_addr = tce & ~SPAPR_TCE_PAGE_MASK,
.addr_mask = SPAPR_TCE_PAGE_MASK,
.perm = { [0] = tce & SPAPR_TCE_RO, [1] = tce & SPAPR_TCE_WO },
diff --git a/include/exec/memory.h b/include/exec/memory.h
index b97ace7..cd33439 100644
--- a/include/exec/memory.h
+++ b/include/exec/memory.h
@@ -116,7 +116,7 @@ typedef struct IOMMUTLBEntry IOMMUTLBEntry;
typedef struct MemoryRegionIOMMUOps MemoryRegionIOMMUOps;
struct IOMMUTLBEntry {
- hwaddr translated_addr;
+ hwaddr iova, translated_addr;
hwaddr addr_mask; /* 0xfff = 4k translation */
bool perm[2]; /* permissions, [0] for read, [1] for write */
};
--
1.7.10.4
- [Qemu-devel] [0/11] RFC: VFIO and guest side IOMMUs, version 3, David Gibson, 2013/05/14
- [Qemu-devel] [PATCH 02/11] pci: Don't del_subgregion on a non subregion, David Gibson, 2013/05/14
- [Qemu-devel] [PATCH 01/11] iommu: Fix compile error in ioapic.c, David Gibson, 2013/05/14
- [Qemu-devel] [PATCH 04/11] pci: Use AddressSpace rather than MemoryRegion to represent PCI DMA space, David Gibson, 2013/05/14
- [Qemu-devel] [PATCH 03/11] pci: Rework PCI iommu lifetime assumptions, David Gibson, 2013/05/14
- [Qemu-devel] [PATCH 09/11] memory: Add iova to IOMMUTLBEntry,
David Gibson <=
- [Qemu-devel] [PATCH 05/11] pci: Introduce helper to retrieve a PCI device's DMA address space, David Gibson, 2013/05/14
- [Qemu-devel] [PATCH 06/11] memory: Sanity check that no listeners remain on a destroyed AddressSpace, David Gibson, 2013/05/14
- [Qemu-devel] [PATCH 07/11] vfio: Introduce VFIO address spaces, David Gibson, 2013/05/14
- [Qemu-devel] [PATCH 08/11] vfio: Create VFIOAddressSpace objects as needed, David Gibson, 2013/05/14
- [Qemu-devel] [PATCH 10/11] memory: Add iommu map/unmap notifiers, David Gibson, 2013/05/14