Re: [PATCH 1/5] iommu: Add mm_get_pasid() helper function

From: Baolu Lu
Date: Tue Aug 08 2023 - 20:31:28 EST


On 2023/8/8 23:02, Jason Gunthorpe wrote:
On Tue, Aug 08, 2023 at 03:49:40PM +0800, Tina Zhang wrote:
mm_get_pasid() is for getting mm pasid value.

The motivation is to replace mm->pasid with an iommu private data
structure that is introduced in a later patch.
Maybe we should start out by calling it what it actually is:

'mm_get_enqcmd_pasid()'

We can't actually have multiple SVA domains with different PASIDs
until the places wrongly calling this are removed :\

eg, I would expect this series to also come with removing
'pasid_private' from the Intel driver.

The mmu_notifier should be placed in the singular iommu_domain that is
the SVA domain for the mm. Drivers should not attempt to de-duplicate
this, the core code will do it like you are showing in this series.

The two tasks mentioned above are part of our plan. They will be
conducted in stages, which is more conducive to review and testing.
This series is just the beginning.

Best regards,
baolu