Re: [PATCH kernel 4/9] dma/swiotlb: Stop forcing SWIOTLB for TDISP devices
From: Jason Gunthorpe
Date: Wed Mar 04 2026 - 07:43:44 EST
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@xxxxxxxxxxx/
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