Re: [PATCH v3 1/9] x86/virt/tdx: Add SEAMCALL wrappers for IOMMU setup/clear

From: Baolu Lu

Date: Tue Nov 24 2026 - 21:47:31 EST


On 11/24/2026 4:07 PM, Tian, Kevin wrote:
From: Lu Baolu <baolu.lu@xxxxxxxxxxxxxxx>
Sent: Thursday, November 12, 2026 12:31 PM

Intel VT-d hardware gains a second set of DMA translation structures,
managed by the TDX module and used only for devices assigned to TDs.
Each IOMMU has a trusted root-table address register and a trusted
invalidation queue, both accessible only from SEAM. The existing
untrusted DMA translation path of the IOMMU stays under host control.

Before trusted DMA can be used through an IOMMU, the TDX module must
initialize these resources. TDH.IOMMU.SETUP does this: it puts the
IOMMU into Secure TDX Mode, programs the trusted root table and the

s/Secure TDX Mode/TDX mode/, across the series

Secure TDX Mode is the term used in TDX Connect ABI specification.


}
+
+/* No cache flush is needed; hardware keeps caches coherent across KeyIDs.
*/
+u64 tdh_iommu_setup(u64 reg_base, struct tdx_iommu_mt_param *param,
+ u64 *tdx_iommu_id)

No context why talking about cache flush here.

The kernel normally flushes the cache when handing pages over to
hardware or firmware. That isn't needed here because the hardware keeps
caches coherent across KeyIDs. The comment was meant to show that the
missing flush is intentional.

Thanks,
baolu