linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [patch for-5.8] dma-pool: decouple DMA_REMAP from DMA_COHERENT_POOL
@ 2020-06-11  7:25 David Rientjes
  2020-06-11 14:49 ` Alex Xu (Hello71)
  2020-06-15  6:36 ` Christoph Hellwig
  0 siblings, 2 replies; 3+ messages in thread
From: David Rientjes @ 2020-06-11  7:25 UTC (permalink / raw)
  To: Christoph Hellwig
  Cc: Alex Xu (Hello71),
	alsa-devel, bp, hch, hpa, linux-kernel, mingo, Pavel Machek,
	perex, tglx, tiwai, x86

DMA_REMAP is an unnecessary requirement for AMD SEV, which requires 
DMA_COHERENT_POOL, so avoid selecting it when it is otherwise unnecessary.  

The only other requirement for DMA coherent pools is DMA_DIRECT_REMAP, so 
ensure that properly selects the config option when needed.

Fixes: 82fef0ad811f ("x86/mm: unencrypted non-blocking DMA allocations use 
coherent pools")
Suggested-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: David Rientjes <rientjes@google.com>
---
 kernel/dma/Kconfig | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/kernel/dma/Kconfig b/kernel/dma/Kconfig
--- a/kernel/dma/Kconfig
+++ b/kernel/dma/Kconfig
@@ -73,18 +73,18 @@ config SWIOTLB
 config DMA_NONCOHERENT_MMAP
 	bool
 
+config DMA_COHERENT_POOL
+	bool
+
 config DMA_REMAP
+	bool
 	depends on MMU
 	select GENERIC_ALLOCATOR
 	select DMA_NONCOHERENT_MMAP
-	bool
-
-config DMA_COHERENT_POOL
-	bool
-	select DMA_REMAP
 
 config DMA_DIRECT_REMAP
 	bool
+	select DMA_REMAP
 	select DMA_COHERENT_POOL
 
 config DMA_CMA

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [patch for-5.8] dma-pool: decouple DMA_REMAP from DMA_COHERENT_POOL
  2020-06-11  7:25 [patch for-5.8] dma-pool: decouple DMA_REMAP from DMA_COHERENT_POOL David Rientjes
@ 2020-06-11 14:49 ` Alex Xu (Hello71)
  2020-06-15  6:36 ` Christoph Hellwig
  1 sibling, 0 replies; 3+ messages in thread
From: Alex Xu (Hello71) @ 2020-06-11 14:49 UTC (permalink / raw)
  To: Christoph Hellwig, David Rientjes
  Cc: alsa-devel, bp, hch, hpa, linux-kernel, mingo, Pavel Machek,
	perex, tglx, tiwai, x86

Excerpts from David Rientjes's message of June 11, 2020 3:25 am:
> DMA_REMAP is an unnecessary requirement for AMD SEV, which requires 
> DMA_COHERENT_POOL, so avoid selecting it when it is otherwise unnecessary.  
> 
> The only other requirement for DMA coherent pools is DMA_DIRECT_REMAP, so 
> ensure that properly selects the config option when needed.
> 
> Fixes: 82fef0ad811f ("x86/mm: unencrypted non-blocking DMA allocations use 
> coherent pools")
> Suggested-by: Christoph Hellwig <hch@lst.de>
> Signed-off-by: David Rientjes <rientjes@google.com>
> ---
>  kernel/dma/Kconfig | 10 +++++-----
>  1 file changed, 5 insertions(+), 5 deletions(-)
> 

Works for me with SME on or off with af7b480103, and with SME off in 
abfbb29297. There is some regression with amdgpu and SME between those 
two points, I need to check that out too. I haven't tested either before 
or after with SEV (which I'm not even sure my system supports). 
Regardless, this is a definite improvement.

Tested-by: Alex Xu (Hello71) <alex_y_xu@yahoo.ca>

Thanks,
Alex.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [patch for-5.8] dma-pool: decouple DMA_REMAP from DMA_COHERENT_POOL
  2020-06-11  7:25 [patch for-5.8] dma-pool: decouple DMA_REMAP from DMA_COHERENT_POOL David Rientjes
  2020-06-11 14:49 ` Alex Xu (Hello71)
@ 2020-06-15  6:36 ` Christoph Hellwig
  1 sibling, 0 replies; 3+ messages in thread
From: Christoph Hellwig @ 2020-06-15  6:36 UTC (permalink / raw)
  To: David Rientjes
  Cc: Christoph Hellwig, Alex Xu (Hello71),
	alsa-devel, bp, hch, hpa, linux-kernel, mingo, Pavel Machek,
	perex, tglx, tiwai, x86

Thanks,

applied, and will be pushed to Linus soon.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-06-15  6:36 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-06-11  7:25 [patch for-5.8] dma-pool: decouple DMA_REMAP from DMA_COHERENT_POOL David Rientjes
2020-06-11 14:49 ` Alex Xu (Hello71)
2020-06-15  6:36 ` Christoph Hellwig

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).