From: Jason Gunthorpe <jgg@nvidia.com>
To: Jean-Philippe Brucker <jean-philippe@linaro.org>
Cc: Jacob Pan <jacob.jun.pan@linux.intel.com>,
LKML <linux-kernel@vger.kernel.org>,
iommu@lists.linux.dev, Lu Baolu <baolu.lu@linux.intel.com>,
Joerg Roedel <joro@8bytes.org>,
Jean-Philippe Brucker <jean-philippe@linaro.com>,
Robin Murphy <robin.murphy@arm.com>,
David Woodhouse <dwmw2@infradead.org>,
Raj Ashok <ashok.raj@intel.com>,
"Tian, Kevin" <kevin.tian@intel.com>, Yi Liu <yi.l.liu@intel.com>
Subject: Re: [PATCH 2/2] iommu/ioasid: Remove custom IOASID allocator
Date: Mon, 13 Feb 2023 15:48:25 -0400 [thread overview]
Message-ID: <Y+qUCTGEOOeV4rua@nvidia.com> (raw)
In-Reply-To: <Y+qP0q9U0J2UfIxX@myrica>
On Mon, Feb 13, 2023 at 07:30:26PM +0000, Jean-Philippe Brucker wrote:
> On Mon, Feb 13, 2023 at 10:34:55AM -0800, Jacob Pan wrote:
> > > On a related note, it looks like 100b8a14a370 ("iommu/vt-d: Add pasid
> > > private data helpers") removed the last user of ioasid_set_data(). I guess
> > > that could be dropped too, unless you plan to still use it?
> > >
> > You are right, will remove.
> > I was planning on the other way around which will convert VT-d's private
> > pasid data helpers to common ioasid code, but when I look closer the
> > private pasid xa is just holding a list of pasid/mm which could be per iommu
> > not global. Another cleanup I suppose.
>
> Yes that should probably be common to SVA. I'm planning to take another
> look at SVA on the SMMU side following the recent API changes, and from a
> quick glance the problem that VT-d's private helpers solves is
> common.
I think there is something really wrong that the drivers are somehow
tied to the mm_struct in some deep way.
The flow should have the SVA iommu_domain be created and associated
with a mm_struct in the driver.
At this instant the iommu_domain should extract the top of page table
from the mm_struct and from then on the driver never touches the
mm_struct again. The top of page table is just like any other
iommu_domain except it isn't mappable and it isn't allocated/freed.
The driver will establish a mmu_notifier in the driver's private
iommu_domain space to capture invalidations.
Page fault is handled via common code
Any invalidations act exactly like any other invalidation - the driver
goes through all the cache tags associated with the iommu_domain and
cleans them.
What have I missed that requires more common code or tracking a list
of pasid/mm?
PASID attachment and invalidation is general, and has nothing to do
with SVA.
If the core code provies help for anything it should be to help the
driver keep track of what cache tags are linked to which iommu_domain.
The comingling of SVA and PASID has made a big mess in the drivers we
need to unwind.
Jason
next prev parent reply other threads:[~2023-02-13 19:48 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-02-10 23:02 [PATCH 0/2] Remove VT-d virtual command interface Jacob Pan
2023-02-10 23:02 ` [PATCH 1/2] iommu/vt-d: Remove " Jacob Pan
2023-02-13 2:54 ` Tian, Kevin
2023-02-13 23:19 ` Jason Gunthorpe
2023-02-10 23:02 ` [PATCH 2/2] iommu/ioasid: Remove custom IOASID allocator Jacob Pan
2023-02-13 3:14 ` Tian, Kevin
2023-02-13 16:20 ` Jean-Philippe Brucker
2023-02-13 16:24 ` Jason Gunthorpe
2023-02-13 19:11 ` Jacob Pan
2023-02-13 19:42 ` Jason Gunthorpe
2023-02-13 18:34 ` Jacob Pan
2023-02-13 19:30 ` Jean-Philippe Brucker
2023-02-13 19:48 ` Jason Gunthorpe [this message]
2023-02-13 19:39 ` Jason Gunthorpe
2023-02-13 21:44 ` Jacob Pan
2023-02-13 23:18 ` Jason Gunthorpe
2023-02-13 23:43 ` Jacob Pan
2023-02-13 23:45 ` Jason Gunthorpe
2023-02-14 6:26 ` Tian, Kevin
2023-02-14 14:56 ` Jason Gunthorpe
2023-02-15 1:39 ` Tian, Kevin
2023-02-13 2:52 ` [PATCH 0/2] Remove VT-d virtual command interface Tian, Kevin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=Y+qUCTGEOOeV4rua@nvidia.com \
--to=jgg@nvidia.com \
--cc=ashok.raj@intel.com \
--cc=baolu.lu@linux.intel.com \
--cc=dwmw2@infradead.org \
--cc=iommu@lists.linux.dev \
--cc=jacob.jun.pan@linux.intel.com \
--cc=jean-philippe@linaro.com \
--cc=jean-philippe@linaro.org \
--cc=joro@8bytes.org \
--cc=kevin.tian@intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=robin.murphy@arm.com \
--cc=yi.l.liu@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox