lkml.org 
[lkml]   [2021]   [Jul]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH 18/23] iommu: Express DMA strictness via the domain type
From
Date
On 2021-07-26 13:29, Lu Baolu wrote:
[...]
>>>> diff --git a/drivers/iommu/dma-iommu.c b/drivers/iommu/dma-iommu.c
>>>> index b1af1ff324c5..a114a7ad88ec 100644
>>>> --- a/drivers/iommu/dma-iommu.c
>>>> +++ b/drivers/iommu/dma-iommu.c
>>>> @@ -363,13 +363,15 @@ static int iommu_dma_init_domain(struct
>>>> iommu_domain *domain, dma_addr_t base,
>>>>       init_iova_domain(iovad, 1UL << order, base_pfn);
>>>> -    if (!cookie->fq_domain && !dev_is_untrusted(dev) &&
>>>> -        domain->ops->flush_iotlb_all &&
>>>> !iommu_get_dma_strict(domain)) {
>>>> +    if (domain->type == IOMMU_DOMAIN_DMA_FQ && !cookie->fq_domain &&
>>>> +        domain->ops->flush_iotlb_all) {
>
> Perhaps we can remove the ops->flush_iotlb_all check with the
> assumption that any vendor iommu driver with DMA_FQ domain support
> should always provides this callback?

Oh yes, indeed it wouldn't make sense for a driver to claim
IOMMU_DOMAIN_DMA_FQ support but not implement the one thing that that
needs the driver to provide. That's yet another neat little cleanup, thanks!

Robin.

\
 
 \ /
  Last update: 2021-07-26 14:44    [W:0.143 / U:6.724 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site