[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20230207100918.73df2f32@jacob-builder>
Date: Tue, 7 Feb 2023 10:09:18 -0800
From: Jacob Pan <jacob.jun.pan@...ux.intel.com>
To: "Tian, Kevin" <kevin.tian@...el.com>
Cc: Baolu Lu <baolu.lu@...ux.intel.com>,
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>,
jacob.jun.pan@...ux.intel.com
Subject: Re: [PATCH] iommu/vt-d: Fix PASID directory pointer coherency
Hi Kevin,
On Tue, 7 Feb 2023 00:41:16 +0000, "Tian, Kevin" <kevin.tian@...el.com>
wrote:
> > 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().
>
you are right, will include updates in v2.
Thanks,
Jacob
Powered by blists - more mailing lists