linux-pci.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Koenig, Christian" <Christian.Koenig@amd.com>
To: Logan Gunthorpe <logang@deltatee.com>,
	Bjorn Helgaas <helgaas@kernel.org>
Cc: "linux-pci@vger.kernel.org" <linux-pci@vger.kernel.org>
Subject: Re: [PATCH] PCI/P2PDMA: Root complex whitelist should not apply when an IOMMU is present
Date: Wed, 19 Jun 2019 09:26:42 +0000	[thread overview]
Message-ID: <49c98e2d-1daf-426c-5ccb-0ee3ab3f89c6@amd.com> (raw)
In-Reply-To: <71daf07c-f1a4-806c-a24d-80e97aef19d0@deltatee.com>

Am 19.06.19 um 01:50 schrieb Logan Gunthorpe:
>
> On 2019-06-18 2:51 p.m., Logan Gunthorpe wrote:
>> On 2019-06-18 2:40 p.m., Bjorn Helgaas wrote:
>>> On Wed, May 22, 2019 at 02:12:52PM -0600, Logan Gunthorpe wrote:
>>>> Presently, there is no path to DMA map P2PDMA memory, so if a TLP
>>>> targeting this memory hits the root complex and an IOMMU is present,
>>>> the IOMMU will reject the transaction, even if the RC would support
>>>> P2PDMA.
>>>>
>>>> So until the kernel knows to map these DMA addresses in the IOMMU,
>>>> we should not enable the whitelist when an IOMMU is present.
>>>>
>>>> While we are at it, remove the comment mentioning future work
>>>> to add a white list.
>>> There was a lot of discussion about this.  Did everybody come to a
>>> consensus about what should be done?  Can you post a patch with
>>> reviewed-by if appropriate?
>> I think we have consensus that it's broken and needs to be fixed for the
>> short term. Preferably before 5.3.

Yeah, completely agree.

>> I'm not sure we have consensus on the
>> proper fix.
>>
>> The two easy things I can see to do is to either revert it or add the
>> iommu_is_present() check that I did in the above patch.
>>
>> @Christian, which do you prefer? I think I'd prefer the
>> iommu_is_present() route as it maintains the information about
>> white-listed devices and is easier to change once we have the correct
>> solution.

Your original iommu_is_prevent() patch sound like the best option so far.

If that hasn't changed feel free to add a Reviewed-by: Christian König 
<christian.koenig@amd.com> to that one.

>> I can send a patch tomorrow one way or another.
> Also, looks like one of my clients has an interest in seeing work like
> this happen. So I'll be writing some patches in the next couple weeks to
> do this properly. I'll try to send them to the lists early next cycle.

Oh, nice.

I was hoping to get my use case into 5.4 or 5.5, but we are still stuck 
with some of the DMA-buf related pieces.

Regards,
Christian.

>
> Logan


  reply	other threads:[~2019-06-19  9:26 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-22 20:12 [PATCH] PCI/P2PDMA: Root complex whitelist should not apply when an IOMMU is present Logan Gunthorpe
2019-06-18 20:40 ` Bjorn Helgaas
2019-06-18 20:51   ` Logan Gunthorpe
2019-06-18 23:50     ` Logan Gunthorpe
2019-06-19  9:26       ` Koenig, Christian [this message]
2019-06-19  9:29         ` Christoph Hellwig
2019-06-19  9:39           ` Koenig, Christian
     [not found] <a98bff67-a76e-4ddc-a317-96f2bdc9af72@email.android.com>
2019-05-22 20:41 ` Logan Gunthorpe
2019-05-23  8:12   ` Koenig, Christian
2019-05-23  9:43     ` Christoph Hellwig
2019-05-23  9:48       ` Koenig, Christian
2019-05-23  9:50         ` Christoph Hellwig
2019-05-23 10:06           ` Koenig, Christian
2019-05-23 10:26             ` Christoph Hellwig
2019-05-23 15:59               ` Logan Gunthorpe
2019-05-23 15:53           ` Logan Gunthorpe
2019-05-23 15:59             ` Christoph Hellwig
2019-05-24 12:40               ` Koenig, Christian
2019-05-24 14:12                 ` Christoph Hellwig
2019-05-24 16:18                   ` Logan Gunthorpe
2019-05-24 16:06                 ` Logan Gunthorpe
2019-05-23 16:14         ` Logan Gunthorpe
2019-05-23 15:47     ` Logan Gunthorpe

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=49c98e2d-1daf-426c-5ccb-0ee3ab3f89c6@amd.com \
    --to=christian.koenig@amd.com \
    --cc=helgaas@kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=logang@deltatee.com \
    /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).