Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp1417374ybb; Thu, 9 Apr 2020 01:29:53 -0700 (PDT) X-Google-Smtp-Source: APiQypJ7rTwEdLIlSadHWHHLuFOpYXGbsCvrgTJ1Z3LrdLRS8a33iw8dwe2UV0f/aCfT5sI75Gbz X-Received: by 2002:a4a:271d:: with SMTP id l29mr9094745oof.18.1586420993381; Thu, 09 Apr 2020 01:29:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1586420993; cv=none; d=google.com; s=arc-20160816; b=lTncbM9Kijh2WF52NJh8GtC3pzVUDImvvGSJleXn14Lg2ECaMpIqIYb6fgIZCIA1PG xtfi+28t8Kc0TecGQafHbGwhfie55BFWk0yjRpdY4MOaN3VqwWHAQqfXQCOvF+HQCIjj alJ6m3WwsTq7EZ8a9Ts7GgIpf2156NeQifI5cncpwa9gcdF5sgDOI369Zd/MrMOYxadR h/xViu4/MrDLCXutmkz/VG0gwkZGbZe88LKlR13xGLpwIpgEf4X085D5YjGAbp2Upm9j sHC1gBiSSsKPo44IEvQEFs3zEO2dbAEmxRFTm4/JNfpO4W11laNDOAvzRF9Nd3g4pLMx Qdag== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=WgrtA3z9gcCpvVtn+/QtJVLHi+wEpZ3q6REO1Dlhxjc=; b=lbl/drjTDGjY3dbs12ZoNZW8rEl+7iG1MEHLhODbM9qQGIUUrp14QaDycy36NvSU8f 1MKe9S5PzukRIceHkeuuOth5oflWl52QmQpwS83kUyol3RTV5ozA+Xpex+ica4kUbma9 Fr94UWnoieu2hXysqqQn6kFAlyaYYOSmQnOvGEUrWGOmlMNWumEBskKQrpPZt3h+nMIw TrEDjWrVOwnu1nXxZHpVPM2CEwZlVO909VBq51x3TSlB4ivkPRPILnXQPMFNLHsY0neG WBBSJrgDg8hWnIP3X3Hzxm3Nims+zKxcYsZ0xxLjqUYAEHnKUYmpPHw4U15x0YZe2x5k nhAg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=EwT7A41K; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d63si3158691oib.224.2020.04.09.01.29.38; Thu, 09 Apr 2020 01:29:53 -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; dkim=pass header.i=@linaro.org header.s=google header.b=EwT7A41K; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726647AbgDII24 (ORCPT + 99 others); Thu, 9 Apr 2020 04:28:56 -0400 Received: from mail-wr1-f65.google.com ([209.85.221.65]:36146 "EHLO mail-wr1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725828AbgDII24 (ORCPT ); Thu, 9 Apr 2020 04:28:56 -0400 Received: by mail-wr1-f65.google.com with SMTP id k1so10933426wrm.3 for ; Thu, 09 Apr 2020 01:28:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=WgrtA3z9gcCpvVtn+/QtJVLHi+wEpZ3q6REO1Dlhxjc=; b=EwT7A41KDLkk8jDmuwXWJhwVkRRmXWA9OX4bUYtDtbxYJW+BezFqEYR2LyeY8NYE1n qsISncWQMRghInp7uM9xVtUlfEZTQzsVHplk5XeWwX6PkZMXqZwF4UMtYgj3zaNm+RrD tLmAnD7ijZbtkbWHYzv5URL/0X1eKDlkHVJzC329EMt0/pbrkBtiSa/dy1S0jYkDDbZD 8+g568tPwHC1C8QI/NhKp5kQqGO7edSzI4Gt3SfIt/ysuGcApiyrZMbxGdKzImTfyZZP G2Sh69tPb6Gm1lN6ndVUe9rhMwabrdl5f/Q41dh8Js0FocrCVYBIK0HVBzk1FugewyrL PNlA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=WgrtA3z9gcCpvVtn+/QtJVLHi+wEpZ3q6REO1Dlhxjc=; b=dLXuagXEU2fOlsdk1UBCSgFD1kKLuyQItq1lbkAACJsdH71Zuh6We7r+SJCtGOlML0 RFZ6SJYETV29vMQkLdv4kkaSRIh5JYEEhuaRyN3s7toFKSzUill4OUcgvZ+1TLW0IDFQ xqIgemvEroVw3O7QE6DK5hJXtPuhZ3w6oyn76OfviOTIzJQixAIOC+66wRf6NyjVILFq hZr7zWj9Vf5QQRnvJDXPW9W+jcgS7cYjiu+4TG4V/RxYCBtos7/AFdNsYjtl2bFoGX5d m2FZAMxT60MEqPHQXMbaOBuDtHEVRjvKOA0lG878io0Va0HI8Ux6Mc9zjO/wUNq9YNib 38Cg== X-Gm-Message-State: AGi0PubSHVFx2aFLmIxvzKUX+ZxgmV/HtX32jtu97npX31vbtyR2Pl2j P1BEjY7uf9nJS6WEYqpihzy2gA== X-Received: by 2002:adf:e641:: with SMTP id b1mr12714165wrn.299.1586420934729; Thu, 09 Apr 2020 01:28:54 -0700 (PDT) Received: from myrica ([2001:171b:226b:54a0:116c:c27a:3e7f:5eaf]) by smtp.gmail.com with ESMTPSA id p5sm14167665wrn.93.2020.04.09.01.28.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 09 Apr 2020 01:28:54 -0700 (PDT) Date: Thu, 9 Apr 2020 10:28:46 +0200 From: Jean-Philippe Brucker To: "Liu, Yi L" 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 Message-ID: <20200409082846.GE2435@myrica> 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> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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). Thanks, Jean