Received: from eggs.gnu.org ([2001:4830:134:3::10]:39512) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1beZOt-0001XQ-AU for qemu-devel@nongnu.org; Mon, 29 Aug 2016 23:07:48 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1beZOr-0006Bi-7g for qemu-devel@nongnu.org; Mon, 29 Aug 2016 23:07:46 -0400 Received: from mx1.redhat.com ([209.132.183.28]:56230) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1beZOr-0006Be-1n for qemu-devel@nongnu.org; Mon, 29 Aug 2016 23:07:45 -0400 From: Jason Wang Date: Tue, 30 Aug 2016 11:06:57 +0800 Message-Id: <1472526419-5900-10-git-send-email-jasowang@redhat.com> In-Reply-To: <1472526419-5900-1-git-send-email-jasowang@redhat.com> References: <1472526419-5900-1-git-send-email-jasowang@redhat.com> Subject: [Qemu-devel] [PATCH for 2.8 09/11] memory: handle alias for iommu notifier List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: mst@redhat.com, qemu-devel@nongnu.org Cc: pbonzini@redhat.com, peterx@redhat.com, cornelia.huck@de.ibm.com, wexu@redhat.com, vkaplans@redhat.com, Jason Wang Cc: Paolo Bonzini Signed-off-by: Jason Wang --- memory.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/memory.c b/memory.c index 0eb6895..ca0a698 100644 --- a/memory.c +++ b/memory.c @@ -1515,6 +1515,11 @@ bool memory_region_is_logging(MemoryRegion *mr, uint8_t client) void memory_region_register_iommu_notifier(MemoryRegion *mr, Notifier *n) { + if (mr->alias) { + memory_region_register_iommu_notifier(mr->alias, n); + return; + } + if (mr->iommu_ops->notify_started && QLIST_EMPTY(&mr->iommu_notify.notifiers)) { mr->iommu_ops->notify_started(mr); @@ -1554,6 +1559,10 @@ void memory_region_iommu_replay(MemoryRegion *mr, Notifier *n, bool is_write) void memory_region_unregister_iommu_notifier(MemoryRegion *mr, Notifier *n) { + if (mr->alias) { + memory_region_unregister_iommu_notifier(mr->alias, n); + return; + } notifier_remove(n); if (mr->iommu_ops->notify_stopped && QLIST_EMPTY(&mr->iommu_notify.notifiers)) { -- 2.7.4