From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-0.7 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4A718C2BB1D for ; Tue, 7 Apr 2020 10:33:31 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 2905F20644 for ; Tue, 7 Apr 2020 10:33:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728332AbgDGKda convert rfc822-to-8bit (ORCPT ); Tue, 7 Apr 2020 06:33:30 -0400 Received: from mga01.intel.com ([192.55.52.88]:13947 "EHLO mga01.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726399AbgDGKd3 (ORCPT ); Tue, 7 Apr 2020 06:33:29 -0400 IronPort-SDR: FPFM3prjgIG1IJDrOPG1N/h4i3Na8ugc+3Gdw15sfP7Cd23WgOWP+b3ndHprKZp3Dfm/FB/LH9 Qh665Az/REQA== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Apr 2020 03:33:29 -0700 IronPort-SDR: XpZt+O2iUSCoEK9yUeNSh7sumO7vG9vjSw8ex36zPLiZlE9N5cc8i5pG7TOakd9BQpVM6bly1l me/a5kPTscGw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.72,353,1580803200"; d="scan'208";a="361496130" Received: from fmsmsx107.amr.corp.intel.com ([10.18.124.205]) by fmsmga001.fm.intel.com with ESMTP; 07 Apr 2020 03:33:29 -0700 Received: from fmsmsx608.amr.corp.intel.com (10.18.126.88) by fmsmsx107.amr.corp.intel.com (10.18.124.205) with Microsoft SMTP Server (TLS) id 14.3.439.0; Tue, 7 Apr 2020 03:33:28 -0700 Received: from fmsmsx608.amr.corp.intel.com (10.18.126.88) by fmsmsx608.amr.corp.intel.com (10.18.126.88) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Tue, 7 Apr 2020 03:33:28 -0700 Received: from shsmsx108.ccr.corp.intel.com (10.239.4.97) by fmsmsx608.amr.corp.intel.com (10.18.126.88) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.1.1713.5 via Frontend Transport; Tue, 7 Apr 2020 03:33:28 -0700 Received: from shsmsx104.ccr.corp.intel.com ([169.254.5.225]) by SHSMSX108.ccr.corp.intel.com ([169.254.8.7]) with mapi id 14.03.0439.000; Tue, 7 Apr 2020 18:33:25 +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/06c7098DvJyv6hgm8wAgANYlCCAAK00AIAA6IawgAEUvACABu4SMA== Date: Tue, 7 Apr 2020 10:33:25 +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> In-Reply-To: <20200403083407.GB1269501@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 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. Regards, Yi Liu