Re: [git pull] IOMMU Updates for Linux v5.16

2021-11-04 Thread pr-tracker-bot
The pull request you sent on Thu, 4 Nov 2021 15:16:22 +0100: > git://git.kernel.org/pub/scm/linux/kernel/git/joro/iommu.git > tags/iommu-updates-v5.16 has been merged into torvalds/linux.git: https://git.kernel.org/torvalds/c/7e113d01f5f9fe6ad018d8289239d0bbb41311d7 Thank you! --

Re: [git pull] IOMMU Updates for Linux v5.16

2021-11-04 Thread Linus Torvalds
On Thu, Nov 4, 2021 at 7:16 AM Joerg Roedel wrote: > > there is a merge conflict this time between the IOMMU tree and FPU > changes which came from the tip tree. My conflict resolution is > attached. The conflict is trivial, no worries. But as I was resolving it, I looked at that PASID_DISABLED

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

2021-11-04 Thread Ard Biesheuvel
On Thu, 4 Nov 2021 at 14:40, Walter Wu wrote: > > 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 > > > >

[git pull] IOMMU Updates for Linux v5.16

2021-11-04 Thread Joerg Roedel
Hi Linus, there is a merge conflict this time between the IOMMU tree and FPU changes which came from the tip tree. My conflict resolution is attached. With that in mind: The following changes since commit 8bb7eca972ad531c9b149c0a51ab43a417385813: Linux 5.15 (2021-10-31 13:53:10 -0700) are

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: > > > > > > > > On Thu, Nov 04, 2021 at 10:32:21AM

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

2021-11-04 Thread Ard Biesheuvel
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: > > > > > > On Thu, Nov 04, 2021 at 10:32:21AM +0800, Walter Wu wrote: > > > > diff --git a/include/linux/set_memory.h > > > >

Re: [PATCH 10/10] dma-direct: add a dma_direct_use_pool helper

2021-11-04 Thread Robin Murphy
On 2021-10-21 10:06, Christoph Hellwig wrote: Add a helper to check if a potentially blocking operation should dip into the atomic pools. Reviewed-by: Robin Murphy Signed-off-by: Christoph Hellwig --- kernel/dma/direct.c | 18 -- 1 file changed, 12 insertions(+), 6

Re: [PATCH 09/10] dma-direct: factor the swiotlb code out of __dma_direct_alloc_pages

2021-11-04 Thread Robin Murphy
On 2021-10-21 10:06, Christoph Hellwig wrote: Add a new helper to deal with the swiotlb case. This keeps the code nicely boundled and removes the not required call to dma_direct_optimal_gfp_mask for the swiotlb case. Reviewed-by: Robin Murphy Signed-off-by: Christoph Hellwig ---

Re: [PATCH 08/10] dma-direct: drop two CONFIG_DMA_RESTRICTED_POOL conditionals

2021-11-04 Thread Robin Murphy
On 2021-10-21 10:06, Christoph Hellwig wrote: swiotlb_alloc and swiotlb_free are properly stubbed out if CONFIG_DMA_RESTRICTED_POOL is not set, so skip the extra checks. Reviewed-by: Robin Murphy Signed-off-by: Christoph Hellwig --- kernel/dma/direct.c | 6 ++ 1 file changed, 2

Re: [PATCH 07/10] dma-direct: warn if there is no pool for force unencrypted allocations

2021-11-04 Thread Robin Murphy
On 2021-10-21 10:06, Christoph Hellwig wrote: Instead of blindly running into a blocking operation for a non-blocking gfp, return NULL and spew an error. Note that Kconfig prevents this for all currently relevant platforms, and this is just a debug check. Reviewed-by: Robin Murphy

Re: [PATCH 05/10] dma-direct: factor out a helper for DMA_ATTR_NO_KERNEL_MAPPING allocations

2021-11-04 Thread Robin Murphy
On 2021-10-21 10:06, Christoph Hellwig wrote: Split the code for DMA_ATTR_NO_KERNEL_MAPPING allocations into a separate helper to make dma_direct_alloc a little more readable. Signed-off-by: Christoph Hellwig Acked-by: David Rientjes --- kernel/dma/direct.c | 31

Re: [PATCH 06/10] dma-direct: refactor the !coherent checks in dma_direct_alloc

2021-11-04 Thread Robin Murphy
On 2021-10-21 10:06, Christoph Hellwig wrote: Add a big central !dev_is_dma_coherent(dev) block to deal with as much as of the uncached allocation schemes and document the schemes a bit better. Signed-off-by: Christoph Hellwig --- kernel/dma/direct.c | 58

Re: [PATCH 04/10] dma-direct: clean up the remapping checks in dma_direct_alloc

2021-11-04 Thread Robin Murphy
On 2021-10-21 10:06, Christoph Hellwig wrote: Add a local variable to track if we want to remap the returned address using vmap and use that to simplify the code flow. Signed-off-by: Christoph Hellwig --- kernel/dma/direct.c | 47 +++-- 1 file

Re: [PATCH 03/10] dma-direct: leak memory that can't be re-encrypted

2021-11-04 Thread Robin Murphy
On 2021-10-21 10:06, Christoph Hellwig wrote: We must never unencryped memory go back into the general page pool. So if we fail to set it back to encrypted when freeing DMA memory, leak the memory insted and warn the user. Signed-off-by: Christoph Hellwig --- kernel/dma/direct.c | 18

Re: [PATCH 02/10] dma-direct: unmapped remapped pages when dma_set_decrypted

2021-11-04 Thread Robin Murphy
On 2021-10-21 10:06, Christoph Hellwig wrote: When dma_set_decrypted fails for the remapping case in dma_direct_alloc we also need to unmap the pages before freeing them. Signed-off-by: Christoph Hellwig --- kernel/dma/direct.c | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff

Re: [PATCH 01/10] dma-direct: factor out dma_set_{de,en}crypted helpers

2021-11-04 Thread Robin Murphy
On 2021-10-21 10:06, Christoph Hellwig wrote: Factor out helpers the make dealing with memory encryption a little less cumbersome. Reviewed-by: Robin Murphy Signed-off-by: Christoph Hellwig --- kernel/dma/direct.c | 56 - 1 file changed, 25

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_memory.h > > > index

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_memory.h > > +++

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

2021-11-04 Thread Ard Biesheuvel
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_memory.h > > index f36be5166c19..6c7d1683339c 100644 > > --- a/include/linux/set_memory.h > > +++

Re: dma-direct fixes and cleanups v2

2021-11-04 Thread Christoph Hellwig
Any comments? On Thu, Oct 21, 2021 at 11:06:01AM +0200, Christoph Hellwig wrote: > Hi all, > > Linus complained about the complex flow in dma_direct_alloc, so this > tries to simplify it a bit, and while I was at it I also made sure that > unencrypted pages never leak back into the page

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

2021-11-04 Thread Christoph Hellwig
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_memory.h > +++ b/include/linux/set_memory.h > @@ -7,11 +7,16 @@ > > #ifdef

[PATCH] iommu: log iova range in map/unmap trace events

2021-11-04 Thread Dafna Hirschfeld
In case of an iommu page fault, the faulting iova is logged in trace_io_page_fault. It is therefore convenient to log the iova range in mapping/unmapping trace events so that it is easier to see if the faulting iova was recently in any of those ranges. Signed-off-by: Dafna Hirschfeld ---