]> git.karo-electronics.de Git - linux-beck.git/commitdiff
vfio iommu type1: WARN_ON if notifier block is not unregistered
authorKirti Wankhede <kwankhede@nvidia.com>
Mon, 5 Dec 2016 21:08:20 +0000 (02:38 +0530)
committerAlex Williamson <alex.williamson@redhat.com>
Mon, 5 Dec 2016 23:04:33 +0000 (16:04 -0700)
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>
drivers/vfio/vfio_iommu_type1.c

index b88ad1e5e7ffd6b78a9a0cc16a33d35b9810fdda..7274fe27ccac94a5d50f2d64d122774c164314f5 100644 (file)
@@ -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,