linux-yocto/kernel/dma
Shanker Donthineni 9a0b5fdce1 dma/pool: Ensure DMA_DIRECT_REMAP allocations are decrypted
commit 89a2d212bdb4bc29bed8e7077abe054b801137ea upstream.

When CONFIG_DMA_DIRECT_REMAP is enabled, atomic pool pages are
remapped via dma_common_contiguous_remap() using the supplied
pgprot. Currently, the mapping uses
pgprot_dmacoherent(PAGE_KERNEL), which leaves the memory encrypted
on systems with memory encryption enabled (e.g., ARM CCA Realms).

This can cause the DMA layer to fail or crash when accessing the
memory, as the underlying physical pages are not configured as
expected.

Fix this by requesting a decrypted mapping in the vmap() call:
pgprot_decrypted(pgprot_dmacoherent(PAGE_KERNEL))

This ensures that atomic pool memory is consistently mapped
unencrypted.

Cc: stable@vger.kernel.org
Signed-off-by: Shanker Donthineni <sdonthineni@nvidia.com>
Reviewed-by: Catalin Marinas <catalin.marinas@arm.com>
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Link: https://lore.kernel.org/r/20250811181759.998805-1-sdonthineni@nvidia.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2025-09-04 14:28:47 +02:00
..
coherent.c dma-mapping: clear dev->dma_mem to NULL after freeing it 2024-01-25 14:52:38 -08:00
contiguous.c dma/contiguous: avoid warning about unused size_bytes 2025-05-02 07:44:29 +02:00
debug.c dma-debug: fix a possible deadlock on radix_lock 2024-12-14 19:51:38 +01:00
debug.h
direct.c
direct.h
dummy.c
Kconfig
Makefile
map_benchmark.c dma-mapping: benchmark: Don't starve others when doing the test 2024-09-12 11:07:48 +02:00
mapping.c dma: fix call order in dmam_free_coherent 2024-08-19 05:45:23 +02:00
ops_helpers.c
pool.c dma/pool: Ensure DMA_DIRECT_REMAP allocations are decrypted 2025-09-04 14:28:47 +02:00
remap.c
swiotlb.c memblock: drop memblock_free_early_nid() and memblock_free_early() 2025-03-13 12:50:07 +01:00