lkml.org 
[lkml]   [2023]   [Feb]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRE: [PATCH] iommu/vt-d: Fix PASID directory pointer coherency
Date
> From: Jacob Pan <jacob.jun.pan@linux.intel.com>
> Sent: Tuesday, February 7, 2023 1:25 AM
>
> > > @@ -1976,6 +1976,12 @@ static int
> domain_context_mapping_one(struct
> > > dmar_domain *domain, pds = context_get_sm_pds(table);
> > > context->lo = (u64)virt_to_phys(table->table) |
> > > context_pdts(pds);
> > > + /*
> > > + * Scalable-mode PASID directory pointer is not
> > > snooped if the
> > > + * coherent bit is not set.
> > > + */
> > > + if (!ecap_coherent(iommu->ecap))
> > > + clflush_cache_range(table->table, sizeof(void
> > > *));
> >
> > This isn't comprehensive. The clflush should be called whenever the
> > pasid directory table is allocated or updated.
> >
> allocate a pasid table does not mean it gets used by iommu hw, not until it
> is programmed into context entry.
>

this is insufficient.

Even after this point the PASID directory entry could be changed when
a new PASID table is allocated, e.g. in intel_pasid_get_entry().

\
 
 \ /
  Last update: 2023-03-27 00:11    [W:1.952 / U:0.620 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site