From d22d8956b185c002b50a4d0883aff61f857347ef Mon Sep 17 00:00:00 2001 From: Alexey Kardashevskiy Date: Thu, 30 Jun 2016 13:00:23 -0600 Subject: 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 Reviewed-by: David Gibson Reviewed-by: Peter Xu Tested-by: Peter Xu Acked-by: Paolo Bonzini [new log & extracted from [PATCH qemu v17 12/12] spapr_iommu, vfio, memory: Notify IOMMU about starting/stopping listening] Signed-off-by: Alex Williamson --- hw/vfio/common.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'hw/vfio/common.c') 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); } -- cgit v1.2.3-55-g7522