Re: [PATCH v13 4/5] vfio/pci: implement get_pci_tph and DMA_BUF_TPH feature

[email protected]
Newsgroups gmane.linux.kernel.pci,gmane.comp.emulators.kvm.devel,gmane.comp.video.dri.devel
Message-ID <[email protected]>
> Implement dma-buf get_pci_tph for vfio-pci exported dma-bufs and add
> VFIO_DEVICE_FEATURE_DMA_BUF_TPH so userspace can publish TPH metadata
> for a VFIO-owned device.
> 
> 8-bit ST and 16-bit Extended ST are distinct PCIe TPH namespaces; the
> uAPI carries both with explicit validity flags, and get_pci_tph()
> returns the value matching the importer's requested namespace or
> -EOPNOTSUPP.
> 
> Publish and read the TPH descriptor under dmabuf->resv, matching the
> locking used for other importer-visible dma-buf state. The SET ioctl
> takes dma_resv_lock_interruptible(), while the callback runs under
> DMA-buf's asserted resv lock.
> 
> Hold memory_lock in the SET path while checking that the dma-buf still
> [ ... ]
> supported on a device that advertises TPH Completer support but cannot
> export a vfio dma-buf at all, so no dma-buf can ever exist to carry the
> metadata and every SET would fail later at the ownership check.
> 
> Signed-off-by: Zhiping Zhang <[email protected]>

Sashiko has reviewed this patch and found no issues. It looks great!

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=4
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.