From: Kirti Wankhede Date: Mon, 5 Dec 2016 21:08:20 +0000 (+0530) Subject: vfio iommu type1: WARN_ON if notifier block is not unregistered X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=3cedd7d75f9ac397d20efa80a3d5f74bb52befcd;p=linux.git 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 Signed-off-by: Neo Jia Signed-off-by: Alex Williamson --- diff --git a/drivers/vfio/vfio_iommu_type1.c b/drivers/vfio/vfio_iommu_type1.c index b88ad1e5e7ffd..7274fe27ccac9 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,