Re: [PATCH v2 4/4] coco/tdx-host: Initialize trusted DMA on all capable IOMMUs
From: Baolu Lu
Date: Mon Oct 19 2026 - 04:17:34 EST
On 10/16/2026 10:58 PM, Jason Gunthorpe wrote:
On Fri, Oct 16, 2026 at 03:03:23PM +0800, Baolu Lu wrote:
On 10/16/2026 1:37 AM, Jason Gunthorpe wrote:Okay, I haven't looked, not sure what is in cca_psmmu_get() yet
On Thu, Oct 15, 2026 at 04:31:31PM +0800, Xu Yilun wrote:Yes, agreed. The Intel iommu driver could use per-device interfaces,
An alternative could be, bringing up one IOMMU when an associatedThat is what ARM is planning to do. I think it is reasonable to
device requests link encryption. Then a no-tdx-support iommu fails the
encryption request naturally.
trigger creation of the secure iommu when the TSM is connected to TDX.
Fail connect if the iommu could not be created.
just as ARM is planning. There are some differences, though.
ARM's interaction with the iommu driver in viommu_init() appears to
consist of two steps:
- arm_smmu_get_realm_params(dev, ¶ms): get and validate the
physical iommu information from the arm-smmu-v3 driver;
- cca_psmmu_get(¶ms): activate the physical smmu for Realm use.
So the Intel iommu driver will probably end up with interfaces like:It seems OK
- dmar_tdxcs_iommu_init(struct device *dev, ...);
- dmar_tdxcs_iommu_release(struct device *dev, ...);
These would be called from the connect and disconnect callbacks of
the TDX link ops:
It sounds like you will have a one time init of the secure iommu at
the time the first PCI device wants to use the TSM? It seems like no
problem.
Yes.