[PATCH v2 1/5] memory: Rename memory_region_notify_one to memory_region_notify_iommu_one

2020-10-19 Thread Eugenio Pérez
Previous name didn't reflect the iommu operation.

Signed-off-by: Eugenio Pérez 
Reviewed-by: Peter Xu 
Reviewed-by: David Gibson 
Reviewed-by: Juan Quintela 
Reviewed-by: Eric Auger 
---
 include/exec/memory.h | 6 +++---
 hw/arm/smmu-common.c  | 2 +-
 hw/arm/smmuv3.c   | 2 +-
 hw/i386/intel_iommu.c | 4 ++--
 softmmu/memory.c  | 6 +++---
 5 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/include/exec/memory.h b/include/exec/memory.h
index 622207bde1..ac6bca1ba0 100644
--- a/include/exec/memory.h
+++ b/include/exec/memory.h
@@ -221,7 +221,7 @@ enum IOMMUMemoryRegionAttr {
  * The IOMMU implementation must use the IOMMU notifier infrastructure
  * to report whenever mappings are changed, by calling
  * memory_region_notify_iommu() (or, if necessary, by calling
- * memory_region_notify_one() for each registered notifier).
+ * memory_region_notify_iommu_one() for each registered notifier).
  *
  * Conceptually an IOMMU provides a mapping from input address
  * to an output TLB entry. If the IOMMU is aware of memory transaction
@@ -1300,7 +1300,7 @@ void memory_region_notify_iommu(IOMMUMemoryRegion 
*iommu_mr,
 IOMMUTLBEntry entry);
 
 /**
- * memory_region_notify_one: notify a change in an IOMMU translation
+ * memory_region_notify_iommu_one: notify a change in an IOMMU translation
  *   entry to a single notifier
  *
  * This works just like memory_region_notify_iommu(), but it only
@@ -1311,7 +1311,7 @@ void memory_region_notify_iommu(IOMMUMemoryRegion 
*iommu_mr,
  * replaces all old entries for the same virtual I/O address range.
  * Deleted entries have .@perm == 0.
  */
-void memory_region_notify_one(IOMMUNotifier *notifier,
+void memory_region_notify_iommu_one(IOMMUNotifier *notifier,
   IOMMUTLBEntry *entry);
 
 /**
diff --git a/hw/arm/smmu-common.c b/hw/arm/smmu-common.c
index 3838db1395..88d2c454f0 100644
--- a/hw/arm/smmu-common.c
+++ b/hw/arm/smmu-common.c
@@ -472,7 +472,7 @@ static void smmu_unmap_notifier_range(IOMMUNotifier *n)
 entry.perm = IOMMU_NONE;
 entry.addr_mask = n->end - n->start;
 
-memory_region_notify_one(n, );
+memory_region_notify_iommu_one(n, );
 }
 
 /* Unmap all notifiers attached to @mr */
diff --git a/hw/arm/smmuv3.c b/hw/arm/smmuv3.c
index 0122700e72..0a893ae918 100644
--- a/hw/arm/smmuv3.c
+++ b/hw/arm/smmuv3.c
@@ -827,7 +827,7 @@ static void smmuv3_notify_iova(IOMMUMemoryRegion *mr,
 entry.addr_mask = num_pages * (1 << granule) - 1;
 entry.perm = IOMMU_NONE;
 
-memory_region_notify_one(n, );
+memory_region_notify_iommu_one(n, );
 }
 
 /* invalidate an asid/iova range tuple in all mr's */
diff --git a/hw/i386/intel_iommu.c b/hw/i386/intel_iommu.c
index 749eb6ad63..56bab589d4 100644
--- a/hw/i386/intel_iommu.c
+++ b/hw/i386/intel_iommu.c
@@ -3497,7 +3497,7 @@ static void vtd_address_space_unmap(VTDAddressSpace *as, 
IOMMUNotifier *n)
 /* This field is meaningless for unmap */
 entry.translated_addr = 0;
 
-memory_region_notify_one(n, );
+memory_region_notify_iommu_one(n, );
 
 start += mask;
 remain -= mask;
@@ -3535,7 +3535,7 @@ static void vtd_address_space_refresh_all(IntelIOMMUState 
*s)
 
 static int vtd_replay_hook(IOMMUTLBEntry *entry, void *private)
 {
-memory_region_notify_one((IOMMUNotifier *)private, entry);
+memory_region_notify_iommu_one((IOMMUNotifier *)private, entry);
 return 0;
 }
 
diff --git a/softmmu/memory.c b/softmmu/memory.c
index 403ff3abc9..f37a4569ac 100644
--- a/softmmu/memory.c
+++ b/softmmu/memory.c
@@ -1905,8 +1905,8 @@ void memory_region_unregister_iommu_notifier(MemoryRegion 
*mr,
 memory_region_update_iommu_notify_flags(iommu_mr, NULL);
 }
 
-void memory_region_notify_one(IOMMUNotifier *notifier,
-  IOMMUTLBEntry *entry)
+void memory_region_notify_iommu_one(IOMMUNotifier *notifier,
+IOMMUTLBEntry *entry)
 {
 IOMMUNotifierFlag request_flags;
 hwaddr entry_end = entry->iova + entry->addr_mask;
@@ -1942,7 +1942,7 @@ void memory_region_notify_iommu(IOMMUMemoryRegion 
*iommu_mr,
 
 IOMMU_NOTIFIER_FOREACH(iommu_notifier, iommu_mr) {
 if (iommu_notifier->iommu_idx == iommu_idx) {
-memory_region_notify_one(iommu_notifier, );
+memory_region_notify_iommu_one(iommu_notifier, );
 }
 }
 }
-- 
2.18.1




[PATCH v2 1/5] memory: Rename memory_region_notify_one to memory_region_notify_iommu_one

2020-10-19 Thread Eugenio Pérez
Previous name didn't reflect the iommu operation.

Signed-off-by: Eugenio Pérez 
Reviewed-by: Peter Xu 
Reviewed-by: David Gibson 
Reviewed-by: Juan Quintela 
Reviewed-by: Eric Auger 
---
 include/exec/memory.h | 6 +++---
 hw/arm/smmu-common.c  | 2 +-
 hw/arm/smmuv3.c   | 2 +-
 hw/i386/intel_iommu.c | 4 ++--
 softmmu/memory.c  | 6 +++---
 5 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/include/exec/memory.h b/include/exec/memory.h
index 622207bde1..ac6bca1ba0 100644
--- a/include/exec/memory.h
+++ b/include/exec/memory.h
@@ -221,7 +221,7 @@ enum IOMMUMemoryRegionAttr {
  * The IOMMU implementation must use the IOMMU notifier infrastructure
  * to report whenever mappings are changed, by calling
  * memory_region_notify_iommu() (or, if necessary, by calling
- * memory_region_notify_one() for each registered notifier).
+ * memory_region_notify_iommu_one() for each registered notifier).
  *
  * Conceptually an IOMMU provides a mapping from input address
  * to an output TLB entry. If the IOMMU is aware of memory transaction
@@ -1300,7 +1300,7 @@ void memory_region_notify_iommu(IOMMUMemoryRegion 
*iommu_mr,
 IOMMUTLBEntry entry);
 
 /**
- * memory_region_notify_one: notify a change in an IOMMU translation
+ * memory_region_notify_iommu_one: notify a change in an IOMMU translation
  *   entry to a single notifier
  *
  * This works just like memory_region_notify_iommu(), but it only
@@ -1311,7 +1311,7 @@ void memory_region_notify_iommu(IOMMUMemoryRegion 
*iommu_mr,
  * replaces all old entries for the same virtual I/O address range.
  * Deleted entries have .@perm == 0.
  */
-void memory_region_notify_one(IOMMUNotifier *notifier,
+void memory_region_notify_iommu_one(IOMMUNotifier *notifier,
   IOMMUTLBEntry *entry);
 
 /**
diff --git a/hw/arm/smmu-common.c b/hw/arm/smmu-common.c
index 3838db1395..88d2c454f0 100644
--- a/hw/arm/smmu-common.c
+++ b/hw/arm/smmu-common.c
@@ -472,7 +472,7 @@ static void smmu_unmap_notifier_range(IOMMUNotifier *n)
 entry.perm = IOMMU_NONE;
 entry.addr_mask = n->end - n->start;
 
-memory_region_notify_one(n, );
+memory_region_notify_iommu_one(n, );
 }
 
 /* Unmap all notifiers attached to @mr */
diff --git a/hw/arm/smmuv3.c b/hw/arm/smmuv3.c
index 0122700e72..0a893ae918 100644
--- a/hw/arm/smmuv3.c
+++ b/hw/arm/smmuv3.c
@@ -827,7 +827,7 @@ static void smmuv3_notify_iova(IOMMUMemoryRegion *mr,
 entry.addr_mask = num_pages * (1 << granule) - 1;
 entry.perm = IOMMU_NONE;
 
-memory_region_notify_one(n, );
+memory_region_notify_iommu_one(n, );
 }
 
 /* invalidate an asid/iova range tuple in all mr's */
diff --git a/hw/i386/intel_iommu.c b/hw/i386/intel_iommu.c
index 749eb6ad63..56bab589d4 100644
--- a/hw/i386/intel_iommu.c
+++ b/hw/i386/intel_iommu.c
@@ -3497,7 +3497,7 @@ static void vtd_address_space_unmap(VTDAddressSpace *as, 
IOMMUNotifier *n)
 /* This field is meaningless for unmap */
 entry.translated_addr = 0;
 
-memory_region_notify_one(n, );
+memory_region_notify_iommu_one(n, );
 
 start += mask;
 remain -= mask;
@@ -3535,7 +3535,7 @@ static void vtd_address_space_refresh_all(IntelIOMMUState 
*s)
 
 static int vtd_replay_hook(IOMMUTLBEntry *entry, void *private)
 {
-memory_region_notify_one((IOMMUNotifier *)private, entry);
+memory_region_notify_iommu_one((IOMMUNotifier *)private, entry);
 return 0;
 }
 
diff --git a/softmmu/memory.c b/softmmu/memory.c
index 403ff3abc9..f37a4569ac 100644
--- a/softmmu/memory.c
+++ b/softmmu/memory.c
@@ -1905,8 +1905,8 @@ void memory_region_unregister_iommu_notifier(MemoryRegion 
*mr,
 memory_region_update_iommu_notify_flags(iommu_mr, NULL);
 }
 
-void memory_region_notify_one(IOMMUNotifier *notifier,
-  IOMMUTLBEntry *entry)
+void memory_region_notify_iommu_one(IOMMUNotifier *notifier,
+IOMMUTLBEntry *entry)
 {
 IOMMUNotifierFlag request_flags;
 hwaddr entry_end = entry->iova + entry->addr_mask;
@@ -1942,7 +1942,7 @@ void memory_region_notify_iommu(IOMMUMemoryRegion 
*iommu_mr,
 
 IOMMU_NOTIFIER_FOREACH(iommu_notifier, iommu_mr) {
 if (iommu_notifier->iommu_idx == iommu_idx) {
-memory_region_notify_one(iommu_notifier, );
+memory_region_notify_iommu_one(iommu_notifier, );
 }
 }
 }
-- 
2.18.1