Re: [PATCH v8 09/11] vfio/pci: Enable peer-to-peer DMA transactions by default

From: Alex Williamson

Date: Tue Nov 18 2025 - 15:10:52 EST


On Tue, 18 Nov 2025 07:18:36 +0000
"Tian, Kevin" <kevin.tian@xxxxxxxxx> wrote:

> > From: Leon Romanovsky <leon@xxxxxxxxxx>
> > Sent: Tuesday, November 11, 2025 5:58 PM
> >
> > From: Leon Romanovsky <leonro@xxxxxxxxxx>
>
> not required with only your own s-o-b
>
> > @@ -2090,6 +2092,9 @@ int vfio_pci_core_init_dev(struct vfio_device
> > *core_vdev)
> > INIT_LIST_HEAD(&vdev->dummy_resources_list);
> > INIT_LIST_HEAD(&vdev->ioeventfds_list);
> > INIT_LIST_HEAD(&vdev->sriov_pfs_item);
> > + ret = pcim_p2pdma_init(vdev->pdev);
> > + if (ret && ret != -EOPNOTSUPP)
> > + return ret;
>
> Reading the commit msg seems -EOPNOTSUPP is only returned for fake
> PCI devices, otherwise it implies regression. better add a comment for it?

I think the commit log is saying that if a device comes along that
can't support this, we'd quirk the init path to return -EOPNOTSUPP for
that particular device here. This path is currently used when
!CONFIG_PCI_P2PDMA to make this error non-fatal to the device init.

I don't see a regression if such a device comes along and while we
could survive other types of failures by disabling p2pdma here, I think
all such cases are sufficient rare out of memory cases to consider them
catastrophic. Thanks,

Alex