From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1759981AbcJaGIc (ORCPT ); Mon, 31 Oct 2016 02:08:32 -0400 Received: from mga07.intel.com ([134.134.136.100]:28002 "EHLO mga07.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1759700AbcJaGIa (ORCPT ); Mon, 31 Oct 2016 02:08:30 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.31,573,1473145200"; d="scan'208";a="1061640551" Message-ID: <5816DF13.6030009@intel.com> Date: Mon, 31 Oct 2016 14:05:07 +0800 From: Jike Song User-Agent: Mozilla/5.0 (X11; Linux i686 on x86_64; rv:17.0) Gecko/20130801 Thunderbird/17.0.8 MIME-Version: 1.0 To: Kirti Wankhede CC: alex.williamson@redhat.com, pbonzini@redhat.com, kraxel@redhat.com, cjia@nvidia.com, qemu-devel@nongnu.org, kvm@vger.kernel.org, kevin.tian@intel.com, bjsdjshi@linux.vnet.ibm.com, linux-kernel@vger.kernel.org Subject: Re: [PATCH v10 10/19] vfio iommu: Add blocking notifier to notify DMA_UNMAP References: <1477517366-27871-1-git-send-email-kwankhede@nvidia.com> <1477517366-27871-11-git-send-email-kwankhede@nvidia.com> <5816BF70.4060601@intel.com> <15d36902-418e-74d8-0405-1efa21a265bb@nvidia.com> In-Reply-To: <15d36902-418e-74d8-0405-1efa21a265bb@nvidia.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 10/31/2016 01:59 PM, Kirti Wankhede wrote: > On 10/31/2016 9:20 AM, Jike Song wrote: >> On 10/27/2016 05:29 AM, Kirti Wankhede wrote: >>> Added blocking notifier to IOMMU TYPE1 driver to notify vendor drivers >>> about DMA_UNMAP. >>> Exported two APIs vfio_register_notifier() and vfio_unregister_notifier(). >>> Vendor driver should register notifer using these APIs. >>> Vendor driver should use VFIO_IOMMU_NOTIFY_DMA_UNMAP action to invalidate >>> mappings. >>> >>> Signed-off-by: Kirti Wankhede >>> Signed-off-by: Neo Jia >>> Change-Id: I5910d0024d6be87f3e8d3e0ca0eaeaaa0b17f271 >>> --- >>> drivers/vfio/vfio.c | 73 +++++++++++++++++++++++++++++++++ >>> drivers/vfio/vfio_iommu_type1.c | 89 ++++++++++++++++++++++++++++++++++++----- >>> include/linux/vfio.h | 11 +++++ >>> 3 files changed, 163 insertions(+), 10 deletions(-) >>> >>> diff --git a/drivers/vfio/vfio.c b/drivers/vfio/vfio.c >>> index 28b50ca14c52..ff05ac6b1e90 100644 >>> --- a/drivers/vfio/vfio.c >>> +++ b/drivers/vfio/vfio.c >>> @@ -1891,6 +1891,79 @@ err_unpin_pages: >>> } >>> EXPORT_SYMBOL(vfio_unpin_pages); >>> >>> +int vfio_register_notifier(struct device *dev, struct notifier_block *nb) >>> +{ >> >> Hi Kirti, >> >> Given that below 4 methods are members of vfio_iommu_driver_ops: >> >> pin_pages >> unpin_pages >> register_notifier >> unregister_notifier >> >> the names of exposed VFIO APIs could possibly be clearer: >> >> vfio_iommu_pin_pages >> vfio_iommu_unpin_pages >> vfio_iommu_register_notifier >> vfio_iommu_unreigster_nodier >> > > Hey Jike, > > I had followed the same style as other members in this structure: > > attach_group > detach_group > I mean the APIs exposed. For example, vfio_register_notifier() is somehow by the name too generic to know what it is provided for. -- Thanks, Jike