Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp869467ybb; Wed, 8 Apr 2020 11:28:40 -0700 (PDT) X-Google-Smtp-Source: APiQypJMETt76af33J3kkrPi0EO5MtcOqleLaFHyyWsEEuPFVHWtr9Z+sBoclrrqV81PdHdOfGad X-Received: by 2002:a4a:41ce:: with SMTP id x197mr7039162ooa.77.1586370520544; Wed, 08 Apr 2020 11:28:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1586370520; cv=none; d=google.com; s=arc-20160816; b=Vt7k4fCKn88gHka0W+jayAUTrQLmPkWwoYrWRUdSndPmAhWnbFYVlIvl5jGpFJtLFy K6T3+Ex00ecyypYVYGpbjSSEvEEdhcIgsxQ1m+rF6QSPD0BmM9F/T+Q+PMKFrGHBBZn/ LNl7Snpr3Ro11L1iLI/dC2Edfvg/IAiEEpTpUGW8TGAN5Sy4q4d062lrF13p4WVo2R0w Xp576/8w/VbfOj/xTUgksuND42H3CQRhHxE9gWQO7nQ+gFHP5+TH9/LXN4o6YlViTvGl boW2KBIrbPETlFXFPqOIM8gMJ7vL13MJhmQW/eeQTzJQAhHIBjcSI2opc5Fefao5KUE2 2Uig== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:ironport-sdr:ironport-sdr; bh=VYn/5rQF6kYnXkzo1CUxunZLsEA7yY4te+aauiOx7gc=; b=qn2MxGwZYDP/Q8GXgt7WZa301FLKZnp3wg2E9lSUksg40VSI2VoU4qDQomyncTOBCU grWCJ2Al1VJirhTjH7OLAPdawj984+yYLJRwvZPZForjUGj6856V9E0buVGEe3+SbZdh eNr8Fb0i29UwfUgBugCvOGgCfivJw16aVh8RG6ta+Gzdsk239kAY4Jduhu8U25GjfmjS cPfvrdk7V4GWNn3NMPQVgAbSye+eNh0S+r4JDzuc277djHorh4hn3VXuz+wSYeG9v4xY nosgT1nXhb6miygeKgcd7uBqc9n7NQpiidg1SlsqxvoOCR95uA4dJekc7tFWbo6GsfyE 4I1w== 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 w28si3067881oth.317.2020.04.08.11.28.27; Wed, 08 Apr 2020 11:28:40 -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 S1728511AbgDHQdr (ORCPT + 99 others); Wed, 8 Apr 2020 12:33:47 -0400 Received: from mga09.intel.com ([134.134.136.24]:35544 "EHLO mga09.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728256AbgDHQdr (ORCPT ); Wed, 8 Apr 2020 12:33:47 -0400 IronPort-SDR: m6LtU2YSPzrddw+ltPjjGpzkG3IdWooFKH3Z5cYV3UKyf3gocsDWW7JQWTPQmwRwmGHfwwdDCT hivXqKraG8RQ== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga004.jf.intel.com ([10.7.209.38]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Apr 2020 09:33:41 -0700 IronPort-SDR: kmUWphvJTjDL7orliCSGhw8YRA2jl9tI378l2AIMgVhiG8eqBMGDgr5id/vz2PRewwbev8BkwY T716XmLtoX6Q== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.72,359,1580803200"; d="scan'208";a="398252361" Received: from otc-nc-03.jf.intel.com (HELO otc-nc-03) ([10.54.39.25]) by orsmga004.jf.intel.com with ESMTP; 08 Apr 2020 09:33:41 -0700 Date: Wed, 8 Apr 2020 09:33:40 -0700 From: "Raj, Ashok" To: Alex Williamson Cc: "Tian, Kevin" , "Liu, Yi L" , "eric.auger@redhat.com" , "jacob.jun.pan@linux.intel.com" , "joro@8bytes.org" , "Tian, Jun J" , "Sun, Yi Y" , "jean-philippe@linaro.org" , "peterx@redhat.com" , "iommu@lists.linux-foundation.org" , "kvm@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "Wu, Hao" , Bjorn Helgaas , Don Dutile , Ashok Raj Subject: Re: [PATCH v1 2/2] vfio/pci: Emulate PASID/PRI capability for VFs Message-ID: <20200408163340.GA10902@otc-nc-03> References: <1584880394-11184-1-git-send-email-yi.l.liu@intel.com> <1584880394-11184-3-git-send-email-yi.l.liu@intel.com> <20200402165954.48d941ee@w520.home> <20200403112545.6c115ba3@w520.home> <20200407095801.648b1371@w520.home> <20200408040021.GS67127@otc-nc-03> <20200408101940.3459943d@w520.home> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200408101940.3459943d@w520.home> User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Alex On Wed, Apr 08, 2020 at 10:19:40AM -0600, Alex Williamson wrote: > On Tue, 7 Apr 2020 21:00:21 -0700 > "Raj, Ashok" wrote: > > > Hi Alex > > > > + Bjorn > > + Don > > > FWIW I can't understand why PCI SIG went different ways with ATS, > > where its enumerated on PF and VF. But for PASID and PRI its only > > in PF. > > > > I'm checking with our internal SIG reps to followup on that. > > > > On Tue, Apr 07, 2020 at 09:58:01AM -0600, Alex Williamson wrote: > > > > Is there vendor guarantee that hidden registers will locate at the > > > > same offset between PF and VF config space? > > > > > > I'm not sure if the spec really precludes hidden registers, but the > > > fact that these registers are explicitly outside of the capability > > > chain implies they're only intended for device specific use, so I'd say > > > there are no guarantees about anything related to these registers. > > > > As you had suggested in the other thread, we could consider > > using the same offset as in PF, but even that's a better guess > > still not reliable. > > > > The other option is to maybe extend driver ops in the PF to expose > > where the offsets should be. Sort of adding the quirk in the > > implementation. > > > > I'm not sure how prevalent are PASID and PRI in VF devices. If SIG is resisting > > making VF's first class citizen, we might ask them to add some verbiage > > to suggest leave the same offsets as PF open to help emulation software. > > Even if we know where to expose these capabilities on the VF, it's not > clear to me how we can actually virtualize the capability itself. If > the spec defines, for example, an enable bit as r/w then software that > interacts with that register expects the bit is settable. There's no > protocol for "try to set the bit and re-read it to see if the hardware > accepted it". Therefore a capability with a fixed enable bit > representing the state of the PF, not settable by the VF, is > disingenuous to the spec. > > If what we're trying to do is expose that PASID and PRI are enabled on > the PF to a VF driver, maybe duplicating the PF capabilities on the VF > without the ability to control it is not the right approach. Maybe we > need new capabilities exposing these as slave features that cannot be > controlled? We could define our own vendor capability for this, but of The other option is to say, VFIO would never emulate these fake capablities. If exposing a VF with PASID/PRI is required the PF driver would simply wrap it into a VDCM like model which we do today for Scalable IOV devices. So PF handles all aspects of this interface. I also like the suggestion you propose, maybe an offset where these capabilities are exposed to VF's. Maybe have an architected DEVCAPx which exposes these RO capabilities. No control, and the offset should be preserved by the SIG, so VMM can have a safe place to stash them. > course we have both the where to put it in config space issue, as well > as the issue of trying to push an ad-hoc standard. vfio could expose > these as device features rather than emulating capabilities, but that > still leaves a big gap between vfio in the hypervisor and the driver in > the guest VM. That might still help push the responsibility and policy > for how to expose it to the VM as a userspace problem though. > > I agree though, I don't know why the SIG would preclude implementing > per VF control of these features. Thanks, Even if we ask SIG for clarification, it might affect today's devices So might not be useful to solve our current situation. Ashok