@@ -707,6 +707,15 @@ void memory_region_notify_iommu(MemoryRegion *mr,
void memory_region_notify_iommu_svm_bind(MemoryRegion *mr,
void *data);
+/*
+ * memory_region_notify_iommu_invalidate: notify IOMMU
+ * TLB invalidation passdown.
+ *
+ * @mr: the memory region of IOMMU
+ * @data: IOMMU SVM data
+ */
+void memory_region_notify_iommu_invalidate(MemoryRegion *mr,
+ void *data);
/**
* memory_region_notify_one: notify a change in an IOMMU translation
@@ -1750,6 +1750,24 @@ void memory_region_notify_iommu_svm_bind(MemoryRegion *mr,
}
}
+void memory_region_notify_iommu_invalidate(MemoryRegion *mr,
+ void *data)
+{
+ IOMMUNotifier *iommu_notifier;
+ IOMMUNotifierFlag request_flags;
+
+ assert(memory_region_is_iommu(mr));
+
+ request_flags = IOMMU_NOTIFIER_IOMMU_TLB_INV;
+
+ QLIST_FOREACH(iommu_notifier, &mr->iommu_notify, node) {
+ if (iommu_notifier->notifier_flags & request_flags) {
+ iommu_notifier->notify(iommu_notifier, data);
+ break;
+ }
+ }
+}
+
void memory_region_set_log(MemoryRegion *mr, bool log, unsigned client)
{
uint8_t mask = 1 << client;
This patch adds a separate function to fire IOMMU TLB invalidate notifier. Signed-off-by: Liu, Yi L <yi.l.liu@linux.intel.com> --- include/exec/memory.h | 9 +++++++++ memory.c | 18 ++++++++++++++++++ 2 files changed, 27 insertions(+)