Backport unencrypted non-blocking DMA allocations
Get series with b4
b4 am [email protected]Versions newest first
- v1 Latest30 patches 8 repliesIn review
Patches in v1 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/30 | dma-direct: remove __dma_direct_free_pagesinclude/ kernel/ kernel/ | +5 | 0 replies | |
| 2/30 | dma-direct: remove the dma_handle argument to __dma_direct_alloc_pagesinclude/ kernel/ kernel/ | +4 | 0 replies | |
| 3/30 | dma-direct: provide mmap and get_sgtable method overridesarch/ arch/ arch/ +13 more | +85 | 0 replies | |
| 4/30 | dma-mapping: merge the generic remapping helpers into dma-directkernel/ kernel/ | +48 | 0 replies | |
| 5/30 | lib/genalloc.c: rename addr_in_gen_pool to gen_pool_has_addrDocumentation/ arch/ drivers/ +3 more | +8 | 0 replies | |
| 6/30 | dma-remap: separate DMA atomic pools from direct remap codekernel/ kernel/ kernel/ +1 more | +130 | 0 replies | |
| 7/30 | dma-pool: add additional coherent pools to map to gfp maskdrivers/ include/ include/ +2 more | +90 | 0 replies | |
| 8/30 | dma-pool: dynamically expanding atomic poolskernel/ | +84 | 0 replies | |
| 9/30 | dma-direct: atomic allocations must come from atomic coherent poolskernel/ kernel/ | +63 | 0 replies | |
| 10/30 | dma-pool: add pool sizes to debugfskernel/ | +30 | 0 replies | |
| 11/30 | x86/mm: unencrypted non-blocking DMA allocations use coherent poolsarch/ | +1 | 0 replies | |
| 12/30 | dma-pool: scale the default DMA coherent pool size with memory capacitykernel/ | +12 | 0 replies | |
| 13/30 | dma-pool: fix too large DMA pools on medium memory size systemskernel/ | +3 | 0 replies | |
| 14/30 | dma-pool: decouple DMA_REMAP from DMA_COHERENT_POOLkernel/ | +5 | 0 replies | |
| 15/30 | dma-direct: consolidate the error handling in dma_direct_alloc_pageskernel/ | +6 | 0 replies | |
| 16/30 | xtensa: use the generic uncached segment supportarch/ arch/ arch/ +1 more | +18 | 0 replies | |
| 17/30 | dma-direct: make uncached_kernel_address more generalarch/ arch/ arch/ +8 more | +21 | 0 replies | |
| 18/30 | dma-direct: always align allocation size in dma_direct_alloc_pages()kernel/ | +10 | 0 replies | |
| 19/30 | dma-direct: re-encrypt memory if dma_direct_alloc_pages() failskernel/ | +6 | 0 replies | |
| 20/30 | dma-direct: check return value when encrypting or decrypting memorykernel/ | +14 | 0 replies | |
| 21/30 | dma-direct: add missing set_memory_decrypted() for coherent mappingkernel/ | +6 | 0 replies | |
| 22/30 | dma-mapping: DMA_COHERENT_POOL should select GENERIC_ALLOCATORkernel/ | +1 | 0 replies | |
| 23/30 | dma-mapping: warn when coherent pool is depletedkernel/ | +5 | 0 replies | |
| 24/30 | dma-direct: provide function to check physical memory area validityinclude/ kernel/ | +2 | 0 replies | |
| 25/30 | dma-pool: get rid of dma_in_atomic_pool()kernel/ | +1 | 0 replies | |
| 26/30 | dma-pool: introduce dma_guess_pool()kernel/ | +23 | 0 replies | |
| 27/30 | dma-pool: make sure atomic pool suits devicekernel/ | +37 | 0 replies | |
| 28/30 | dma-pool: do not allocate pool memory from CMAkernel/ | +2 | 0 replies | |
| 29/30 | dma-pool: fix coherent pool allocations for IOMMU mappingsdrivers/ include/ include/ +2 more | +61 | 0 replies | |
| 30/30 | dma/direct: turn ARCH_ZONE_DMA_BITS into a variablearch/ arch/ arch/ +4 more | +32 | 0 replies |
Reviews trailers per patch
13 of 30 patches have a Reviewed-by or Acked-by.
| Patch | Max Filippov | Andrew Morton | Christoph Hellwig | David Rientjes | Alex Xu (Hello71) | Robin Murphy | Guenter Roeck | Jeremy Linton | Amit Pundir |
|---|---|---|---|---|---|---|---|---|---|
| 1/30 | R-b | ||||||||
| 2/30 | R-b | ||||||||
| 3/30 | R-b | ||||||||
| 4/30 | R-b | ||||||||
| 5/30 | R-b | ||||||||
| 6/30 | R-b | ||||||||
| 7/30 | |||||||||
| 8/30 | |||||||||
| 9/30 | |||||||||
| 10/30 | |||||||||
| 11/30 | |||||||||
| 12/30 | |||||||||
| 13/30 | A-b | ||||||||
| 14/30 | T-b | ||||||||
| 15/30 | R-b | ||||||||
| 16/30 | R-b T-b | ||||||||
| 17/30 | R-b | ||||||||
| 18/30 | |||||||||
| 19/30 | |||||||||
| 20/30 | |||||||||
| 21/30 | |||||||||
| 22/30 | A-b | ||||||||
| 23/30 | T-b | ||||||||
| 24/30 | |||||||||
| 25/30 | |||||||||
| 26/30 | |||||||||
| 27/30 | |||||||||
| 28/30 | A-b | T-b | |||||||
| 29/30 | T-b | ||||||||
| 30/30 | A-b |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 9 reviewers.
Cover letter [PATCH 00/30 for 5.4] Backport unencrypted non-blocking DMA allocations
Currently SEV enabled guests hit might_sleep() warnings when a driver (nvme in this case) allocates through the DMA API in a non-blockable context. Making these unencrypted non-blocking DMA allocations come from the coherent pools prevents this BUG.
BUG: sleeping function called from invalid context at mm/vmalloc.c:1710
in_atomic(): 1, irqs_disabled(): 0, non_block: 0, pid: 3383, name: fio
2 locks held by fio/3383:
#0: ffff93b6a8568348 (&sb->s_type->i_mutex_key#16){+.+.}, at: ext4_file_write_iter+0xa2/0x5d0 #1: ffffffffa52a61a0 (rcu_read_lock){....}, at: hctx_lock+0x1a/0xe0
CPU: 0 PID: 3383 Comm: fio Tainted: G W 5.5.10 #14 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Call Trace: dump_stack+0x98/0xd5 ___might_sleep+0x175/0x260 __might_sleep+0x4a/0x80 _vm_unmap_aliases+0x45/0x250 vm_unmap_aliases+0x19/0x20 __set_memory_enc_dec+0xa4/0x130 set_memory_decrypted+0x10/0x20 dma_direct_alloc_pages+0x148/0x150 dma_direct_alloc+0xe/0x10 dma_alloc_attrs+0x86/0xc0 dma_pool_alloc+0x16f/0x2b0 nvme_queue_rq+0x878/0xc30 [nvme] __blk_mq_try_issue_directly+0x135/0x200 blk_mq_request_issue_directly+0x4f/0x80 blk_mq_try_issue_list_directly+0x46/0xb0 blk_mq_sched_insert_requests+0x19b/0x2b0 blk_mq_flush_plug_list+0x22f/0x3b0 blk_flush_plug_list+0xd1/0x100 blk_finish_plug+0x2c/0x40 iomap_dio_rw+0x427/0x490 ext4_file_write_iter+0x181/0x5d0 aio_write+0x109/0x1b0 io_submit_one+0x7d0/0xfa0 __x64_sys_io_submit+0xa2/0x280 do_syscall_64+0x5f/0x250 entry_SYSCALL_64_after_hwframe+0x49/0xbe
Christoph Hellwig (9):
dma-direct: remove __dma_direct_free_pages
dma-direct: remove the dma_handle argument to __dma_direct_alloc_pages
dma-direct: provide mmap and get_sgtable method overrides
dma-mapping: merge the generic remapping helpers into dma-direct
dma-direct: consolidate the error handling in dma_direct_alloc_pages
xtensa: use the generic uncached segment support
dma-direct: make uncached_kernel_address more general
dma-mapping: DMA_COHERENT_POOL should select GENERIC_ALLOCATOR
dma-pool: fix coherent pool allocations for IOMMU mappings
David Rientjes (13):
dma-remap: separate DMA atomic pools from direct remap code
dma-pool: add additional coherent pools to map to gfp mask
dma-pool: dynamically expanding atomic pools
dma-direct: atomic allocations must come from atomic coherent pools
dma-pool: add pool sizes to debugfs
x86/mm: unencrypted non-blocking DMA allocations use coherent pools
dma-pool: scale the default DMA coherent pool size with memory
capacity
dma-pool: decouple DMA_REMAP from DMA_COHERENT_POOL
dma-direct: always align allocation size in dma_direct_alloc_pages()
dma-direct: re-encrypt memory if dma_direct_alloc_pages() fails
dma-direct: check return value when encrypting or decrypting memory
dma-direct: add missing set_memory_decrypted() for coherent mapping
dma-mapping: warn when coherent pool is depleted
Geert Uytterhoeven (1):
dma-pool: fix too large DMA pools on medium memory size systems
Huang Shijie (1):
lib/genalloc.c: rename addr_in_gen_pool to gen_pool_has_addr
Nicolas Saenz Julienne (6):
dma-direct: provide function to check physical memory area validity
dma-pool: get rid of dma_in_atomic_pool()
dma-pool: introduce dma_guess_pool()
dma-pool: make sure atomic pool suits device
dma-pool: do not allocate pool memory from CMA dma/direct: turn ARCH_ZONE_DMA_BITS into a variable
Documentation/core-api/genalloc.rst | 2 +- arch/Kconfig | 8 +- arch/arc/Kconfig | 1 - arch/arm/Kconfig | 1 - arch/arm/mm/dma-mapping.c | 8 +- arch/arm64/Kconfig | 1 - arch/arm64/mm/init.c | 9 +- arch/ia64/Kconfig | 2 +- arch/ia64/kernel/dma-mapping.c | 6 - arch/microblaze/Kconfig | 3 +- arch/microblaze/mm/consistent.c | 2 +- arch/mips/Kconfig | 7 +- arch/mips/mm/dma-noncoherent.c | 8 +- arch/nios2/Kconfig | 3 +- arch/nios2/mm/dma-mapping.c | 2 +- arch/powerpc/include/asm/page.h | 9 - arch/powerpc/mm/mem.c | 20 +- arch/powerpc/platforms/Kconfig.cputype | 1 - arch/s390/include/asm/page.h | 2 - arch/s390/mm/init.c | 1 + arch/x86/Kconfig | 1 + arch/xtensa/Kconfig | 6 +- arch/xtensa/include/asm/platform.h | 27 --- arch/xtensa/kernel/Makefile | 3 +- arch/xtensa/kernel/pci-dma.c | 121 ++--------- drivers/iommu/dma-iommu.c | 5 +- drivers/misc/sram-exec.c | 2 +- include/linux/dma-direct.h | 12 +- include/linux/dma-mapping.h | 7 +- include/linux/dma-noncoherent.h | 4 +- include/linux/genalloc.h | 2 +- kernel/dma/Kconfig | 20 +- kernel/dma/Makefile | 1 + kernel/dma/direct.c | 224 ++++++++++++++++---- kernel/dma/mapping.c | 45 +---- kernel/dma/pool.c | 270 +++++++++++++++++++++++++ kernel/dma/remap.c | 176 +--------------- lib/genalloc.c | 5 +- 38 files changed, 564 insertions(+), 463 deletions(-) create mode 100644 kernel/dma/pool.c
Signature · 1 line
2.28.0.618.gf4bc123cb7-goog