diff options
| author | Alex Williamson <alex@shazbot.org> | 2025-11-20 21:20:00 -0700 |
|---|---|---|
| committer | Alex Williamson <alex@shazbot.org> | 2025-11-20 21:20:00 -0700 |
| commit | fa804aa4ac1b091ef2ec2981f08a1c28aaeba8e7 (patch) | |
| tree | 77e377384b1eca3835404c27cffbcf455299f375 /drivers/vfio/pci/vfio_pci.c | |
| parent | 56c069307dfd0a5e39b685e0aeee6c40d1d7ddfc (diff) | |
| parent | 5415d887db0e059920cb5673a32cc4d66daa280f (diff) | |
Merge tag 'vfio-v6.19-dma-buf-v9+' into v6.19/vfio/next
[v9] vfio/pci: Allow MMIO regions to be exported through dma-buf
https://lore.kernel.org/all/20251120-dmabuf-vfio-v9-0-d7f71607f371@nvidia.com
Signed-off-by: Alex Williamson <alex@shazbot.org>
Diffstat (limited to 'drivers/vfio/pci/vfio_pci.c')
| -rw-r--r-- | drivers/vfio/pci/vfio_pci.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/vfio/pci/vfio_pci.c b/drivers/vfio/pci/vfio_pci.c index a3e49d42c771..0c771064c0b8 100644 --- a/drivers/vfio/pci/vfio_pci.c +++ b/drivers/vfio/pci/vfio_pci.c @@ -148,6 +148,10 @@ static const struct vfio_device_ops vfio_pci_ops = { .pasid_detach_ioas = vfio_iommufd_physical_pasid_detach_ioas, }; +static const struct vfio_pci_device_ops vfio_pci_dev_ops = { + .get_dmabuf_phys = vfio_pci_core_get_dmabuf_phys, +}; + static int vfio_pci_probe(struct pci_dev *pdev, const struct pci_device_id *id) { struct vfio_pci_core_device *vdev; @@ -162,6 +166,7 @@ static int vfio_pci_probe(struct pci_dev *pdev, const struct pci_device_id *id) return PTR_ERR(vdev); dev_set_drvdata(&pdev->dev, vdev); + vdev->pci_ops = &vfio_pci_dev_ops; ret = vfio_pci_core_register_device(vdev); if (ret) goto out_put_vdev; |