Re: [PATCH v3 3/7] dma-mapping: Keep DMA memory private for capable devices
From: Jason Gunthorpe
Date: Wed Nov 25 2026 - 13:08:07 EST
> Architecture code can require devices to use unencrypted memory. This makes
> the DMA API use shared memory for coherent allocations and bounce streaming
> mappings through SWIOTLB.
>
> A device marked with DEV_FLAG_DMA_CC_PRIVATE is able to reach the private
> memory directly. Add dma_require_unencrypted() that combines the new flag
> with force_dma_unencrypted(), and use it in the generic DMA code. Also use
> "unencrypted" in the local variables that hold its result, to avoid mixing
> the "unencrypted" and "decrypted" terms.
>
> Signed-off-by: Nicolin Chen <nicolinc@xxxxxxxxxx>
> ---
> include/linux/dma-direct.h | 7 ++++++-
> kernel/dma/direct.c | 21 +++++++++++----------
> kernel/dma/mapping.c | 2 +-
> kernel/dma/swiotlb.c | 2 +-
> 4 files changed, 19 insertions(+), 13 deletions(-)
This looks OK to me, when Aneesh made his changes it was intended to
support a change like this, which is why it is so small..
Reviewed-by: Jason Gunthorpe <jgg@xxxxxxxxxx>
--
Jason