Messages in this thread | ![/](/images/icornerl.gif) | | From | "Tian, Kevin" <> | Subject | RE: [PATCH v2 2/2] iommu/vt-d: Fix NULL domain on device release | Date | Mon, 4 Mar 2024 08:59:37 +0000 |
| |
> From: Baolu Lu <baolu.lu@linux.intel.com> > Sent: Monday, March 4, 2024 4:07 PM > > On 2024/3/4 15:36, Tian, Kevin wrote: > >> From: Lu Baolu <baolu.lu@linux.intel.com> > >> Sent: Thursday, February 29, 2024 5:46 PM > >> > >> + > >> +/* > >> + * Cache invalidation for changes to a scalable-mode context table > >> + * entry. > >> + * > >> + * Section 6.5.3.3 of the VT-d spec: > >> + * - Device-selective context-cache invalidation; > >> + * - Domain-selective PASID-cache invalidation to affected domains > >> + * (can be skipped if all PASID entries were not-present); > >> + * - Domain-selective IOTLB invalidation to affected domains; > > > > the spec talks about domain-selective but the code actually does > > global invalidation. > > I should have included the following comments below: > > /* Given that we have no idea about which domain IDs and PASIDs were > * used in the pasid table, upgrade them to global PASID and IOTLB > * cache invalidation. This doesn't impact the performance significantly > * as the clearing context entry is not a critical path. > */ >
but then it affects all other perf-critical paths which rely on the cache for other devices...
It's preferable to restrict overhead to this release path only e.g. walking the PASID table to identify affected DIDs and PASIDs instead of expanding the impact to system wide.
| ![\](/images/icornerr.gif) |