linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [patch 0/7] unencrypted atomic DMA pools with dynamic expansion
@ 2020-04-15  0:04 David Rientjes
  2020-04-15  0:04 ` [patch 1/7] dma-remap: separate DMA atomic pools from direct remap code David Rientjes
                   ` (7 more replies)
  0 siblings, 8 replies; 14+ messages in thread
From: David Rientjes @ 2020-04-15  0:04 UTC (permalink / raw)
  To: Christoph Hellwig, Tom Lendacky
  Cc: Brijesh Singh, Jon Grimm, Joerg Roedel, linux-kernel, iommu,
	Thomas Gleixner, Ingo Molnar, Borislav Petkov, x86

set_memory_decrypted() may block so it is not possible to do non-blocking
allocations through the DMA API for devices that required unencrypted
memory.

The solution is to expand the atomic DMA pools for the various possible
gfp requirements as a means to prevent an unnecessary depletion of lowmem.
These atomic pools are separated from the remap code and can be selected
for configurations that need them outside the scope of
CONFIG_DMA_DIRECT_REMAP, such as CONFIG_AMD_MEM_ENCRYPT.

These atomic DMA pools are kept unencrypted so they can immediately be
used for non-blocking allocations.  Since the need for this type of memory
depends on the kernel config and devices being used, these pools are also
dynamically expandable.

The sizes of the various atomic DMA pools is exported through debugfs at
/sys/kernel/debug/dma_pools.

This patchset is based on latest Linus HEAD:

commit 8632e9b5645bbc2331d21d892b0d6961c1a08429
Merge: 6cc9306b8fc0 f3a99e761efa
Author: Linus Torvalds <torvalds@linux-foundation.org>
Date:   Tue Apr 14 11:58:04 2020 -0700

    Merge tag 'hyperv-fixes-signed' of git://git.kernel.org/pub/scm/linux/kernel/git/hyperv/linux
---
 arch/x86/Kconfig            |   1 +
 drivers/iommu/dma-iommu.c   |   5 +-
 include/linux/dma-direct.h  |   2 +
 include/linux/dma-mapping.h |   6 +-
 kernel/dma/Kconfig          |   6 +-
 kernel/dma/Makefile         |   1 +
 kernel/dma/direct.c         |  56 ++++++--
 kernel/dma/pool.c           | 275 ++++++++++++++++++++++++++++++++++++
 kernel/dma/remap.c          | 114 ---------------
 9 files changed, 334 insertions(+), 132 deletions(-)
 create mode 100644 kernel/dma/pool.c

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

end of thread, other threads:[~2020-04-17 18:42 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-15  0:04 [patch 0/7] unencrypted atomic DMA pools with dynamic expansion David Rientjes
2020-04-15  0:04 ` [patch 1/7] dma-remap: separate DMA atomic pools from direct remap code David Rientjes
2020-04-17  7:06   ` Christoph Hellwig
2020-04-15  0:04 ` [patch 2/7] dma-pool: add additional coherent pools to map to gfp mask David Rientjes
2020-04-15  0:04 ` [patch 3/7] dma-pool: dynamically expanding atomic pools David Rientjes
2020-04-15  0:04 ` [patch 4/7] dma-direct: atomic allocations must come from atomic coherent pools David Rientjes
2020-04-17  7:09   ` Christoph Hellwig
2020-04-15  0:04 ` [patch 5/7] dma-pool: add pool sizes to debugfs David Rientjes
2020-04-15 13:45   ` Tom Lendacky
2020-04-17  7:10     ` Christoph Hellwig
2020-04-15  0:05 ` [patch 6/7] x86/mm: unencrypted non-blocking DMA allocations use coherent pools David Rientjes
2020-04-15  0:05 ` [patch 7/7] dma-pool: scale the default DMA coherent pool size with memory capacity David Rientjes
2020-04-17  7:11 ` [patch 0/7] unencrypted atomic DMA pools with dynamic expansion Christoph Hellwig
2020-04-17 18:41   ` David Rientjes

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).