From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752601AbcLFD75 (ORCPT ); Mon, 5 Dec 2016 22:59:57 -0500 Received: from hqemgate14.nvidia.com ([216.228.121.143]:14104 "EHLO hqemgate14.nvidia.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751590AbcLFD7t (ORCPT ); Mon, 5 Dec 2016 22:59:49 -0500 X-PGP-Universal: processed; by hqpgpgate101.nvidia.com on Mon, 05 Dec 2016 19:59:47 -0800 Subject: Re: [PATCH 1/1] vfio iommu type1: WARN_ON if notifier block is not unregistered To: Alex Williamson References: <1480972100-846-1-git-send-email-kwankhede@nvidia.com> <20161205162613.693a7c52@t450s.home> CC: , , , , , X-Nvconfidentiality: public From: Kirti Wankhede Message-ID: Date: Tue, 6 Dec 2016 09:27:39 +0530 MIME-Version: 1.0 In-Reply-To: <20161205162613.693a7c52@t450s.home> X-Originating-IP: [10.24.71.15] X-ClientProxiedBy: DRUKMAIL102.nvidia.com (10.25.59.20) To bgmail102.nvidia.com (10.25.59.11) Content-Type: text/plain; charset="windows-1252" Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 12/6/2016 4:56 AM, Alex Williamson wrote: > On Tue, 6 Dec 2016 02:38:20 +0530 > Kirti Wankhede wrote: > >> 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 >> Change-Id: I75fd0a40e582a144fe7a037c7140d3513e8ff030 >> --- >> drivers/vfio/vfio_iommu_type1.c | 2 ++ >> 1 file changed, 2 insertions(+) >> >> diff --git a/drivers/vfio/vfio_iommu_type1.c b/drivers/vfio/vfio_iommu_type1.c >> index 023fba7b8d5a..37871ee0c0c5 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 venfor driver must unregister notifier */ > > s/venfor/vendor/ > >> + WARN_ON(iommu->notifier.head); >> } >> >> static void vfio_iommu_type1_detach_group(void *iommu_data, > > Applied for v4.10 with the above typo fix. Thanks, > Thanks Alex!