Re: [PATCH v2] dma-direct: set decrypted flag for remapped DMA allocations

From: Linus Walleij

Date: Wed Jan 07 2026 - 09:26:28 EST


On Mon, Jan 5, 2026 at 6:53 PM Jason Gunthorpe <jgg@xxxxxxxx> wrote:
>
> On Fri, Jan 02, 2026 at 09:20:37PM +0530, Aneesh Kumar K.V (Arm) wrote:
> > Devices that are DMA non-coherent and require a remap were skipping
> > dma_set_decrypted(), leaving DMA buffers encrypted even when the device
> > requires unencrypted access. Move the call after the if (remap) branch
> > so that both the direct and remapped allocation paths correctly mark the
> > allocation as decrypted (or fail cleanly) before use.
>
> This is probably fine, but IMHO, we should be excluding the
> combination of highmem and CC at the kconfig level :\

The only way you can get CMA in highmem is by passing in a highmem
location to the allocator from the command line.

I have a strong urge to just patch CMA to not allow that and see what
happens. Or at least have it print a big fat warning that this will go
away soon.

I think this is only used on legacy ARM32 products that are no longer
maintained, but I might be wrong.

Yours,
Linus Walleij