Re: [RFC PATCH v2 3/5] dma-mapping: Decrypt memory on remap
From: Jason Gunthorpe
Date: Mon Mar 30 2026 - 18:32:03 EST
On Mon, Mar 30, 2026 at 08:49:31PM +0000, Mostafa Saleh wrote:
> > The one place we should see a force_dma_unencrypted() is directly
> > before setting the flag.
>
> I will look more into this, but my main worry would be
> phys_to_dma_direct() and it's callers as I am not sure if is possible to
> preserve the alloction origin in all contexts.
I'd rather have a very small number of places that recover the phys &
flag through some convoluted logic than have it sprinkled all over the
place in ever layer..
The helpers were not helpful, they were much more confusing.
Jason