lkml.org 
[lkml]   [2023]   [Mar]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRE: [PATCH 1/4] iommu/vt-d: Implement set device pasid op for default domain
Date
> From: Baolu Lu <baolu.lu@linux.intel.com>
> Sent: Thursday, March 2, 2023 10:07 PM
> > +
> > + if (!sm_supported(iommu) || !info)
>
> @info has been referenced. !info check makes no sense.
>
> Add pasid_supported(iommu).
>
> Do you need to check whether the domain is compatible for this rid
> pasid?

what kind of compatibility is concerned here? In concept a pasid
can be attached to any domain if it has been successfully attached
to rid. Probably we can add a check here that RID2PASID must
point to the domain already.

>
> > + return -ENODEV;
> > +
> > + if (WARN_ON(pasid == PASID_RID2PASID))
> > + return -EINVAL;
>
> Add a call to domain_attach_iommu() here to get a refcount of the domain
> ID. And call domain_detach_iommu() in intel_iommu_remove_dev_pasid().
>

Is it necessary? iommu core doesn't allow taking ownership
if !xa_empty(&group->pasid_array) so if this pasid attach succeeds
this device cannot be attached to another domain before pasid
detach is done on the current domain.
\
 
 \ /
  Last update: 2023-03-27 00:42    [W:0.994 / U:0.424 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site