lkml.org 
[lkml]   [2023]   [Jul]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectRe: [PATCH v2 1/2] iommu: Prevent RESV_DIRECT devices from blocking domains
On Fri, Jul 21, 2023 at 03:07:47AM +0000, Tian, Kevin wrote:
> > @@ -974,13 +972,17 @@ static int
> > iommu_create_device_direct_mappings(struct iommu_domain *domain,
> > dma_addr_t start, end, addr;
> > size_t map_size = 0;
> >
> > + if (entry->type == IOMMU_RESV_DIRECT)
> > + dev->iommu->requires_direct = 1;
> > +
> > + if ((entry->type != IOMMU_RESV_DIRECT &&
> > + entry->type != IOMMU_RESV_DIRECT_RELAXABLE) ||
> > + !iommu_is_dma_domain(domain))
> > + continue;
>
> piggybacking a device attribute detection in a function which tries to
> populate domain mappings is a bit confusing.

It is, but to do otherwise we'd want to have the caller obtain the
reserved regions list and iterate it twice. Not sure it is worth the
trouble right now.

Jason

\
 
 \ /
  Last update: 2023-07-21 17:12    [W:0.058 / U:24.360 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site