Re: [PATCH 0/4] Allow MMIO regions to be exported through dma-buf

2022-08-24 Thread Jason Gunthorpe
On Thu, Aug 18, 2022 at 03:37:01PM +0200, Christian König wrote: > Am 18.08.22 um 15:16 schrieb Jason Gunthorpe: > > On Thu, Aug 18, 2022 at 02:58:10PM +0200, Christian König wrote: > > > > > > > The only thing I'm not 100% convinced of is dma_buf_try_get(), I've > > > > > seen > > > > > this inc

Re: [PATCH 0/4] Allow MMIO regions to be exported through dma-buf

2022-08-24 Thread Jason Gunthorpe
On Thu, Aug 18, 2022 at 01:07:16PM +0200, Christian König wrote: > Am 17.08.22 um 18:11 schrieb 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

Re: [PATCH 0/4] Allow MMIO regions to be exported through dma-buf

2022-08-22 Thread Alex Williamson
On Thu, 18 Aug 2022 09:05:24 -0300 Jason Gunthorpe wrote: > On Wed, Aug 17, 2022 at 01:11:38PM -0300, Jason Gunthorpe wrote: > > 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 impo

Re: [PATCH 0/4] Allow MMIO regions to be exported through dma-buf

2022-08-19 Thread Christian König
Am 19.08.22 um 15:39 schrieb Jason Gunthorpe: On Fri, Aug 19, 2022 at 03:33:04PM +0200, Christian König wrote: So we could delete the try_buf and just rely on move being safe on partially destroyed dma_buf's as part of the API design. I think that might be the more defensive approach. A commen

Re: [PATCH 0/4] Allow MMIO regions to be exported through dma-buf

2022-08-19 Thread Jason Gunthorpe
On Fri, Aug 19, 2022 at 03:33:04PM +0200, Christian König wrote: > > > > So we could delete the try_buf and just rely on move being safe on > > > > partially destroyed dma_buf's as part of the API design. > > > I think that might be the more defensive approach. A comment on the > > > dma_buf_move_

Re: [PATCH 0/4] Allow MMIO regions to be exported through dma-buf

2022-08-19 Thread Christian König
Am 19.08.22 um 15:11 schrieb Jason Gunthorpe: On Thu, Aug 18, 2022 at 03:37:01PM +0200, Christian König wrote: Am 18.08.22 um 15:16 schrieb Jason Gunthorpe: On Thu, Aug 18, 2022 at 02:58:10PM +0200, Christian König wrote: The only thing I'm not 100% convinced of is dma_buf_try_get(), I've see

Re: [PATCH 0/4] Allow MMIO regions to be exported through dma-buf

2022-08-18 Thread Christian König
Am 18.08.22 um 15:16 schrieb Jason Gunthorpe: On Thu, Aug 18, 2022 at 02:58:10PM +0200, Christian König wrote: The only thing I'm not 100% convinced of is dma_buf_try_get(), I've seen this incorrectly used so many times that I can't count them any more. Would that be somehow avoidable? Or coul

Re: [PATCH 0/4] Allow MMIO regions to be exported through dma-buf

2022-08-18 Thread Jason Gunthorpe
On Thu, Aug 18, 2022 at 02:58:10PM +0200, Christian König wrote: > > > The only thing I'm not 100% convinced of is dma_buf_try_get(), I've seen > > > this incorrectly used so many times that I can't count them any more. > > > > > > Would that be somehow avoidable? Or could you at least explain th

Re: [PATCH 0/4] Allow MMIO regions to be exported through dma-buf

2022-08-18 Thread Christian König
Am 18.08.22 um 14:03 schrieb Jason Gunthorpe: On Thu, Aug 18, 2022 at 01:07:16PM +0200, Christian König wrote: Am 17.08.22 um 18:11 schrieb 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.

Re: [PATCH 0/4] Allow MMIO regions to be exported through dma-buf

2022-08-18 Thread Jason Gunthorpe
On Wed, Aug 17, 2022 at 01:11:38PM -0300, Jason Gunthorpe wrote: > 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 op

Re: [PATCH 0/4] Allow MMIO regions to be exported through dma-buf

2022-08-18 Thread Christian König
Am 17.08.22 um 18:11 schrieb 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

[PATCH 0/4] Allow MMIO regions to be exported through dma-buf

2022-08-17 Thread 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 MMIO memory from PCI de