Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp1447818ybb; Thu, 9 Apr 2020 02:16:51 -0700 (PDT) X-Google-Smtp-Source: APiQypLkd/TdGJ/tGOSDRdnYz1e7PwrbVMoew61s1BEiRHJY6YC1csc3mRpwlfW/FNCbXPc56OPw X-Received: by 2002:aca:1e0e:: with SMTP id m14mr5646034oic.136.1586423811447; Thu, 09 Apr 2020 02:16:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1586423811; cv=none; d=google.com; s=arc-20160816; b=UDl11O3VZDsnwSlCKqm5+99OS6grzhz3eIVH1003PCuSRrvYxnNdCt4hZ5C37RWZJi x8Lg2p+K6ATzuJrudGayl+YFe4kiK+e7MMaAlcxY53yd99SaKGc23x1WI8MNntx1YusG NuE5PSUltMA/LZEILDpWiV7wh7rmDDIs+K1s+PLCwtpk3g3//s7tWJlvac+7e5WKgfCO xkt3oZcYkU8tszyCzY/3V5yCTirzH9Y4RhVflzeFUpvnd6nDIGbUiPNuFOkrkVt3Utmb IZMPw/mQtLus/tj6ARcCv+obcSvaE96beFtIUxTN0bpru9YB4ZYM0Dw/GVEgT7Jixiwi inqg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:content-transfer-encoding :dlp-reaction:dlp-version:dlp-product:content-language :accept-language:in-reply-to:references:message-id:date:thread-index :thread-topic:subject:cc:to:from:ironport-sdr:ironport-sdr; bh=DEDTbSs1bkyZVMoi3QMyYBTKGC9mLLBvZPUydLhmnDs=; b=oBa8swJ0AOqMw5S8GaN7Pj9hfLwUMVSmMG15Zl7ntRv+Ms+hLOeBCJKNn1rcWFtx+M yEad4nn7t8ltxLs0FmufurkDZSydun54oIIqKtO3OAM7QSHt70EAfDAblirJ6EXVZfp9 nfLKaf9HicCgaksYaFdCYaQsP1Y+SuhwT8FcYcSjS/rAsDyhO+ahT1DI8NRwGL5QiYZI 2/uJyvYhEHi9YW/6lTXBESFOmTFFYSasT9LJp9V9ouDwcTryTwIwuXujOFbag9yzqdZY ZYeAVxVo81VSxS9gywsh0RKCVOBwkqyXXCLetVyuQ50L3Bgr7vxfabb0zR8SluWkqINL FMQw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k39si3306238otk.255.2020.04.09.02.16.33; Thu, 09 Apr 2020 02:16:51 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726579AbgDIJPg convert rfc822-to-8bit (ORCPT + 99 others); Thu, 9 Apr 2020 05:15:36 -0400 Received: from mga05.intel.com ([192.55.52.43]:2570 "EHLO mga05.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725783AbgDIJPg (ORCPT ); Thu, 9 Apr 2020 05:15:36 -0400 IronPort-SDR: YE+BXvrsLWuYVgaf4Gu4roxVU1q/OOKvm/V9Af2Q/X3Cln6wMKJQSr34u2D9dUBz8+2X1/hUff wcPAacJBbuNg== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 Apr 2020 02:15:35 -0700 IronPort-SDR: LKI2mMlF5gRpfCpUQKmtzZ9HxbE2ZCqbs8lOz4VEi0+4c9z2xO8vzNilg/v2NJuYCA6ZkGE25f Tbc1DvUcnVCA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.72,362,1580803200"; d="scan'208";a="270024062" Received: from fmsmsx107.amr.corp.intel.com ([10.18.124.205]) by orsmga002.jf.intel.com with ESMTP; 09 Apr 2020 02:15:35 -0700 Received: from fmsmsx111.amr.corp.intel.com (10.18.116.5) by fmsmsx107.amr.corp.intel.com (10.18.124.205) with Microsoft SMTP Server (TLS) id 14.3.439.0; Thu, 9 Apr 2020 02:15:34 -0700 Received: from shsmsx107.ccr.corp.intel.com (10.239.4.96) by fmsmsx111.amr.corp.intel.com (10.18.116.5) with Microsoft SMTP Server (TLS) id 14.3.439.0; Thu, 9 Apr 2020 02:15:33 -0700 Received: from shsmsx104.ccr.corp.intel.com ([169.254.5.225]) by SHSMSX107.ccr.corp.intel.com ([169.254.9.191]) with mapi id 14.03.0439.000; Thu, 9 Apr 2020 17:15:30 +0800 From: "Liu, Yi L" To: Jean-Philippe Brucker CC: "Tian, Kevin" , "alex.williamson@redhat.com" , "eric.auger@redhat.com" , "jacob.jun.pan@linux.intel.com" , "joro@8bytes.org" , "Raj, Ashok" , "Tian, Jun J" , "Sun, Yi Y" , "peterx@redhat.com" , "iommu@lists.linux-foundation.org" , "kvm@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "Wu, Hao" Subject: RE: [PATCH v1 6/8] vfio/type1: Bind guest page tables to host Thread-Topic: [PATCH v1 6/8] vfio/type1: Bind guest page tables to host Thread-Index: AQHWAEUdkW8K+/kg/06c7098DvJyv6hgm8wAgANYlCCAAK00AIAA6IawgAEUvACABu4SMIACfjcAgACRzFA= Date: Thu, 9 Apr 2020 09:15:29 +0000 Message-ID: References: <1584880325-10561-1-git-send-email-yi.l.liu@intel.com> <1584880325-10561-7-git-send-email-yi.l.liu@intel.com> <20200403083407.GB1269501@myrica> <20200409082846.GE2435@myrica> In-Reply-To: <20200409082846.GE2435@myrica> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-product: dlpe-windows dlp-version: 11.2.0.6 dlp-reaction: no-action x-originating-ip: [10.239.127.40] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 8BIT MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > From: Jean-Philippe Brucker > Sent: Thursday, April 9, 2020 4:29 PM > To: Liu, Yi L > > On Tue, Apr 07, 2020 at 10:33:25AM +0000, Liu, Yi L wrote: > > Hi Jean, > > > > > From: Jean-Philippe Brucker < jean-philippe@linaro.org > > > > Sent: Friday, April 3, 2020 4:35 PM > > > Subject: Re: [PATCH v1 6/8] vfio/type1: Bind guest page tables to host > > > > > > On Thu, Apr 02, 2020 at 08:05:29AM +0000, Liu, Yi L wrote: > > > > > > > > static long vfio_iommu_type1_ioctl(void *iommu_data, > > > > > > > > default: > > > > > > > > return -EINVAL; > > > > > > > > } > > > > > > > > + > > > > > > > > + } else if (cmd == VFIO_IOMMU_BIND) { > > > > > > > > > > > > > > BIND what? VFIO_IOMMU_BIND_PASID sounds clearer to me. > > > > > > > > > > > > Emm, it's up to the flags to indicate bind what. It was proposed to > > > > > > cover the three cases below: > > > > > > a) BIND/UNBIND_GPASID > > > > > > b) BIND/UNBIND_GPASID_TABLE > > > > > > c) BIND/UNBIND_PROCESS > > > > > > > > > > > > So it's called VFIO_IOMMU_BIND. > > > > > > > > > > but aren't they all about PASID related binding? > > > > > > > > yeah, I can rename it. :-) > > > > > > I don't know if anyone intends to implement it, but SMMUv2 supports > > > nesting translation without any PASID support. For that case the name > > > VFIO_IOMMU_BIND_GUEST_PGTBL without "PASID" anywhere makes more > sense. > > > Ideally we'd also use a neutral name for the IOMMU API instead of > > > bind_gpasid(), but that's easier to change later. > > > > I agree VFIO_IOMMU_BIND is somehow not straight-forward. Especially, it may > > cause confusion when thinking about VFIO_SET_IOMMU. How about using > > VFIO_NESTING_IOMMU_BIND_STAGE1 to cover a) and b)? And has another > > VFIO_BIND_PROCESS in future for the SVA bind case. > > I think minimizing the number of ioctls is more important than finding the > ideal name. VFIO_IOMMU_BIND was fine to me, but if it's too vague then > rename it to VFIO_IOMMU_BIND_PASID and we'll just piggy-back on it for > non-PASID things (they should be rare enough). maybe we can start with VFIO_IOMMU_BIND_PASID. Actually, there is also a discussion on reusing the same ioctl and vfio structure for pasid_alloc/free, bind/unbind_gpasid. and cache_inv. how about your opinion? https://lkml.org/lkml/2020/4/3/833 Regards, Yi Liu