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

From: Alexey Kardashevskiy

Date: Wed Apr 29 2026 - 23:31:45 EST




On 21/4/26 09:50, Jason Gunthorpe wrote:
On Wed, Apr 15, 2026 at 04:32:14PM +1000, Alexey Kardashevskiy wrote:
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.

Something like that?

https://github.com/AMDESE/linux-kvm/commit/266a41a1ea746557eb63debce886ce2c98820667

With some little hacks I can make this tree do TDISP DMA to private or shared (swiotlb) memory by steering via this vTOM thing. Thanks,

Ping? Thanks,

That seems approx right, it is broadl similar to what ARM is
doing.. But the address map changes when switching to T=1 for AMD?

Well, at the moment, in my WIP tree, I map the guest memory in the host IOMMU twice -

1) from 0 offset (and this is shared when T=0 and private when T=1) and
2) from vTOM offset (say, 1TB) - and this half of the mapping is always shared.

Thanks,


--
Alexey