[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [RFC PATCH 08/13] memory: provide iommu_replay_all()
From: |
Peter Xu |
Subject: |
[Qemu-devel] [RFC PATCH 08/13] memory: provide iommu_replay_all() |
Date: |
Tue, 6 Dec 2016 18:36:23 +0800 |
This is an "global" version of exising memory_region_iommu_replay() - we
announce the translations to all the registered notifiers, instead of a
specific one.
Signed-off-by: Peter Xu <address@hidden>
---
include/exec/memory.h | 8 ++++++++
memory.c | 9 +++++++++
2 files changed, 17 insertions(+)
diff --git a/include/exec/memory.h b/include/exec/memory.h
index cb2d432..1669c7b 100644
--- a/include/exec/memory.h
+++ b/include/exec/memory.h
@@ -693,6 +693,14 @@ void memory_region_iommu_replay(MemoryRegion *mr,
IOMMUNotifier *n,
bool is_write);
/**
+ * memory_region_iommu_replay_all: replay existing IOMMU translations
+ * to all the notifiers registered.
+ *
+ * @mr: the memory region to observe
+ */
+void memory_region_iommu_replay_all(MemoryRegion *mr);
+
+/**
* memory_region_unregister_iommu_notifier: unregister a notifier for
* changes to IOMMU translation entries.
*
diff --git a/memory.c b/memory.c
index f73c897..62ca6e0 100644
--- a/memory.c
+++ b/memory.c
@@ -1641,6 +1641,15 @@ void memory_region_iommu_replay(MemoryRegion *mr,
IOMMUNotifier *n,
}
}
+void memory_region_iommu_replay_all(MemoryRegion *mr)
+{
+ IOMMUNotifier *notifier;
+
+ QLIST_FOREACH(notifier, &mr->iommu_notify, node) {
+ memory_region_iommu_replay(mr, notifier, false);
+ }
+}
+
void memory_region_unregister_iommu_notifier(MemoryRegion *mr,
IOMMUNotifier *n)
{
--
2.7.4
- Re: [Qemu-devel] [RFC PATCH 01/13] intel_iommu: allocate new key when creating new address space, (continued)
[Qemu-devel] [RFC PATCH 02/13] intel_iommu: simplify irq region translation, Peter Xu, 2016/12/06
[Qemu-devel] [RFC PATCH 03/13] intel_iommu: renaming gpa to iova where proper, Peter Xu, 2016/12/06
[Qemu-devel] [RFC PATCH 05/13] intel_iommu: fix trace for addr translation, Peter Xu, 2016/12/06
[Qemu-devel] [RFC PATCH 04/13] intel_iommu: fix trace for inv desc handling, Peter Xu, 2016/12/06
[Qemu-devel] [RFC PATCH 06/13] intel_iommu: vtd_slpt_level_shift check level, Peter Xu, 2016/12/06
[Qemu-devel] [RFC PATCH 07/13] memory: add section range info for IOMMU notifier, Peter Xu, 2016/12/06
[Qemu-devel] [RFC PATCH 08/13] memory: provide iommu_replay_all(),
Peter Xu <=
[Qemu-devel] [RFC PATCH 09/13] memory: introduce memory_region_notify_one(), Peter Xu, 2016/12/06
[Qemu-devel] [RFC PATCH 10/13] memory: add MemoryRegionIOMMUOps.replay() callback, Peter Xu, 2016/12/06
[Qemu-devel] [RFC PATCH 11/13] intel_iommu: provide its own replay() callback, Peter Xu, 2016/12/06
[Qemu-devel] [RFC PATCH 12/13] intel_iommu: do replay when context invalidate, Peter Xu, 2016/12/06
[Qemu-devel] [RFC PATCH 13/13] intel_iommu: use page_walk for iotlb inv notify, Peter Xu, 2016/12/06
Re: [Qemu-devel] [RFC PATCH 00/13] VT-d replay and misc cleanup, Peter Xu, 2016/12/06
Re: [Qemu-devel] [RFC PATCH 00/13] VT-d replay and misc cleanup, Peter Xu, 2016/12/13
Re: [Qemu-devel] [RFC PATCH 00/13] VT-d replay and misc cleanup, Liu, Yi L, 2016/12/19