Re: [RFC PATCH 0/7] vfio: selftests: Add peer-to-peer DMA selftest

From: Samiullah Khawaja

Date: Mon Nov 16 2026 - 13:25:17 EST


On Mon, Nov 16, 2026 at 10:02:56AM -0800, David Matlack wrote:
On Sun, Nov 15, 2026 at 3:19 PM Jason Gunthorpe <jgg@xxxxxxxxxx> wrote:

On Thu, Nov 12, 2026 at 01:47:03PM -0800, David Matlack wrote:
> On Thu Nov 12, 2026 at 12:35 PM PST, Alex Mastro wrote:
> > Hey David,
> >
> > On Wed, Nov 11, 2026 at 07:24:04PM +0000, David Matlack wrote:
> >
> >> Is requiring userspace to re-issue IOMMU_IOAS_MAP_FILE the expected
> >> uAPI behavior?

Yes. Even if we wanted to the locking is doesn't allow trying to do it
automatically.

> The way I designed the P2P selftest support requires 2 things:
>
> (A) initiator: A device that has a VFIO selftests driver.
> (B) target: A device that can provide a memory BAR (vfio_pci_find_mem_bar()).
>
> So far I haven't found a single device that can do both. But you are
> right that theoretically a single device could satisfy both
> requirements.

mlx5 can do both

Looks like GPUs and NVMe can do both as well.

AFAIU the memory BARs for GPUs would need initialization. The internal
VRAM needs to be exposed (mapped) to the BARs.

Do you think we should have a P2P device "setup" step that can be
implemented for various types of devices?

Thanks,
Sami