summaryrefslogtreecommitdiffstats
path: root/drivers/vfio/vfio_iommu_type1.c
diff options
context:
space:
mode:
authorKirti Wankhede2016-12-05 22:08:20 +0100
committerAlex Williamson2016-12-06 00:04:33 +0100
commit3cedd7d75f9ac397d20efa80a3d5f74bb52befcd (patch)
tree99bf6b5b1b8250cd7637fe65a68407086d0ff92a /drivers/vfio/vfio_iommu_type1.c
parentkvm: set/clear kvm to/from vfio_group when group add/delete (diff)
downloadkernel-qcow2-linux-3cedd7d75f9ac397d20efa80a3d5f74bb52befcd.tar.gz
kernel-qcow2-linux-3cedd7d75f9ac397d20efa80a3d5f74bb52befcd.tar.xz
kernel-qcow2-linux-3cedd7d75f9ac397d20efa80a3d5f74bb52befcd.zip
vfio iommu type1: WARN_ON if notifier block is not unregistered
mdev vendor driver should unregister the iommu notifier since the vfio iommu can persist beyond the attachment of the mdev group. WARN_ON will show warning if vendor driver doesn't unregister the notifier and is forced to follow the implementations steps. Signed-off-by: Kirti Wankhede <kwankhede@nvidia.com> Signed-off-by: Neo Jia <cjia@nvidia.com> Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
Diffstat (limited to 'drivers/vfio/vfio_iommu_type1.c')
-rw-r--r--drivers/vfio/vfio_iommu_type1.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/vfio/vfio_iommu_type1.c b/drivers/vfio/vfio_iommu_type1.c
index b88ad1e5e7ff..7274fe27ccac 100644
--- a/drivers/vfio/vfio_iommu_type1.c
+++ b/drivers/vfio/vfio_iommu_type1.c
@@ -1361,6 +1361,8 @@ static void vfio_sanity_check_pfn_list(struct vfio_iommu *iommu)
if (WARN_ON(!RB_EMPTY_ROOT(&dma->pfn_list)))
break;
}
+ /* mdev vendor driver must unregister notifier */
+ WARN_ON(iommu->notifier.head);
}
static void vfio_iommu_type1_detach_group(void *iommu_data,