Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp2687900ybb; Sun, 22 Mar 2020 05:29:11 -0700 (PDT) X-Google-Smtp-Source: ADFU+vt2I/SEqJK/u1JbsbNJ4QbGDcGQ1ZtRAs2g/9XtDJaTKowYoMcof5NEDBTVyO0Rhmz9KVTi X-Received: by 2002:aca:b308:: with SMTP id c8mr12614093oif.131.1584880151542; Sun, 22 Mar 2020 05:29:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1584880151; cv=none; d=google.com; s=arc-20160816; b=INGX39DMBnhC4HPGpe95251rG5BMPIfSq6bhwoKRhQMiToD4hTeIfEuJ0DoZ26R6Vz R3TPzp/jN63jAlzD6pSrNbWVeHZ8C207GZOzoN4wPH1/e+bVySQZFMxjtRxCfpaVGalB No51E/Qu8qzD+lxpPROH2rhBbyY2ynLBO4+3bsj8whmAiRhNLaGlfzu6CmLJC/BgKlyf 8u8VxZ1AFtnygZjbKyCKC6N2cFsYHlV0hpo1bT9X8tzSReG7oyzMHLLBHn2SxKKbNZs7 sQTJOr6l0+mZL927xhnWvhDhPcFlGVfKvIV+Xlxql9eWsh47v0bmhdy/cQEzW94qpMKg I/9A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:ironport-sdr:ironport-sdr; bh=s+VQuuNA4dJ6NWJRv7+tUnYAPi4AehsJD1P2p22z1vQ=; b=GREHEAZWUlQl8Vwj72rmJ53v7fim4CM2rZVl/GttVzCz8a+H6FgpduG9fhlXw6utpS 7GOaECXBS43hmn3c9lEiY3XovVP/lKR9iwp0kcUUjLI9YePN8msoTE9DYLb2k5/wike6 XT7GBiKMYFYMZR4GLrTx9lX7F6RQWrmINS+3kNDahXx5x2VgP5rnJgwCtisCHcmHD4Fs l8C10maO3QznZYjt+rmXhqGNkhQOHDEQKTXHUEDYjz/GtPz79c/YIkRJA4rrtlFwx0MN ZvmNg0dMkpXPZxTBDE08urVnB5svjXfhi22p45tnjJE+i2PwT29EYSqq7SuoXTZYpdSV dhFQ== 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 h23si7164407otk.315.2020.03.22.05.28.59; Sun, 22 Mar 2020 05:29:11 -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 S1727028AbgCVM1e (ORCPT + 99 others); Sun, 22 Mar 2020 08:27:34 -0400 Received: from mga14.intel.com ([192.55.52.115]:23953 "EHLO mga14.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727043AbgCVM1d (ORCPT ); Sun, 22 Mar 2020 08:27:33 -0400 IronPort-SDR: RZk2mM5o64gNf2wmRLEQMDAl4zHstOavOESo07JjzkUT950FtTlt9sT+jWun8gSQlXw5UPeNt6 n47y3M7Q+l3Q== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Mar 2020 05:27:32 -0700 IronPort-SDR: JTj7uc0RiWhatZgQOskzWH3SQgaANaBTrPWHGcjeB0aAHqUXXZDrkkbmGHYOeY5sGRaaqQUQso t0QFsS+FgF1g== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.72,292,1580803200"; d="scan'208";a="356846585" Received: from jacob-builder.jf.intel.com ([10.7.199.155]) by fmsmga001.fm.intel.com with ESMTP; 22 Mar 2020 05:27:32 -0700 From: "Liu, Yi L" To: alex.williamson@redhat.com, eric.auger@redhat.com Cc: kevin.tian@intel.com, jacob.jun.pan@linux.intel.com, joro@8bytes.org, ashok.raj@intel.com, yi.l.liu@intel.com, jun.j.tian@intel.com, yi.y.sun@intel.com, jean-philippe@linaro.org, peterx@redhat.com, iommu@lists.linux-foundation.org, kvm@vger.kernel.org, linux-kernel@vger.kernel.org, hao.wu@intel.com Subject: [PATCH v1 1/2] vfio/pci: Expose PCIe PASID capability to guest Date: Sun, 22 Mar 2020 05:33:13 -0700 Message-Id: <1584880394-11184-2-git-send-email-yi.l.liu@intel.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1584880394-11184-1-git-send-email-yi.l.liu@intel.com> References: <1584880394-11184-1-git-send-email-yi.l.liu@intel.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Liu Yi L This patch exposes PCIe PASID capability to guest. Existing vfio_pci driver hides it from guest by setting the capability length as 0 in pci_ext_cap_length[]. This capability is required for vSVA enabling on pass-through PCIe devices. Cc: Kevin Tian CC: Jacob Pan Cc: Alex Williamson Cc: Eric Auger Cc: Jean-Philippe Brucker Signed-off-by: Liu Yi L --- drivers/vfio/pci/vfio_pci_config.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/vfio/pci/vfio_pci_config.c b/drivers/vfio/pci/vfio_pci_config.c index 90c0b80..4b9af99 100644 --- a/drivers/vfio/pci/vfio_pci_config.c +++ b/drivers/vfio/pci/vfio_pci_config.c @@ -95,7 +95,7 @@ static const u16 pci_ext_cap_length[PCI_EXT_CAP_ID_MAX + 1] = { [PCI_EXT_CAP_ID_LTR] = PCI_EXT_CAP_LTR_SIZEOF, [PCI_EXT_CAP_ID_SECPCI] = 0, /* not yet */ [PCI_EXT_CAP_ID_PMUX] = 0, /* not yet */ - [PCI_EXT_CAP_ID_PASID] = 0, /* not yet */ + [PCI_EXT_CAP_ID_PASID] = PCI_EXT_CAP_PASID_SIZEOF, }; /* -- 2.7.4