Re: [PATCH 3/6] sparc: remove the sparc32_dma_ops indirection

2018-12-14 Thread Guenter Roeck
On Sat, Dec 08, 2018 at 09:41:12AM -0800, Christoph Hellwig wrote: > There is no good reason to have a double indirection for the sparc32 > dma ops, so remove the sparc32_dma_ops and define separate dma_map_ops > instance for the different IOMMU types. > Except maybe this: scsi host0: esp scsi

Re: [PATCH v6 00/27] ptrace: add PTRACE_GET_SYSCALL_INFO request

2018-12-14 Thread Paul Moore
On Thu, Dec 13, 2018 at 12:18 PM Dmitry V. Levin wrote: > PTRACE_GET_SYSCALL_INFO is a generic ptrace API that lets ptracer obtain > details of the syscall the tracee is blocked in. > > There are two reasons for a special syscall-related ptrace request. > > Firstly, with the current ptrace API

Re: [PATCH 1/2] dma-mapping: zero memory returned from dma_alloc_*

2018-12-14 Thread Christoph Hellwig
On Fri, Dec 14, 2018 at 07:10:56PM +0100, Sam Ravnborg wrote: > Hi Christoph, > > I stumbled upon this one: > > #define __get_dma_pages(gfp_mask, order) \ > __get_free_pages((gfp_mask) | GFP_DMA, (order)) This isn't directly related to the dma mapping, but another place that

Re: [PATCH 1/2] dma-mapping: zero memory returned from dma_alloc_*

2018-12-14 Thread Sam Ravnborg
Hi Christoph, I stumbled upon this one: #define __get_dma_pages(gfp_mask, order) \ __get_free_pages((gfp_mask) | GFP_DMA, (order)) (include/linux/gfp.h) Should it also have the __GFP_ZERO treatment? Or maybe this is already done in your tree.. As for the sparc bits: Acked-by:

Re: [PATCH 1/2] dma-mapping: zero memory returned from dma_alloc_*

2018-12-14 Thread Greg Ungerer
On 14/12/18 9:47 pm, Christoph Hellwig wrote: On Fri, Dec 14, 2018 at 10:54:32AM +0100, Geert Uytterhoeven wrote: - page = alloc_pages(flag, order); + page = alloc_pages(flag | GFP_ZERO, order); if (!page) return NULL; There's second implementation

Re: ensure dma_alloc_coherent always returns zeroed memory

2018-12-14 Thread Christoph Hellwig
And in various places this used GFP_ZERO instead of __GFP_ZERO, so won't compile. The fixed version is available here: http://git.infradead.org/users/hch/misc.git/shortlog/refs/heads/dma-alloc-always-zero ___ linux-snps-arc mailing list

Re: [PATCH 1/2] dma-mapping: zero memory returned from dma_alloc_*

2018-12-14 Thread Geert Uytterhoeven
Hi Christoph, On Fri, Dec 14, 2018 at 12:47 PM Christoph Hellwig wrote: > > On Fri, Dec 14, 2018 at 10:54:32AM +0100, Geert Uytterhoeven wrote: > > > - page = alloc_pages(flag, order); > > > + page = alloc_pages(flag | GFP_ZERO, order); > > > if (!page) > > >

Re: [PATCH 1/2] dma-mapping: zero memory returned from dma_alloc_*

2018-12-14 Thread Eugeniy Paltsev
Hi Christoph, do you have any public git repository with all your dma changes? I want to test them for ARC. Thanks. On Fri, 2018-12-14 at 09:25 +0100, Christoph Hellwig wrote: > If we want to map memory from the DMA allocator to userspace it must be > zeroed at allocation time to prevent stale

Re: [PATCH 1/2] dma-mapping: zero memory returned from dma_alloc_*

2018-12-14 Thread h...@lst.de
On Fri, Dec 14, 2018 at 12:12:00PM +, Eugeniy Paltsev wrote: > Hi Christoph, > > do you have any public git repository with all your dma changes? Most of the tree show up in my misc.git repo for testing. This series is here:

Re: [PATCH 1/2] dma-mapping: zero memory returned from dma_alloc_*

2018-12-14 Thread Christoph Hellwig
On Fri, Dec 14, 2018 at 10:54:32AM +0100, Geert Uytterhoeven wrote: > > - page = alloc_pages(flag, order); > > + page = alloc_pages(flag | GFP_ZERO, order); > > if (!page) > > return NULL; > > There's second implementation below, which calls __get_free_pages()

Re: [PATCH] ARC: fix __ffs return value to avoid build warnings

2018-12-14 Thread Eugeniy Paltsev
Hi Vineet, On Thu, 2018-12-13 at 18:23 +, Vineet Gupta wrote: > On 12/13/18 7:43 AM, Eugeniy Paltsev wrote: > > Change __ffs return value from 'int' to 'unsigned long' as it > > is done in other implementations (like asm-generic, x86, etc...) > > to avoid build-time warnings in places where

Re: [PATCH 1/2] dma-mapping: zero memory returned from dma_alloc_*

2018-12-14 Thread Geert Uytterhoeven
On Fri, Dec 14, 2018 at 10:54 AM Geert Uytterhoeven wrote: > On Fri, Dec 14, 2018 at 9:26 AM Christoph Hellwig wrote: > > If we want to map memory from the DMA allocator to userspace it must be > > zeroed at allocation time to prevent stale data leaks. We already do > > this on most common

Re: [PATCH 1/2] dma-mapping: zero memory returned from dma_alloc_*

2018-12-14 Thread Geert Uytterhoeven
Hi Christoph, On Fri, Dec 14, 2018 at 9:26 AM Christoph Hellwig wrote: > If we want to map memory from the DMA allocator to userspace it must be > zeroed at allocation time to prevent stale data leaks. We already do > this on most common architectures, but some architectures don't do this >

[PATCH 2/2] dma-mapping: deprecate dma_zalloc_coherent

2018-12-14 Thread Christoph Hellwig
We now always return zeroed memory from dma_alloc_coherent. Note that simply passing GFP_ZERO to dma_alloc_coherent wasn't always doing the right thing to start with given that various allocators are not backed by the page allocator and thus would ignore GFP_ZERO. Signed-off-by: Christoph

[PATCH 1/2] dma-mapping: zero memory returned from dma_alloc_*

2018-12-14 Thread Christoph Hellwig
If we want to map memory from the DMA allocator to userspace it must be zeroed at allocation time to prevent stale data leaks. We already do this on most common architectures, but some architectures don't do this yet, fix them up, either by passing GFP_ZERO when we use the normal page allocator

ensure dma_alloc_coherent always returns zeroed memory

2018-12-14 Thread Christoph Hellwig
For security reasons we already returned zeroed memory from dma_alloc_coherent on most common platforms, but some implementation missed out. Make sure we provide a consistent behavior. ___ linux-snps-arc mailing list linux-snps-arc@lists.infradead.org