Re: [PATCH v6 03/22] coco/tdx-host: Expose TDX module version

From: Xiaoyao Li

Date: Tue Mar 31 2026 - 06:24:26 EST


On 3/26/2026 4:43 PM, Chao Gao wrote:
For TDX module updates, userspace needs to select compatible update
versions based on the current module version. This design delegates
module selection complexity to userspace because TDX module update
policies are complex and version series are platform-specific.

For example, the 1.5.x series is for certain platform generations, while
the 2.0.x series is intended for others. And TDX module 1.5.x may be
updated to 1.5.y but not to 1.5.y+1.

Expose the TDX module version to userspace via sysfs to aid module
selection. Since the TDX faux device will drive module updates, expose
the version as its attribute.

One bonus of exposing TDX module version via sysfs is: TDX module
version information remains available even after dmesg logs are cleared.

== Background ==

The "faux device + device attribute" approach compares to other update
mechanisms as follows:

1. AMD SEV leverages an existing PCI device for the PSP to expose
metadata. TDX uses a faux device as it doesn't have PCI device
in its architecture.

2. Microcode uses per-CPU virtual devices to report microcode revisions
because CPUs can have different revisions. But, there is only a
single TDX module, so exposing the TDX module version through a global
TDX faux device is appropriate

3. ARM's CCA implementation isn't in-tree yet, but will likely follow a
similar faux device approach, though it's unclear whether they need
to expose firmware version information

Signed-off-by: Chao Gao<chao.gao@xxxxxxxxx>
Reviewed-by: Binbin Wu<binbin.wu@xxxxxxxxxxxxxxx>
Reviewed-by: Tony Lindgren<tony.lindgren@xxxxxxxxxxxxxxx>
Reviewed-by: Xu Yilun<yilun.xu@xxxxxxxxxxxxxxx>
Reviewed-by: Kai Huang<kai.huang@xxxxxxxxx>
Reviewed-by: Kiryl Shutsemau (Meta)<kas@xxxxxxxxxx>

Reviewed-by: Xiaoyao Li <xiaoyao.li@xxxxxxxxx>