Re: [PATCH] dma-direct: fix DMA_ATTR_NO_KERNEL_MAPPING

2021-11-02 Thread Walter Wu
Hi Cristoph, On Tue, 2021-11-02 at 07:41 +0100, Christoph Hellwig wrote: > As others pointed out, DMA_ATTR_NO_KERNEL_MAPPING just means the > caller can't rely on a kernel mapping. So the "fix" here is > wrong. That being said for cases where we can easily remove a page > from the kernel

Re: [PATCH] dma-direct: fix DMA_ATTR_NO_KERNEL_MAPPING

2021-11-02 Thread Walter Wu
Hi Christoph, I am sorry, fix my typo. Walter On Tue, 2021-11-02 at 07:41 +0100, Christoph Hellwig wrote: > As others pointed out, DMA_ATTR_NO_KERNEL_MAPPING just means the > caller can't rely on a kernel mapping. So the "fix" here is > wrong. That being said for cases where we can easily

Re: [PATCH] dma-direct: fix DMA_ATTR_NO_KERNEL_MAPPING

2021-11-01 Thread Walter Wu
On Mon, 2021-11-01 at 15:17 +0100, Ard Biesheuvel wrote: > On Mon, 1 Nov 2021 at 13:21, Walter Wu > wrote: > > > > Hi Ard, > > > > On Mon, 2021-11-01 at 09:34 +0100, Ard Biesheuvel wrote: > > > On Mon, 1 Nov 2021

[PATCH v2] dma-direct: improve DMA_ATTR_NO_KERNEL_MAPPING

2021-11-03 Thread Walter Wu
support for ARM64. Signed-off-by: Walter Wu Suggested-by: Christoph Hellwig Suggested-by: Ard Biesheuvel Cc: Christoph Hellwig Cc: Marek Szyprowski Cc: Robin Murphy Cc: Matthias Brugger Cc: Ard Biesheuvel Cc: Andrew Morton --- v2: 1. modify commit message and fix the removing mapping

Re: [PATCH v2] dma-direct: improve DMA_ATTR_NO_KERNEL_MAPPING

2021-11-04 Thread Walter Wu
On Thu, 2021-11-04 at 09:53 +0100, Christoph Hellwig wrote: > On Thu, Nov 04, 2021 at 10:32:21AM +0800, Walter Wu wrote: > > diff --git a/include/linux/set_memory.h > > b/include/linux/set_memory.h > > index f36be5166c19..6c7d1683339c 100644 > > --- a/include/linux/set

Re: [PATCH v2] dma-direct: improve DMA_ATTR_NO_KERNEL_MAPPING

2021-11-04 Thread Walter Wu
On Thu, 2021-11-04 at 09:57 +0100, Ard Biesheuvel wrote: > On Thu, 4 Nov 2021 at 09:53, Christoph Hellwig wrote: > > > > On Thu, Nov 04, 2021 at 10:32:21AM +0800, Walter Wu wrote: > > > diff --git a/include/linux/set_memory.h > > > b/include/linux/set_

Re: [PATCH v2] dma-direct: improve DMA_ATTR_NO_KERNEL_MAPPING

2021-11-04 Thread Walter Wu
On Thu, 2021-11-04 at 13:47 +0100, Ard Biesheuvel wrote: > On Thu, 4 Nov 2021 at 13:31, Walter Wu > wrote: > > > > On Thu, 2021-11-04 at 09:57 +0100, Ard Biesheuvel wrote: > > > On Thu, 4 Nov 2021 at 09:53, Christoph Hellwig > > > wrote: > > > >

[PATCH] dma-direct: fix DMA_ATTR_NO_KERNEL_MAPPING

2021-11-01 Thread Walter Wu
. In some cases, we don't hope the allocated buffer to be read by cpu or speculative execution, so we use DMA_ATTR_NO_KERNEL_MAPPING to get no kernel mapping in order to achieve this goal. Signed-off-by: Walter Wu Cc: Christoph Hellwig Cc: Marek Szyprowski Cc: Robin Murphy Cc: Matthias Brugger Cc

Re: [PATCH] dma-direct: fix DMA_ATTR_NO_KERNEL_MAPPING

2021-11-01 Thread Walter Wu
Hi Robin, On Mon, 2021-11-01 at 10:29 +, Robin Murphy wrote: > On 2021-11-01 03:15, Walter Wu wrote: > > DMA_ATTR_NO_KERNEL_MAPPING is to avoid creating a kernel mapping > > for the allocated buffer, but current implementation is that > > PTE of allocated buffer in kerne

Re: [PATCH] dma-direct: fix DMA_ATTR_NO_KERNEL_MAPPING

2021-11-01 Thread Walter Wu
Hi Ard, On Mon, 2021-11-01 at 09:34 +0100, Ard Biesheuvel wrote: > On Mon, 1 Nov 2021 at 04:17, Walter Wu > wrote: > > > > DMA_ATTR_NO_KERNEL_MAPPING is to avoid creating a kernel mapping > > for the allocated buffer, but current implementation is that > > PTE of a