On 2020-11-09 8:03 a.m., Keith Busch wrote: > On Fri, Nov 06, 2020 at 10:00:36AM -0700, Logan Gunthorpe wrote: >> Allow userspace to obtain CMB memory by mmaping the controller's >> char device. The mmap call allocates and returns a hunk of CMB memory, >> (the offset is ignored) so userspace does not have control over the >> address within the CMB. >> >> A VMA allocated in this way will only be usable by drivers that set >> FOLL_PCI_P2PDMA when calling GUP. And inter-device support will be >> checked the first time the pages are mapped for DMA. >> >> Currently this is only supported by O_DIRECT to an PCI NVMe device >> or through the NVMe passthrough IOCTL. > > Rather than make this be specific to nvme, could pci p2pdma create an > mmap'able file for any resource registered with it? It's certainly possible. However, other people have been arguing that more of this should be specific to NVMe as some use cases do not want to use the genalloc inside p2pdma. Logan _______________________________________________ iommu mailing list iommu@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/iommu
- Re: [RFC PATCH 04/15] lib/scatterlist: Add flag... Logan Gunthorpe
- [RFC PATCH 06/15] dma-mapping: Add flags to dma_map_ops ... Logan Gunthorpe
- [RFC PATCH 07/15] iommu/dma: Support PCI P2PDMA pages in... Logan Gunthorpe
- [RFC PATCH 02/15] PCI/P2PDMA: Attempt to set map_type if... Logan Gunthorpe
- [RFC PATCH 09/15] nvme-pci: Convert to using dma_map_sg ... Logan Gunthorpe
- [RFC PATCH 05/15] dma-direct: Support PCI P2PDMA pages i... Logan Gunthorpe
- [RFC PATCH 15/15] nvme-pci: Allow mmaping the CMB in use... Logan Gunthorpe
- Re: [RFC PATCH 15/15] nvme-pci: Allow mmaping the C... Jason Gunthorpe
- Re: [RFC PATCH 15/15] nvme-pci: Allow mmaping t... Logan Gunthorpe
- Re: [RFC PATCH 15/15] nvme-pci: Allow mmaping the C... Keith Busch
- Re: [RFC PATCH 15/15] nvme-pci: Allow mmaping t... Logan Gunthorpe
- [RFC PATCH 08/15] nvme-pci: Check DMA ops when indicatin... Logan Gunthorpe
- [RFC PATCH 01/15] PCI/P2PDMA: Don't sleep in upstream_br... Logan Gunthorpe
- Re: [RFC PATCH 01/15] PCI/P2PDMA: Don't sleep in up... Christoph Hellwig
- [RFC PATCH 10/15] mm: Introduce FOLL_PCI_P2PDMA to gate ... Logan Gunthorpe
- [RFC PATCH 03/15] PCI/P2PDMA: Introduce pci_p2pdma_shoul... Logan Gunthorpe
- Re: [RFC PATCH 03/15] PCI/P2PDMA: Introduce pci_p2p... Bjorn Helgaas
- Re: [RFC PATCH 03/15] PCI/P2PDMA: Introduce pci... Logan Gunthorpe