lkml.org 
[lkml]   [2022]   [Jul]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRE: [PATCH v10 08/12] iommu/sva: Refactoring iommu_sva_bind/unbind_device()
Date
> From: Jean-Philippe Brucker <jean-philippe@linaro.org>
> Sent: Monday, July 25, 2022 3:39 PM
>
> On Sun, Jul 24, 2022 at 09:48:15PM +0800, Baolu Lu wrote:
> > /*
> > * iommu_detach_device_pasid() - Detach the domain from pasid of device
> > * @domain: the iommu domain.
> > * @dev: the attached device.
> > * @pasid: the pasid of the device.
> > *
> > * The @domain must have been attached to @pasid of the @dev with
> > * iommu_detach_device_pasid().
> > */
> > void iommu_detach_device_pasid(struct iommu_domain *domain, struct
> device
> > *dev,
> > ioasid_t pasid)
> > {
> > struct iommu_group *group = iommu_group_get(dev);
> > struct group_pasid *param;
> >
> > mutex_lock(&group->mutex);
> > domain->ops->set_dev_pasid(group->blocking_domain, dev, pasid);
>
> Please also pass the old domain to this detach() function, so that the
> IOMMU driver doesn't have to keep track of them internally.

The old domain is already tracked in group->pasid_xarray and can
be retrieved using [dev, pasid].

>
> In addition to clearing contexts, detach() also needs to invalidate TLBs,
> and for that the SMMU driver needs to know the old ASID (!= PASID) that
> was used by the context descriptor.
>

Presumably both ASID and context descriptor are SMMU internal
knowledge. What exact information is required from the core API
and how is it done today?

\
 
 \ /
  Last update: 2022-07-25 10:05    [W:0.141 / U:0.292 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site