Received: from eggs.gnu.org ([2001:4830:134:3::10]:48763) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1c2LJ5-0000Sy-IL for qemu-devel@nongnu.org; Thu, 03 Nov 2016 12:56:04 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1c2LJ2-0001yD-GQ for qemu-devel@nongnu.org; Thu, 03 Nov 2016 12:56:03 -0400 Received: from mx1.redhat.com ([209.132.183.28]:53816) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1c2LJ2-0001y3-B6 for qemu-devel@nongnu.org; Thu, 03 Nov 2016 12:56:00 -0400 References: <1478165243-4767-1-git-send-email-jasowang@redhat.com> <1478165243-4767-10-git-send-email-jasowang@redhat.com> From: Paolo Bonzini Message-ID: Date: Thu, 3 Nov 2016 17:55:53 +0100 MIME-Version: 1.0 In-Reply-To: <1478165243-4767-10-git-send-email-jasowang@redhat.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH V2 09/11] memory: handle alias for iommu notifier List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Jason Wang , mst@redhat.com, peterx@redhat.com, wexu@redhat.com, qemu-devel@nongnu.org Cc: vkaplans@redhat.com, cornelia.huck@de.ibm.com On 03/11/2016 10:27, Jason Wang wrote: > 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 33110e9..2bfc37f 100644 > --- a/memory.c > +++ b/memory.c > @@ -1603,6 +1603,11 @@ static void memory_region_update_iommu_notify_flags(MemoryRegion *mr) > void memory_region_register_iommu_notifier(MemoryRegion *mr, > IOMMUNotifier *n) > { > + if (mr->alias) { > + memory_region_register_iommu_notifier(mr->alias, n); > + return; > + } > + > /* We need to register for at least one bitfield */ > assert(n->notifier_flags != IOMMU_NOTIFIER_NONE); > QLIST_INSERT_HEAD(&mr->iommu_notify, n, node); > @@ -1643,6 +1648,10 @@ void memory_region_iommu_replay(MemoryRegion *mr, IOMMUNotifier *n, > void memory_region_unregister_iommu_notifier(MemoryRegion *mr, > IOMMUNotifier *n) > { > + if (mr->alias) { > + memory_region_unregister_iommu_notifier(mr->alias, n); > + return; > + } > QLIST_REMOVE(n, node); > memory_region_update_iommu_notify_flags(mr); > } > Acked-by: Paolo Bonzini