Re: [PATCH v3 7/9] coco/tdx-host: Add skeleton to support PCI link encryption

From: Binbin Wu

Date: Wed Nov 18 2026 - 21:52:39 EST


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@xxxxxxxxxxxxxxx>

[...]

>
> 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?

> }
>
> static const struct faux_device_ops tdx_host_ops = {