Re: [PATCH] PCI/P2PDMA: Root complex whitelist should not apply when an IOMMU is present

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxx> 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





[Index of Archives]     [DMA Engine]     [Linux Coverity]     [Linux USB]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Greybus]

  Powered by Linux