Re: [RFC PATCH 0/5] vfio/pci: Support ZONE_DEVICE-backed P2P Registration
From: Samiullah Khawaja
Date: Mon Jun 15 2026 - 20:42:59 EST
On Fri, Jun 12, 2026 at 02:50:18PM +0000, Pranjal Shrivastava wrote:
On Thu, Jun 11, 2026 at 07:14:47PM -0300, Jason Gunthorpe wrote:
On Thu, Jun 11, 2026 at 02:40:17PM +0000, Pranjal Shrivastava wrote:
> On Wed, Jun 10, 2026 at 01:28:48PM -0300, Jason Gunthorpe wrote:
> > On Wed, Jun 10, 2026 at 03:18:48PM +0000, Pranjal Shrivastava wrote:
> >
[snip]
Yea, that's going to be tricky.. I'm thinking if we can have a zap model
there somehow? If the device is gone / going through a reset, we can
handle the refcounts accordingly?
IIUC zapping will only work if userspace is using these, but if you feed
this memory into another device through NFS and the pages are pinned by
gup (or that device) then the dmabuf move_notify/revoke logic on device
reset will be tricky as now the pages for that device BAR are pinned.
Come to think of it, since the sysfs API cannot do that in the way
VFIO wants I actually think you can't use it..
Ack. Baking this into the VFIO DMABUF allows us to enforce the right
lifecycle.
My plan for RFC v2 is to add a flag like VFIO_DMA_BUF_FLAG_ZONE_DEVICE
to struct vfio_device_feature_dma_buf which allows the caller to opt-in
to ZONE_DEVICE backing specifically for that export.
Does this opt-in flag sound like a reasonable uAPI or do you see any
concerns with this direction?
Otherwise, as you noted, the lifecycle and the mmap path remain the main
problems to solve.
Thanks,
Praan
Sami