Re: [RFC v2 PATCH 09/10] vfio/pci: Add mmap() attributes to DMABUF feature
From: Matt Evans
Date: Tue Mar 31 2026 - 11:25:56 EST
HI Jason,
On Mon, Mar 30, 2026 at 2:33 PM Jason Gunthorpe <jgg@xxxxxxxxxx> wrote:
>
> On Thu, Mar 12, 2026 at 11:46:07AM -0700, Matt Evans wrote:
> > A new field is reserved in vfio_device_feature_dma_buf.flags to
> > request CPU-facing memory type attributes for mmap()s of the buffer.
> > Add a flag VFIO_DEVICE_FEATURE_DMA_BUF_ATTR_WC, which results in WC
> > PTEs for the DMABUF's BAR region.
>
> This seems very straightforward, I like it
>
> Did I get it right that the idea is the user would request a dmabuf
> with these flags and then mmap the dmabuf?
Right, export it with a requested attribute (as possibly some
sub-slice(s) of a larger BAR if you like) and then map it (no
attributes need to be specified at mmap() time).
Thanks,
Matt