From: Baolu Lu <baolu.lu@linux.intel.com>
To: Jason Gunthorpe <jgg@ziepe.ca>, Xu Yilun <yilun.xu@linux.intel.com>
Cc: baolu.lu@linux.intel.com, iommu@lists.linux.dev, x86@kernel.org,
linux-coco@lists.linux.dev, kvm@vger.kernel.org,
Kevin Tian <kevin.tian@intel.com>,
Kiryl Shutsemau <kas@kernel.org>,
Rick Edgecombe <rick.p.edgecombe@intel.com>,
xiaoyao.li@intel.com, Chao Gao <chao.gao@intel.com>,
Binbin Wu <binbin.wu@linux.intel.com>,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2 4/4] coco/tdx-host: Initialize trusted DMA on all capable IOMMUs
Date: Fri, 16 Oct 2026 15:03:23 +0800 [thread overview]
Message-ID: <5ca5f1c4-4c3c-47f1-b79c-c1fe06b20ee4@linux.intel.com> (raw)
In-Reply-To: <20261015173707.GV14213@ziepe.ca>
On 10/16/2026 1:37 AM, Jason Gunthorpe wrote:
> On Thu, Oct 15, 2026 at 04:31:31PM +0800, Xu Yilun wrote:
>
>> An alternative could be, bringing up one IOMMU when an associated
>> device requests link encryption. Then a no-tdx-support iommu fails the
>> encryption request naturally.
> That is what ARM is planning to do. I think it is reasonable to
> trigger creation of the secure iommu when the TSM is connected to TDX.
>
> Fail connect if the iommu could not be created.
Yes, agreed. The Intel iommu driver could use per-device interfaces,
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.
Intel differs in two ways:
- ARM queries the physical iommu information from the iommu driver
in the viommu_init() path. On Intel, the secure iommu must be set
up during TSM connect, because it is part of establishing PCIe
link encryption.
- The TDX Connect architecture places requirements on the host
iommu driver while the secure IOMMU is being set up. For example,
the host iommu driver must block the enhanced command (ECMD)
interface while the TDH.IOMMU.SETUP SEAMCALL runs, and it must
reserve the upper half of the domain ID space. These steps have
to happen atomically under the iommu driver's own locks. As a
result, the Intel iommu driver needs to merge the two steps above
into one.
So the Intel iommu driver will probably end up with interfaces like:
- 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:
static struct pci_tsm_ops tdx_tsm_link_ops = {
.owner = THIS_MODULE,
.probe = tdx_tsm_link_probe,
.remove = tdx_tsm_link_remove,
.connect = tdx_tsm_link_connect,
.disconnect = tdx_tsm_link_disconnect,
...
};
Any thoughts?
Thanks,
baolu
next prev parent reply other threads:[~2026-10-16 7:03 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-15 1:07 [PATCH v2 0/4] coco/tdx-host: Introduce trusted DMA initialization support Lu Baolu
2026-10-15 1:07 ` [PATCH v2 1/4] x86/virt/tdx: Add SEAMCALL wrappers for IOMMU setup/clear Lu Baolu
2026-10-15 6:34 ` Xu Yilun
2026-10-15 1:07 ` [PATCH v2 2/4] x86/virt/tdx: Read global metadata for trusted IOMMU Lu Baolu
2026-10-15 6:47 ` Xu Yilun
2026-10-16 7:59 ` Tian, Kevin
2026-10-15 1:07 ` [PATCH v2 3/4] iommu/vt-d: Add an API for tdx-host when enabling trusted DMA Lu Baolu
2026-10-15 1:07 ` [PATCH v2 4/4] coco/tdx-host: Initialize trusted DMA on all capable IOMMUs Lu Baolu
2026-10-15 8:31 ` Xu Yilun
2026-10-15 17:37 ` Jason Gunthorpe
2026-10-16 7:03 ` Baolu Lu [this message]
2026-10-16 7:17 ` Tian, Kevin
2026-10-16 14:58 ` Jason Gunthorpe
2026-10-16 14:58 ` Jason Gunthorpe
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=5ca5f1c4-4c3c-47f1-b79c-c1fe06b20ee4@linux.intel.com \
--to=baolu.lu@linux.intel.com \
--cc=binbin.wu@linux.intel.com \
--cc=chao.gao@intel.com \
--cc=iommu@lists.linux.dev \
--cc=jgg@ziepe.ca \
--cc=kas@kernel.org \
--cc=kevin.tian@intel.com \
--cc=kvm@vger.kernel.org \
--cc=linux-coco@lists.linux.dev \
--cc=linux-kernel@vger.kernel.org \
--cc=rick.p.edgecombe@intel.com \
--cc=x86@kernel.org \
--cc=xiaoyao.li@intel.com \
--cc=yilun.xu@linux.intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox