Re: [RFC 5/8] scatterlist: Modify SG copy functions to support io memory.

2017-04-07 Thread Logan Gunthorpe
Hi Dan, On 03/04/17 06:07 PM, Dan Williams wrote: > The completely agnostic part is where I get worried, but I shouldn't > say anymore until I actually read the patch.The worry is cases where > this agnostic enabling allows unsuspecting code paths to do the wrong > thing. Like bypass iomem safety.

Re: [RFC 5/8] scatterlist: Modify SG copy functions to support io memory.

2017-04-03 Thread Dan Williams
On Mon, Apr 3, 2017 at 4:12 PM, Logan Gunthorpe wrote: > > > On 03/04/17 04:47 PM, Dan Williams wrote: >> I wouldn't necessarily conflate supporting pfn_t in the scatterlist >> with the stalled stuct-page-less DMA effor. A pfn_t_to_page() >> conversion will still work and be required. However you'

Re: [RFC 5/8] scatterlist: Modify SG copy functions to support io memory.

2017-04-03 Thread Logan Gunthorpe
On 03/04/17 04:47 PM, Dan Williams wrote: > I wouldn't necessarily conflate supporting pfn_t in the scatterlist > with the stalled stuct-page-less DMA effor. A pfn_t_to_page() > conversion will still work and be required. However you're right, the > minute we use pfn_t for this we're into the rea

Re: [RFC 5/8] scatterlist: Modify SG copy functions to support io memory.

2017-04-03 Thread Dan Williams
On Mon, Apr 3, 2017 at 3:10 PM, Logan Gunthorpe wrote: > > > On 03/04/17 03:44 PM, Dan Williams wrote: >> On Mon, Apr 3, 2017 at 2:20 PM, Logan Gunthorpe wrote: >>> Hi Christoph, >>> >>> What are your thoughts on an approach like the following untested >>> draft patch. >>> >>> The patch (if flesh

Re: [RFC 5/8] scatterlist: Modify SG copy functions to support io memory.

2017-04-03 Thread Logan Gunthorpe
On 03/04/17 03:44 PM, Dan Williams wrote: > On Mon, Apr 3, 2017 at 2:20 PM, Logan Gunthorpe wrote: >> Hi Christoph, >> >> What are your thoughts on an approach like the following untested >> draft patch. >> >> The patch (if fleshed out) makes it so iomem can be used in an sgl >> and WARN_ONs wil

Re: [RFC 5/8] scatterlist: Modify SG copy functions to support io memory.

2017-04-03 Thread Dan Williams
On Mon, Apr 3, 2017 at 2:20 PM, Logan Gunthorpe wrote: > Hi Christoph, > > What are your thoughts on an approach like the following untested > draft patch. > > The patch (if fleshed out) makes it so iomem can be used in an sgl > and WARN_ONs will occur in places where drivers attempt to access > i

Re: [RFC 5/8] scatterlist: Modify SG copy functions to support io memory.

2017-04-03 Thread Logan Gunthorpe
Hi Christoph, What are your thoughts on an approach like the following untested draft patch. The patch (if fleshed out) makes it so iomem can be used in an sgl and WARN_ONs will occur in places where drivers attempt to access iomem directly through the sgl. I'd also probably create a p2pmem_allo

Re: [RFC 5/8] scatterlist: Modify SG copy functions to support io memory.

2017-03-31 Thread Logan Gunthorpe
On 31/03/17 01:09 AM, Christoph Hellwig wrote: > You're calling memcpy_{to,from}_iomem on non-__iomem pointers. This > is a fundamental no-go as we keep I/O memory separate from kernel > pointers. Yes, that's true, however I don't know how we could get around that when the iomem is referenced b

Re: [RFC 5/8] scatterlist: Modify SG copy functions to support io memory.

2017-03-31 Thread Christoph Hellwig
You're calling memcpy_{to,from}_iomem on non-__iomem pointers. This is a fundamental no-go as we keep I/O memory separate from kernel pointers.

[RFC 5/8] scatterlist: Modify SG copy functions to support io memory.

2017-03-30 Thread Logan Gunthorpe
Now that we are using p2pmem SG buffers we occasionally have to copy to and from this memory. For this, we add an iomem flag to sg_copy_buffer for copying with iomemcpy. We also add the sg_iocopy_ variants to use this more easily. Signed-off-by: Logan Gunthorpe Signed-off-by: Stephen Bates Signe