iommufd now maps vfio DMA-bufs through dma_buf_iommu_map(), with the dma-buf core programming the dma_shared_buf this exporter hands out. The private interface, and its restriction to a single range, are no longer used. Signed-off-by: Alistair Popple --- drivers/vfio/pci/vfio_pci_dmabuf.c | 34 ---------------------------------- include/linux/vfio_pci_core.h | 3 --- 2 files changed, 37 deletions(-) diff --git a/drivers/vfio/pci/vfio_pci_dmabuf.c b/drivers/vfio/pci/vfio_pci_dmabuf.c index 667a31efa922..613bf5f5c672 100644 --- a/drivers/vfio/pci/vfio_pci_dmabuf.c +++ b/drivers/vfio/pci/vfio_pci_dmabuf.c @@ -111,40 +111,6 @@ static const struct dma_buf_ops vfio_pci_dmabuf_ops = { .release = vfio_pci_dma_buf_release, }; -/* - * This is a temporary "private interconnect" between VFIO DMABUF and iommufd. - * It allows the two co-operating drivers to exchange the physical address of - * the BAR. This is to be replaced with a formal DMABUF system for negotiated - * interconnect types. - * - * If this function succeeds the following are true: - * - There is one physical range and it is pointing to MMIO - * - When move_notify is called it means revoke, not move, vfio_dma_buf_map - * will fail if it is currently revoked - */ -int vfio_pci_dma_buf_iommufd_map(struct dma_buf_attachment *attachment, - struct phys_vec *phys) -{ - struct vfio_pci_dma_buf *priv; - - dma_resv_assert_held(attachment->dmabuf->resv); - - if (attachment->dmabuf->ops != &vfio_pci_dmabuf_ops) - return -EOPNOTSUPP; - - priv = attachment->dmabuf->priv; - if (priv->revoked) - return -ENODEV; - - /* More than one range to iommufd will require proper DMABUF support */ - if (priv->nr_ranges != 1) - return -EOPNOTSUPP; - - *phys = priv->phys_vec[0]; - return 0; -} -EXPORT_SYMBOL_FOR_MODULES(vfio_pci_dma_buf_iommufd_map, "iommufd"); - int vfio_pci_core_fill_phys_vec(struct phys_vec *phys_vec, struct vfio_region_dma_range *dma_ranges, size_t nr_ranges, phys_addr_t start, diff --git a/include/linux/vfio_pci_core.h b/include/linux/vfio_pci_core.h index 2f3fa2787737..f5e9c1dff152 100644 --- a/include/linux/vfio_pci_core.h +++ b/include/linux/vfio_pci_core.h @@ -256,9 +256,6 @@ vfio_pci_core_get_iomap(struct vfio_pci_core_device *vdev, unsigned int bar) return vdev->barmap[bar]; } -int vfio_pci_dma_buf_iommufd_map(struct dma_buf_attachment *attachment, - struct phys_vec *phys); - int vfio_pci_core_runtime_suspend(struct vfio_pci_core_device *vdev); int vfio_pci_core_runtime_resume(struct vfio_pci_core_device *vdev); pci_ers_result_t vfio_pci_core_aer_err_detected(struct vfio_pci_core_device *vdev); -- 2.54.0