From: Baolu Lu <baolu.lu@linux.intel.com>
To: Binbin Wu <binbin.wu@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,
Jason Gunthorpe <jgg@ziepe.ca>, Kevin Tian <kevin.tian@intel.com>,
Kiryl Shutsemau <kas@kernel.org>,
Rick Edgecombe <rick.p.edgecombe@intel.com>,
yilun.xu@linux.intel.com, xiaoyao.li@intel.com,
Chao Gao <chao.gao@intel.com>,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH v3 7/9] coco/tdx-host: Add skeleton to support PCI link encryption
Date: Mon, 23 Nov 2026 12:18:32 +0800 [thread overview]
Message-ID: <d77bab15-3e35-4185-b328-99712f607435@linux.intel.com> (raw)
In-Reply-To: <de1011bc-1cc0-4409-af76-4e90dcef6cf4@linux.intel.com>
On 11/19/2026 10:52 AM, Binbin Wu wrote:
> On 11/12/2026 12:30 PM, Lu Baolu wrote:
>> Register a Link TSM instance to support host side TSM operations for
>> TDISP, when the TDX Connect support bit is set by TDX Module in
>> tdx_feature0.
>>
>> This is the main purpose of an independent tdx-host module out of TDX
>> core. Recall that a TEE Security Manager (TSM) is a platform agent that
>> speaks the TEE Device Interface Security Protocol (TDISP) to PCIe
>> devices and manages private memory resources for the platform. An
>> independent tdx-host module allows for device-security enumeration and
>> initialization flows to be deferred from other TDX Module initialization
>> requirements. Crucially, when / if TDX Module init moves earlier in x86
>> initialization flow this driver is still guaranteed to run after IOMMU
>> and PCI init (i.e. subsys_initcall() vs device_initcall()).
>>
>> The ability to unload the module, or unbind the driver is also useful
>> for debug and coarse grained transitioning between PCI TSM operation and
>> PCI CMA operation (native kernel PCI device authentication).
>>
>> For now only check for TDX Connect support in the TDX Module and
>> register the Link TSM. The TSM support is basic boilerplate with
>> operation flows to be added later.
>>
>> Based on work by Yilun and Dan.
>>
>> Signed-off-by: Lu Baolu<baolu.lu@linux.intel.com>
> [...]
>
>>
>> static int tdx_host_probe(struct faux_device *fdev)
>> {
>> - return seamldr_init(&fdev->dev);
>> + int ret;
>> +
>> + ret = seamldr_init(&fdev->dev);
>> + if (ret)
>> + return ret;
>> +
>> + return tdx_tdisp_init(&fdev->dev);
> If tdx_tdisp_init() fails, it will also disable TDX module update and the
> version sysfs attributes. If this is intended, could you add some description
> in the change log about it?
You are right. That side effect is unnecessary. Module update and the
version attributes don't depend on TDISP. How about fixing this by
making the TDISP failure non-fatal so tdx-host still provides module
update?
Something like:
-static int tdx_tdisp_init(struct device *dev)
+static void tdx_tdisp_init(struct device *dev)
{
const struct tdx_sys_info *sysinfo = tdx_get_sysinfo();
struct tsm_dev *link;
if (!sysinfo || !tdx_supports_tdisp(sysinfo))
- return 0;
+ return;
link = tsm_register(dev, &tdx_tsm_link_ops);
- if (IS_ERR(link))
- return dev_err_probe(dev, PTR_ERR(link),
- "failed to register TSM\n");
+ if (IS_ERR(link)) {
+ dev_warn(dev, "failed to register TSM: %pe\n", link);
+ return;
+ }
- return devm_add_action_or_reset(dev, unregister_link_tsm, link);
+ if (devm_add_action_or_reset(dev, unregister_link_tsm, link))
+ dev_warn(dev, "failed to register TSM cleanup\n");
}
@@
static int tdx_host_probe(struct faux_device *fdev)
{
int ret;
ret = seamldr_init(&fdev->dev);
if (ret)
return ret;
- return tdx_tdisp_init(&fdev->dev);
+ tdx_tdisp_init(&fdev->dev);
+
+ return 0;
}
Thanks,
baolu
next prev parent reply other threads:[~2026-11-23 4:18 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-12 4:30 [PATCH v3 0/9] coco/tdx-host: Introduce trusted DMA initialization support Lu Baolu
2026-11-12 4:30 ` [PATCH v3 1/9] x86/virt/tdx: Add SEAMCALL wrappers for IOMMU setup/clear Lu Baolu
2026-11-18 11:02 ` Binbin Wu
2026-11-23 4:03 ` Baolu Lu
2026-11-12 4:30 ` [PATCH v3 2/9] x86/virt/tdx: Read global metadata for trusted IOMMU Lu Baolu
2026-11-18 13:39 ` Binbin Wu
2026-11-23 4:09 ` Baolu Lu
2026-11-12 4:30 ` [PATCH v3 3/9] x86/virt/tdx: Export Dynamic PAMT helpers to tdx-host Lu Baolu
2026-11-12 4:30 ` [PATCH v3 4/9] iommu/vt-d: Add interface for tdx-host when enabling trusted DMA Lu Baolu
2026-11-12 4:30 ` [PATCH v3 5/9] iommu/vt-d: Block GCMD and ECMD while acquired by the TDX module Lu Baolu
2026-11-12 4:30 ` [PATCH v3 6/9] iommu/vt-d: Refuse system suspend " Lu Baolu
2026-11-12 4:30 ` [PATCH v3 7/9] coco/tdx-host: Add skeleton to support PCI link encryption Lu Baolu
2026-11-18 7:16 ` Chao Gao
2026-11-23 3:30 ` Baolu Lu
2026-11-19 2:52 ` Binbin Wu
2026-11-23 4:18 ` Baolu Lu [this message]
2026-11-12 4:30 ` [PATCH v3 8/9] coco/tdx-host: Rename tdx-host.c to main.c Lu Baolu
2026-11-12 4:30 ` [PATCH v3 9/9] coco/tdx-host: Enable trusted DMA on IOMMUs on device connect Lu Baolu
2026-11-18 8:11 ` Chao Gao
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=d77bab15-3e35-4185-b328-99712f607435@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