[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <4bee4885-3e30-4376-947e-eae881e757d7@linux.intel.com>
Date: Mon, 16 Jun 2025 14:25:26 +0800
From: Baolu Lu <baolu.lu@...ux.intel.com>
To: Nicolin Chen <nicolinc@...dia.com>, jgg@...dia.com, kevin.tian@...el.com,
corbet@....net, will@...nel.org
Cc: bagasdotme@...il.com, robin.murphy@....com, joro@...tes.org,
thierry.reding@...il.com, vdumpa@...dia.com, jonathanh@...dia.com,
shuah@...nel.org, jsnitsel@...hat.com, nathan@...nel.org,
peterz@...radead.org, yi.l.liu@...el.com, mshavit@...gle.com,
praan@...gle.com, zhangzekun11@...wei.com, iommu@...ts.linux.dev,
linux-doc@...r.kernel.org, linux-kernel@...r.kernel.org,
linux-arm-kernel@...ts.infradead.org, linux-tegra@...r.kernel.org,
linux-kselftest@...r.kernel.org, patches@...ts.linux.dev, mochs@...dia.com,
alok.a.tiwari@...cle.com, vasant.hegde@....com, dwmw2@...radead.org
Subject: Re: [PATCH v6 06/25] iommufd/access: Allow access->ops to be NULL for
internal use
On 6/14/25 15:14, Nicolin Chen wrote:
> The access object has been used externally by VFIO mdev devices, allowing
> them to pin/unpin physical pages (via needs_pin_pages). Meanwhile, a racy
> unmap can occur in this case, so these devices usually implement an unmap
> handler, invoked by iommufd_access_notify_unmap().
>
> The new HW queue object will need the same pin/unpin feature, although it
> (unlike the mdev case) wants to reject any unmap attempt, during its life
> cycle.
>
> To reuse the access object for the new HW queue, allow its access->ops to
> be NULL. Error out a NULL access->ops in iommufd_access_notify_unmap() to
> reject an unmap operation and propagatethe errno upwards.
>
> Then, update iommufd_access_change_ioas() and iommufd_access_pin_pages(),
> to allow this new use case.
>
> Suggested-by: Jason Gunthorpe<jgg@...dia.com>
> Signed-off-by: Nicolin Chen<nicolinc@...dia.com>
Reviewed-by: Lu Baolu <baolu.lu@...ux.intel.com>
Powered by blists - more mailing lists