Re: [PATCH kernel 4/9] dma/swiotlb: Stop forcing SWIOTLB for TDISP devices

Jason Gunthorpe
2026-03-04T12:43:32Z

On Wed, Mar 04, 2026 at 05:45:31PM +1100, Alexey Kardashevskiy wrote:

> > I suspect AMD needs to use their vTOM feature to allow shared memory
> > to remain available to TDISP RUN with a high/low address split.
>
> I could probably do something about it bit I wonder what is the real
> live use case which requires leaking SME mask, have a live example
> which I could try recreating?

We need shared memory allocated through a DMABUF heap:

https://lore.kernel.org/all/20260223095136.225277-1-jiri@resnulli.us/

To work with all PCI devices in the system, TDISP or not.

Without this the ability for a TDISP device to ingest (encrypted) data
requires all kinds of memcpy..

So the DMA API should see the DMA_ATTR_CC_DECRYPTED and setup the
correct dma_dddr_t either by choosing the shared alias for the TDISP
device's vTOM, or setting the C bit in a vIOMMU S1.

Jason