linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Baolu Lu <baolu.lu@linux.intel.com>
To: Jason Gunthorpe <jgg@nvidia.com>
Cc: baolu.lu@linux.intel.com, Joerg Roedel <joro@8bytes.org>,
	Christoph Hellwig <hch@infradead.org>,
	Bjorn Helgaas <bhelgaas@google.com>,
	Kevin Tian <kevin.tian@intel.com>,
	Ashok Raj <ashok.raj@intel.com>, Will Deacon <will@kernel.org>,
	Robin Murphy <robin.murphy@arm.com>,
	Jean-Philippe Brucker <jean-philippe@linaro.com>,
	Dave Jiang <dave.jiang@intel.com>, Vinod Koul <vkoul@kernel.org>,
	Eric Auger <eric.auger@redhat.com>, Liu Yi L <yi.l.liu@intel.com>,
	Jacob jun Pan <jacob.jun.pan@intel.com>,
	Zhangfei Gao <zhangfei.gao@linaro.org>,
	Zhu Tony <tony.zhu@intel.com>,
	iommu@lists.linux.dev, linux-pci@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v11 04/13] PCI: Allow PASID only when ACS enforced on upstreaming path
Date: Tue, 23 Aug 2022 15:10:00 +0800	[thread overview]
Message-ID: <2ac74c62-1e2a-3758-6da8-a59f452e7799@linux.intel.com> (raw)
In-Reply-To: <Yv440MU1UeD9u67g@nvidia.com>

On 2022/8/18 21:04, Jason Gunthorpe wrote:
> On Wed, Aug 17, 2022 at 09:20:15AM +0800, Lu Baolu wrote:
>> Some configurations of the PCI fabric will route device originated TLP
>> packets based on the memory addresses. These configurations are
>> incompatible with PASID as the PASID packets form a distinct address
>> space. For instance, any configuration where switches are present
>> without ACS enabled is incompatible.
>>
>> This enhances the pci_enable_pasid() interface by requiring the ACS to
>> support Source Validation, Request Redirection, Completer Redirection,
>> and Upstream Forwarding. This effectively means that devices cannot
>> spoof their requester ID, requests and completions cannot be redirected,
>> and all transactions are forwarded upstream, even as it passes through a
>> bridge where the target device is downstream.
>>
>> Suggested-by: Jason Gunthorpe<jgg@nvidia.com>
>> Suggested-by: Kevin Tian<kevin.tian@intel.com>
>> Signed-off-by: Lu Baolu<baolu.lu@linux.intel.com>
>> ---
>>   drivers/pci/ats.c | 5 +++++
>>   1 file changed, 5 insertions(+)
>>
>> diff --git a/drivers/pci/ats.c b/drivers/pci/ats.c
>> index c967ad6e2626..0715e48e7973 100644
>> --- a/drivers/pci/ats.c
>> +++ b/drivers/pci/ats.c
>> @@ -382,6 +382,11 @@ int pci_enable_pasid(struct pci_dev *pdev, int features)
>>   	if (!pasid)
>>   		return -EINVAL;
>>   
>> +	if (!pci_acs_path_enabled(pdev, NULL,
>> +				  PCI_ACS_SV | PCI_ACS_RR |
>> +				  PCI_ACS_CR | PCI_ACS_UF))
> I think we only need RR and UF here?
> 
> Source Validation causes the switch to validate the requestor RID in
> each TLP which has nothing to do with address based routing
> 
> Completion Redirect changes how RID routing works, and has nothing to
> do with address based routing.
> 
> Yes, both of those are usually set for virtualization scenarios but we
> shouldn't check it here as a basic requirement to enable PASID.

Yes. Here only requires RR and UF.

Best regards,
baolu

  reply	other threads:[~2022-08-23  7:10 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-17  1:20 [PATCH v11 00/13] iommu: SVA and IOPF refactoring Lu Baolu
2022-08-17  1:20 ` [PATCH v11 01/13] iommu: Add max_pasids field in struct iommu_device Lu Baolu
2022-08-17  1:20 ` [PATCH v11 02/13] iommu: Add max_pasids field in struct dev_iommu Lu Baolu
2022-08-17  1:20 ` [PATCH v11 03/13] iommu: Remove SVM_FLAG_SUPERVISOR_MODE support Lu Baolu
2022-08-17  1:20 ` [PATCH v11 04/13] PCI: Allow PASID only when ACS enforced on upstreaming path Lu Baolu
2022-08-17 21:17   ` Bjorn Helgaas
2022-08-17 22:48     ` Jason Gunthorpe
2022-08-18 11:55       ` Baolu Lu
2022-08-18 11:53     ` Baolu Lu
2022-08-18 23:00       ` Bjorn Helgaas
2022-08-22  7:43         ` Ethan Zhao
2022-08-23  7:05         ` Baolu Lu
2022-08-24 16:23           ` Bjorn Helgaas
2022-08-18 13:04   ` Jason Gunthorpe
2022-08-23  7:10     ` Baolu Lu [this message]
2022-08-17  1:20 ` [PATCH v11 05/13] iommu: Add attach/detach_dev_pasid iommu interface Lu Baolu
2022-08-18 13:33   ` Jason Gunthorpe
2022-08-23  7:30     ` Baolu Lu
2022-08-17  1:20 ` [PATCH v11 06/13] iommu: Add IOMMU SVA domain support Lu Baolu
2022-08-17  1:20 ` [PATCH v11 07/13] iommu/vt-d: Add " Lu Baolu
2022-08-18 13:36   ` Jason Gunthorpe
2022-08-23  7:33     ` Baolu Lu
2022-08-17  1:20 ` [PATCH v11 08/13] arm-smmu-v3/sva: " Lu Baolu
2022-08-17  1:20 ` [PATCH v11 09/13] iommu/sva: Refactoring iommu_sva_bind/unbind_device() Lu Baolu
2022-08-18 13:41   ` Jason Gunthorpe
2022-08-23 10:12     ` Baolu Lu
2022-08-17  1:20 ` [PATCH v11 10/13] iommu: Remove SVA related callbacks from iommu ops Lu Baolu
2022-08-17  1:20 ` [PATCH v11 11/13] iommu: Prepare IOMMU domain for IOPF Lu Baolu
2022-08-17  1:20 ` [PATCH v11 12/13] iommu: Per-domain I/O page fault handling Lu Baolu
2022-08-17  1:20 ` [PATCH v11 13/13] iommu: Rename iommu-sva-lib.{c,h} Lu Baolu
2022-08-22  4:49 ` [PATCH v11 00/13] iommu: SVA and IOPF refactoring Zhangfei Gao
2022-08-23  7:00   ` Baolu Lu
2022-08-26  4:17 ` Baolu Lu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=2ac74c62-1e2a-3758-6da8-a59f452e7799@linux.intel.com \
    --to=baolu.lu@linux.intel.com \
    --cc=ashok.raj@intel.com \
    --cc=bhelgaas@google.com \
    --cc=dave.jiang@intel.com \
    --cc=eric.auger@redhat.com \
    --cc=hch@infradead.org \
    --cc=iommu@lists.linux.dev \
    --cc=jacob.jun.pan@intel.com \
    --cc=jean-philippe@linaro.com \
    --cc=jgg@nvidia.com \
    --cc=joro@8bytes.org \
    --cc=kevin.tian@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=robin.murphy@arm.com \
    --cc=tony.zhu@intel.com \
    --cc=vkoul@kernel.org \
    --cc=will@kernel.org \
    --cc=yi.l.liu@intel.com \
    --cc=zhangfei.gao@linaro.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).