diff options
author | Jason Wang <jasowang@redhat.com> | 2016-12-30 18:09:17 +0800 |
---|---|---|
committer | Michael S. Tsirkin <mst@redhat.com> | 2017-01-10 05:56:59 +0200 |
commit | efcd38c529fd9c461cfcd48265855ce6aab2ef0a (patch) | |
tree | 638b6eea57faa28b25b01f7685ad0a666389423e | |
parent | bd2baaccd521a9cfcc56e0a9a69c903fcee56aa4 (diff) | |
download | qemu-efcd38c529fd9c461cfcd48265855ce6aab2ef0a.zip qemu-efcd38c529fd9c461cfcd48265855ce6aab2ef0a.tar.gz qemu-efcd38c529fd9c461cfcd48265855ce6aab2ef0a.tar.bz2 |
memory: handle alias for iommu notifier
Cc: Paolo Bonzini <pbonzini@redhat.com>
Acked-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Jason Wang <jasowang@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Reviewed-by: Peter Xu <peterx@redhat.com>
-rw-r--r-- | memory.c | 9 |
1 files changed, 9 insertions, 0 deletions
@@ -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); } |