[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <8113cba8-62b9-1801-7a77-f82be223b183@deltatee.com>
Date: Thu, 10 May 2018 11:15:44 -0600
From: Logan Gunthorpe <logang@...tatee.com>
To: Stephen Bates <sbates@...thlin.com>,
Christian König <christian.koenig@....com>,
Jerome Glisse <jglisse@...hat.com>
Cc: Alex Williamson <alex.williamson@...hat.com>,
Bjorn Helgaas <helgaas@...nel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"linux-pci@...r.kernel.org" <linux-pci@...r.kernel.org>,
"linux-nvme@...ts.infradead.org" <linux-nvme@...ts.infradead.org>,
"linux-rdma@...r.kernel.org" <linux-rdma@...r.kernel.org>,
"linux-nvdimm@...ts.01.org" <linux-nvdimm@...ts.01.org>,
"linux-block@...r.kernel.org" <linux-block@...r.kernel.org>,
Christoph Hellwig <hch@....de>, Jens Axboe <axboe@...nel.dk>,
Keith Busch <keith.busch@...el.com>,
Sagi Grimberg <sagi@...mberg.me>,
Bjorn Helgaas <bhelgaas@...gle.com>,
Jason Gunthorpe <jgg@...lanox.com>,
Max Gurtovoy <maxg@...lanox.com>,
Dan Williams <dan.j.williams@...el.com>,
Benjamin Herrenschmidt <benh@...nel.crashing.org>
Subject: Re: [PATCH v4 04/14] PCI/P2PDMA: Clear ACS P2P flags for all devices
behind switches
On 10/05/18 11:11 AM, Stephen Bates wrote:
>> Not to me. In the p2pdma code we specifically program DMA engines with
>> the PCI bus address.
>
> Ah yes of course. Brain fart on my part. We are not programming the P2PDMA initiator with an IOVA but with the PCI bus address...
>
>> So regardless of whether we are using the IOMMU or
>> not, the packets will be forwarded directly to the peer. If the ACS
>> Redir bits are on they will be forced back to the RC by the switch and
>> the transaction will fail. If we clear the ACS bits, the TLPs will go
>> where we want and everything will work (but we lose the isolation of ACS).
>
> Agreed.
>
>> For EPs that support ATS, we should (but don't necessarily have to)
>> program them with the IOVA address so they can go through the
>> translation process which will allow P2P without disabling the ACS Redir
>> bits -- provided the ACS direct translation bit is set. (And btw, if it
>> is, then we lose the benefit of ACS protecting against malicious EPs).
>> But, per above, the ATS transaction should involve only the IOVA address
>> so the ACS bits not being set should not break ATS.
>
> Well we would still have to clear some ACS bits but now we can clear only for translated addresses.
We don't have to clear the ACS Redir bits as we did in the first case.
We just have to make sure the ACS Direct Translated bit is set.
Logan
Powered by blists - more mailing lists