Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A94E5EACC for ; Wed, 27 Sep 2023 18:52:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1695840757; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Kq5Qg2bQQlEqkI6mgl+PBDF3TD7HEyYrhhIx1gLZrcg=; b=eDWnEDa08UjIOp072Z8kURuihNsmqYZ8UqlfdWSQ29/LgaLhrWmOcC1me+u8LjgM3iSqbo uuutoHa32iKKhuRHTf5Ack4SZiFk4Uv27WNJZoAoGKKj5+L8PO0NZQnrxQPUhp4m3s0RbM 2SKJfthpPr0WNoowvK3N8HAXug4ym/w= Received: from mail-oo1-f72.google.com (mail-oo1-f72.google.com [209.85.161.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-349-wqGM4a7wOoqSx19cx_wFIw-1; Wed, 27 Sep 2023 14:52:35 -0400 X-MC-Unique: wqGM4a7wOoqSx19cx_wFIw-1 Received: by mail-oo1-f72.google.com with SMTP id 006d021491bc7-57b8079db51so21196682eaf.3 for ; Wed, 27 Sep 2023 11:52:35 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1695840755; x=1696445555; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Kq5Qg2bQQlEqkI6mgl+PBDF3TD7HEyYrhhIx1gLZrcg=; b=lnoUc7sjv5rLJJ94Krz2mV+GzSE6Xckd4Lk+olk5NtV3ZB16fFvTvaCbGMf7Dv+qDg QWCe4vG0XNOHdroiddQYwYg0sPkJ5YHa9WC29mOKG3KsicxnSWYjhPcYd3lI1jn7PJYq KKmkBMfzMOOTkWRvOkad2J/IKPcaJu9v8s74m2mEHxJhDZv6CnjbrPb6opcA1J41QfJp zLops5nOTEvttQppejSrm9nOG2/dhM1pLZm0H742jX2K2hPt351v3Ceq2Gej0eFRYteb 26r2PMxpJAFk4uuniAlqVntEoKN4srmS+HOMD0S0R8uZAK+YJH7DBdFNn8zNO/T8qawE hRiQ== X-Gm-Message-State: AOJu0YxVP7ErVUrlSKeSby5/+n1LTGtJo+SDJ1CDm9W4AttNoKQcib2Z SBv7F+cXe934e9tDLWPXZjR4662DfTvTq7O1+cKEurXuqXzN/1Wc51eX/a0dLXVWoys8XOPFsKg NdgGFh0HyA8swDv8= X-Received: by 2002:a4a:6246:0:b0:57b:6a40:8a9e with SMTP id y6-20020a4a6246000000b0057b6a408a9emr3241158oog.7.1695840755197; Wed, 27 Sep 2023 11:52:35 -0700 (PDT) X-Google-Smtp-Source: AGHT+IE3cPePjgR+735wrJbNOWlgYYeVheIM5ALo2dqBObMKFrQpCrxuu4qqIaRtOinyevyLL0/Zfw== X-Received: by 2002:a4a:6246:0:b0:57b:6a40:8a9e with SMTP id y6-20020a4a6246000000b0057b6a408a9emr3241122oog.7.1695840754919; Wed, 27 Sep 2023 11:52:34 -0700 (PDT) Received: from redhat.com ([38.15.60.12]) by smtp.gmail.com with ESMTPSA id p187-20020a4a48c4000000b0054f85f67f31sm2878334ooa.46.2023.09.27.11.52.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 Sep 2023 11:52:34 -0700 (PDT) Date: Wed, 27 Sep 2023 12:52:31 -0600 From: Alex Williamson To: "Tian, Kevin" Cc: "Liu, Yi L" , "jgg@nvidia.com" , "robin.murphy@arm.com" , "baolu.lu@linux.intel.com" , "joro@8bytes.org" , "cohuck@redhat.com" , "eric.auger@redhat.com" , "nicolinc@nvidia.com" , "kvm@vger.kernel.org" , "mjrosato@linux.ibm.com" , "chao.p.peng@linux.intel.com" , "yi.y.sun@linux.intel.com" , "peterx@redhat.com" , "jasowang@redhat.com" , "shameerali.kolothum.thodi@huawei.com" , "lulu@redhat.com" , "suravee.suthikulpanit@amd.com" , "iommu@lists.linux.dev" , "linux-kernel@vger.kernel.org" , "linux-kselftest@vger.kernel.org" , "Duan, Zhenzhong" , "Martins, Joao" Subject: Re: [RFC 3/3] vfio/pci: Expose PCIe PASID capability to userspace Message-ID: <20230927125231.3aacde62.alex.williamson@redhat.com> In-Reply-To: References: <20230926093121.18676-1-yi.l.liu@intel.com> <20230926093121.18676-4-yi.l.liu@intel.com> X-Mailer: Claws Mail 4.1.1 (GTK 3.24.35; x86_64-redhat-linux-gnu) Precedence: bulk X-Mailing-List: iommu@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit On Wed, 27 Sep 2023 08:07:54 +0000 "Tian, Kevin" wrote: > > From: Liu, Yi L > > Sent: Tuesday, September 26, 2023 5:31 PM > > > > This exposes PCIe PASID capability to userspace and where to emulate this > > capability if wants to further expose it to VM. > > > > And this only exposes PASID capability for devices which has PCIe PASID > > extended struture in its configuration space. While for VFs, userspace > > is still unable to see this capability as SR-IOV spec forbides VF to > > implement PASID capability extended structure. It is a TODO in future. > > Related discussion can be found in below links: > > > > https://lore.kernel.org/kvm/20200407095801.648b1371@w520.home/ > > https://lore.kernel.org/kvm/BL1PR11MB5271A60035EF591A5BE8AC878C01A > > @BL1PR11MB5271.namprd11.prod.outlook.com/ > > > > Yes, we need a decision for VF case. > > If the consensus is to continue exposing the PASID capability in vfio-pci > config space by developing a kernel quirk mechanism to find offset for > VF, then this patch for PF is orthogonal to that VF work and can go as it is. > > But if the decision is to have a device feature for the user to enumerate > the vPASID capability and let the VMM take care of finding the vPASID > cap offset, then better we start doing that for PF too since it's not good > to have two enumeration interfaces for PF/VF respectively. Note also that QEMU implements a lazy algorithm for exposing capabilities, the default is to expose them, so we need to consider existing VMs seeing a new read-only PASID capability on an assigned PF. That might support an alternate means to expose the capability. > My preference is via device feature given Qemu already includes lots of > quirks for vfio-pci devices. Another reason is that when supporting vPASID > with SIOV there are some arch constraints which the driver needs to > report to the user to follow (e.g. don't assign ENQCMD-capable sibling > vdev's to a same guest, etc.). ?! > A device feature interface can better > encapsulate everything related to vPASID in one place. Sorry if I don't remember, have you posted a proposal for the device feature interface? Thanks, Alex