diff options
author | Alexey Kardashevskiy | 2016-06-30 21:00:23 +0200 |
---|---|---|
committer | Alex Williamson | 2016-06-30 21:00:23 +0200 |
commit | d22d8956b185c002b50a4d0883aff61f857347ef (patch) | |
tree | 25764240d91bdafe36b0b98d1b5250b09e4e7e79 /hw | |
parent | vfio/pci: Hide SR-IOV capability (diff) | |
download | qemu-d22d8956b185c002b50a4d0883aff61f857347ef.tar.gz qemu-d22d8956b185c002b50a4d0883aff61f857347ef.tar.xz qemu-d22d8956b185c002b50a4d0883aff61f857347ef.zip |
memory: Add MemoryRegionIOMMUOps.notify_started/stopped callbacks
The IOMMU driver may change behavior depending on whether a notifier
client is present. In the case of POWER, this represents a change in
the visibility of the IOTLB, for other drivers such as intel-iommu and
future AMD-Vi emulation, notifier support is not yet enabled and this
provides the opportunity to flag that incompatibility.
Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
Reviewed-by: David Gibson <david@gibson.dropbear.id.au>
Reviewed-by: Peter Xu <peterx@redhat.com>
Tested-by: Peter Xu <peterx@redhat.com>
Acked-by: Paolo Bonzini <pbonzini@redhat.com>
[new log & extracted from [PATCH qemu v17 12/12] spapr_iommu, vfio, memory: Notify IOMMU about starting/stopping listening]
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
Diffstat (limited to 'hw')
-rw-r--r-- | hw/vfio/common.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/hw/vfio/common.c b/hw/vfio/common.c index 27cc1596f9..7be638e0e3 100644 --- a/hw/vfio/common.c +++ b/hw/vfio/common.c @@ -455,7 +455,8 @@ static void vfio_listener_region_del(MemoryListener *listener, QLIST_FOREACH(giommu, &container->giommu_list, giommu_next) { if (giommu->iommu == section->mr) { - memory_region_unregister_iommu_notifier(&giommu->n); + memory_region_unregister_iommu_notifier(giommu->iommu, + &giommu->n); QLIST_REMOVE(giommu, giommu_next); g_free(giommu); break; @@ -991,7 +992,7 @@ static void vfio_disconnect_container(VFIOGroup *group) QLIST_REMOVE(container, next); QLIST_FOREACH_SAFE(giommu, &container->giommu_list, giommu_next, tmp) { - memory_region_unregister_iommu_notifier(&giommu->n); + memory_region_unregister_iommu_notifier(giommu->iommu, &giommu->n); QLIST_REMOVE(giommu, giommu_next); g_free(giommu); } |