Re: [PATCH v1 2/2] vfio/pci: Allow MMIO regions to be exported through dma-buf

2024-05-08 Thread Daniel Vetter
On Tue, May 07, 2024 at 09:31:53PM -0300, Jason Gunthorpe wrote: > On Thu, May 02, 2024 at 07:50:36AM +, Kasireddy, Vivek wrote: > > Hi Jason, > > > > > > > > On Tue, Apr 30, 2024 at 04:24:50PM -0600, Alex Williamson wrote: > > > > > +static vm_fault_t vfio_pci_dma_buf_fault(struct vm_fault *

Re: [PATCH v1 2/2] vfio/pci: Allow MMIO regions to be exported through dma-buf

2024-05-07 Thread Jason Gunthorpe
On Thu, May 02, 2024 at 07:50:36AM +, Kasireddy, Vivek wrote: > Hi Jason, > > > > > On Tue, Apr 30, 2024 at 04:24:50PM -0600, Alex Williamson wrote: > > > > +static vm_fault_t vfio_pci_dma_buf_fault(struct vm_fault *vmf) > > > > +{ > > > > + struct vm_area_struct *vma = vmf->vma; > > >

Re: [PATCH v1 2/2] vfio/pci: Allow MMIO regions to be exported through dma-buf

2024-05-02 Thread Leon Romanovsky
On Thu, May 02, 2024 at 07:50:36AM +, Kasireddy, Vivek wrote: > Hi Jason, <...> > > I'd rather we stick with the original design. Leon is working on DMA > > API changes that should address half the issue. > Ok, I'll keep an eye out for Leon's work. The code for v1 is here: https://git.kernel

RE: [PATCH v1 2/2] vfio/pci: Allow MMIO regions to be exported through dma-buf

2024-05-02 Thread Kasireddy, Vivek
Hi Jason, > > On Tue, Apr 30, 2024 at 04:24:50PM -0600, Alex Williamson wrote: > > > +static vm_fault_t vfio_pci_dma_buf_fault(struct vm_fault *vmf) > > > +{ > > > + struct vm_area_struct *vma = vmf->vma; > > > + struct vfio_pci_dma_buf *priv = vma->vm_private_data; > > > + pgoff_t pgoff = vmf->p

Re: [PATCH v1 2/2] vfio/pci: Allow MMIO regions to be exported through dma-buf

2024-05-01 Thread Jason Gunthorpe
On Tue, Apr 30, 2024 at 04:24:50PM -0600, Alex Williamson wrote: > > +static vm_fault_t vfio_pci_dma_buf_fault(struct vm_fault *vmf) > > +{ > > + struct vm_area_struct *vma = vmf->vma; > > + struct vfio_pci_dma_buf *priv = vma->vm_private_data; > > + pgoff_t pgoff = vmf->pgoff; > > + > > +

Re: [PATCH v1 2/2] vfio/pci: Allow MMIO regions to be exported through dma-buf

2024-04-30 Thread Alex Williamson
On Sun, 21 Apr 2024 23:30:33 -0700 Vivek Kasireddy wrote: > From Jason Gunthorpe: > "dma-buf has become a way to safely acquire a handle to non-struct page > memory that can still have lifetime controlled by the exporter. Notably > RDMA can now import dma-buf FDs and build them into MRs which all

Re: [PATCH v1 2/2] vfio/pci: Allow MMIO regions to be exported through dma-buf

2024-04-22 Thread Zhu Yanjun
On 22.04.24 08:30, Vivek Kasireddy wrote: From Jason Gunthorpe: "dma-buf has become a way to safely acquire a handle to non-struct page memory that can still have lifetime controlled by the exporter. Notably RDMA can now import dma-buf FDs and build them into MRs which allows for PCI P2P operati

[PATCH v1 2/2] vfio/pci: Allow MMIO regions to be exported through dma-buf

2024-04-22 Thread Vivek Kasireddy
>From Jason Gunthorpe: "dma-buf has become a way to safely acquire a handle to non-struct page memory that can still have lifetime controlled by the exporter. Notably RDMA can now import dma-buf FDs and build them into MRs which allows for PCI P2P operations. Extend this to allow vfio-pci to export