[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <BN9PR11MB52762264B58BA63D81F50F3E8CDB9@BN9PR11MB5276.namprd11.prod.outlook.com>
Date: Tue, 7 Feb 2023 00:41:16 +0000
From: "Tian, Kevin" <kevin.tian@...el.com>
To: Jacob Pan <jacob.jun.pan@...ux.intel.com>,
Baolu Lu <baolu.lu@...ux.intel.com>
CC: LKML <linux-kernel@...r.kernel.org>,
"iommu@...ts.linux.dev" <iommu@...ts.linux.dev>,
Joerg Roedel <joro@...tes.org>,
David Woodhouse <dwmw2@...radead.org>,
"Raj, Ashok" <ashok.raj@...el.com>,
"Liu, Yi L" <yi.l.liu@...el.com>,
"stable@...r.kernel.org" <stable@...r.kernel.org>,
"Ghorai, Sukumar" <sukumar.ghorai@...el.com>
Subject: RE: [PATCH] iommu/vt-d: Fix PASID directory pointer coherency
> From: Jacob Pan <jacob.jun.pan@...ux.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().
Powered by blists - more mailing lists