Skip to content

Commit

Permalink
smmu: switch to use memory_region_unmap_iommu_notifier_range()
Browse files Browse the repository at this point in the history
Signed-off-by: Jason Wang <jasowang@redhat.com>
Message-Id: <20230223065924.42503-5-jasowang@redhat.com>
Reviewed-by: Peter Xu <peterx@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
  • Loading branch information
jasowang authored and mstsirkin committed Mar 3, 2023
1 parent 7caebbf commit 98332f6
Showing 1 changed file with 1 addition and 15 deletions.
16 changes: 1 addition & 15 deletions hw/arm/smmu-common.c
Original file line number Diff line number Diff line change
Expand Up @@ -467,28 +467,14 @@ IOMMUMemoryRegion *smmu_iommu_mr(SMMUState *s, uint32_t sid)
return NULL;
}

/* Unmap the whole notifier's range */
static void smmu_unmap_notifier_range(IOMMUNotifier *n)
{
IOMMUTLBEvent event;

event.type = IOMMU_NOTIFIER_UNMAP;
event.entry.target_as = &address_space_memory;
event.entry.iova = n->start;
event.entry.perm = IOMMU_NONE;
event.entry.addr_mask = n->end - n->start;

memory_region_notify_iommu_one(n, &event);
}

/* Unmap all notifiers attached to @mr */
static void smmu_inv_notifiers_mr(IOMMUMemoryRegion *mr)
{
IOMMUNotifier *n;

trace_smmu_inv_notifiers_mr(mr->parent_obj.name);
IOMMU_NOTIFIER_FOREACH(n, mr) {
smmu_unmap_notifier_range(n);
memory_region_unmap_iommu_notifier_range(n);
}
}

Expand Down

0 comments on commit 98332f6

Please sign in to comment.