diff mbox series

[RFC,v6,05/13] hw/arm/smmu: Fill IOMMUTLBEntry notifier type

Message ID 20200826143651.7915-6-eperezma@redhat.com (mailing list archive)
State New, archived
Headers show
Series memory: Delete assertion in memory_region_unregister_iommu_notifier | expand

Commit Message

Eugenio Perez Martin Aug. 26, 2020, 2:36 p.m. UTC
Signed-off-by: Eugenio PĂ©rez <eperezma@redhat.com>
---
 hw/arm/smmu-common.c | 2 ++
 hw/arm/smmuv3.c      | 2 ++
 2 files changed, 4 insertions(+)
diff mbox series

Patch

diff --git a/hw/arm/smmu-common.c b/hw/arm/smmu-common.c
index b02ffb8822..88cf1b86ea 100644
--- a/hw/arm/smmu-common.c
+++ b/hw/arm/smmu-common.c
@@ -181,6 +181,7 @@  static int smmu_ptw_64(SMMUTransCfg *cfg,
 
     tlbe->iova = iova;
     tlbe->addr_mask = (1 << granule_sz) - 1;
+    tlbe->type = IOMMU_IOTLB_NONE;
 
     while (level <= 3) {
         uint64_t subpage_size = 1ULL << level_shift(level, granule_sz);
@@ -395,6 +396,7 @@  static void smmu_unmap_notifier_range(IOMMUNotifier *n)
     entry.iova = n->start;
     entry.perm = IOMMU_NONE;
     entry.addr_mask = n->end - n->start;
+    entry.type = IOMMU_IOTLB_UNMAP,
 
     memory_region_notify_iommu_one(n, &entry);
 }
diff --git a/hw/arm/smmuv3.c b/hw/arm/smmuv3.c
index 3bb85ab7e1..dee987b2b1 100644
--- a/hw/arm/smmuv3.c
+++ b/hw/arm/smmuv3.c
@@ -635,6 +635,7 @@  static IOMMUTLBEntry smmuv3_translate(IOMMUMemoryRegion *mr, hwaddr addr,
         .translated_addr = addr,
         .addr_mask = ~(hwaddr)0,
         .perm = IOMMU_NONE,
+        .type = IOMMU_IOTLB_NONE,
     };
     SMMUIOTLBKey key, *new_key;
 
@@ -837,6 +838,7 @@  static void smmuv3_notify_iova(IOMMUMemoryRegion *mr,
     entry.iova = iova;
     entry.addr_mask = (1 << tt->granule_sz) - 1;
     entry.perm = IOMMU_NONE;
+    entry.type = IOMMU_NOTIFIER_UNMAP;
 
     memory_region_notify_iommu_one(n, &entry);
 }