lkml.org 
[lkml]   [2023]   [May]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v7 3/4] iommu/vt-d: Add set_dev_pasid callback for dma domain
> > +	/*
> > + * The SVA implementation needs to stop mm notification, drain the
> > + * pending page fault requests before tearing down the pasid entry.
> > + * The VT-d spec (section 6.2.3.1) also recommends that software
> > + * could use a reserved domain id for all first-only and pass-through
> > + * translations. Hence there's no need to call
> > domain_detach_iommu()
> > + * in the sva domain case.
> > + */
>
> It's probably clearer to say:

Is this what is going on ??

> /*
> * SVA domain requires special treatment before tearing down the pasid
> * entry:
> * 1) pasid is stored in mm instead of in dev_pasid;

Why? The mm pasid should not be used by any driver code, the PASID the
SVA is hooked to does NOT have to be the mm PASID.

> * 2) all SVA domains share a reserved domain id per recommendation
> * from VT-d spec (section 6.2.3.1) so domain_detach_iommu() is
> * not required;

The DID should be managed and allocated for the S2 pointer and the
flushing logic should work genericly by tracking the S2's being used
and flushing their DIDs when all the S2s fall out of use. The special
identity S2 just gets a static DID that never falls out of use.

Jason

\
 
 \ /
  Last update: 2023-05-30 19:09    [W:0.148 / U:2.076 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site