Skip to content

Commit

Permalink
memory: Rename memory_region_notify_one to memory_region_notify_iommu…
Browse files Browse the repository at this point in the history
…_one

Previous name didn't reflect the iommu operation.

Signed-off-by: Eugenio Pérez <eperezma@redhat.com>
Reviewed-by: Peter Xu <peterx@redhat.com>
Reviewed-by: David Gibson <david@gibson.dropbear.id.au>
Reviewed-by: Juan Quintela <quintela@redhat.com>
Reviewed-by: Eric Auger <eric.auger@redhat.com>
Acked-by: Jason Wang <jasowang@redhat.com>
Message-Id: <20201116165506.31315-2-eperezma@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
  • Loading branch information
eugpermar authored and mstsirkin committed Dec 8, 2020
1 parent 81ee17a commit 3b5ebf8
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion hw/arm/smmu-common.c
Expand Up @@ -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, &entry);
memory_region_notify_iommu_one(n, &entry);
}

/* Unmap all notifiers attached to @mr */
Expand Down
2 changes: 1 addition & 1 deletion hw/arm/smmuv3.c
Expand Up @@ -828,7 +828,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, &entry);
memory_region_notify_iommu_one(n, &entry);
}

/* invalidate an asid/iova range tuple in all mr's */
Expand Down
4 changes: 2 additions & 2 deletions hw/i386/intel_iommu.c
Expand Up @@ -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, &entry);
memory_region_notify_iommu_one(n, &entry);

start += mask;
remain -= mask;
Expand Down Expand Up @@ -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;
}

Expand Down
6 changes: 3 additions & 3 deletions include/exec/memory.h
Expand Up @@ -236,7 +236,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
Expand Down Expand Up @@ -1346,7 +1346,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
Expand All @@ -1357,7 +1357,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);

/**
Expand Down
6 changes: 3 additions & 3 deletions softmmu/memory.c
Expand Up @@ -1942,8 +1942,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;
Expand Down Expand Up @@ -1979,7 +1979,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, &entry);
memory_region_notify_iommu_one(iommu_notifier, &entry);
}
}
}
Expand Down

0 comments on commit 3b5ebf8

Please sign in to comment.