public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2]  Expose TDX Module version
@ 2025-10-01  2:22 Chao Gao
  2025-10-01  2:22 ` [PATCH 1/2] x86/virt/tdx: Retrieve TDX module version Chao Gao
  2025-10-01  2:22 ` [PATCH 2/2] coco/tdx-host: Expose " Chao Gao
  0 siblings, 2 replies; 18+ messages in thread
From: Chao Gao @ 2025-10-01  2:22 UTC (permalink / raw)
  To: linux-coco, linux-kernel, x86
  Cc: Chao Gao, Borislav Petkov, Dan Williams, Dave Hansen,
	H. Peter Anvin, Ingo Molnar, Kai Huang, Kirill A. Shutemov,
	Paolo Bonzini, Thomas Gleixner, Xu Yilun

Currently, there is no user interface to get the TDX Module version.
However, in bug reporting or analysis scenarios, the first question
normally asked is which TDX Module version is on your system, to determine
if this is a known issue or a new regression.

To address this issue, this series exposes the TDX Module version as
sysfs attributes of the tdx_host device [*].

This series is built on the VMX always-on series, which enables VMXON
during CPU bringup, and the "tdx_host" device, which creates a virtual
device to serve as the user interface for all TDX host features, e.g.,
TDX Connect.

The base-commit is:
https://git.kernel.org/pub/scm/linux/kernel/git/devsec/tsm.git/commit/?h=tdx&id=9332e088937f

[*]: https://lore.kernel.org/linux-coco/20250919142237.418648-2-dan.j.williams@intel.com/

Chao Gao (2):
  x86/virt/tdx: Retrieve TDX module version
  coco/tdx-host: Expose TDX module version

 .../ABI/testing/sysfs-devices-faux-tdx-host   |  6 +++++
 MAINTAINERS                                   |  1 +
 arch/x86/include/asm/tdx_global_metadata.h    |  7 ++++++
 arch/x86/virt/vmx/tdx/tdx_global_metadata.c   | 16 ++++++++++++
 drivers/virt/coco/tdx-host/tdx-host.c         | 25 ++++++++++++++++++-
 5 files changed, 54 insertions(+), 1 deletion(-)
 create mode 100644 Documentation/ABI/testing/sysfs-devices-faux-tdx-host

-- 
2.47.3


^ permalink raw reply	[flat|nested] 18+ messages in thread
* [PATCH 0/2] x86/virt/tdx: Print TDX module version to dmesg
@ 2026-01-08  0:31 Vishal Verma
  2026-01-08  0:31 ` [PATCH 1/2] x86/virt/tdx: Retrieve TDX module version Vishal Verma
  0 siblings, 1 reply; 18+ messages in thread
From: Vishal Verma @ 2026-01-08  0:31 UTC (permalink / raw)
  To: linux-kernel, linux-coco, kvm
  Cc: x86, Chao Gao, Dan Williams, Kai Huang, Thomas Gleixner,
	Ingo Molnar, Borislav Petkov, Dave Hansen, H. Peter Anvin,
	Kiryl Shutsemau, Rick Edgecombe, Vishal Verma

=== Problem & Solution ===

Currently, there is neither an ABI, nor any other way to determine from
the host system, what version of the TDX module is running. A sysfs ABI
for this has been proposed in [1], but it may need additional discussion.

Many/most TDX developers already carry patches like this in their
development branches. It can be tricky to know which TDX module is
actually loaded on a system, and so this functionality has been needed
regularly for development and processing bug reports. Hence, it is
prudent to break out the patches to retrieve and print the TDX module
version, as those parts are very straightforward, and get some level of
debugability and traceability for TDX host systems.

=== Dependencies ===

None. This is based on v6.19-rc4, and applies cleanly to tip.git.

=== Patch details ===

Patch 1 is a prerequisite that adds the infrastructure to retrieve the
TDX module version from its global metadata. This was originally posted in [2].

Patch 2 is based on a patch from Kai Huang [3], and prints the version to
dmesg during init.

=== Testing ===

This has passed the usual suite of tests, including successful 0day
builds, KVM Unit tests, KVM selftests, a TD creation smoke test, and
selected KVM tests from the Avocado test suite.

[1]: https://lore.kernel.org/all/20260105074350.98564-1-chao.gao@intel.com/
[2]: https://lore.kernel.org/all/20260105074350.98564-2-chao.gao@intel.com/
[3]: https://lore.kernel.org/all/57eaa1b17429315f8b5207774307f3c1dd40cf37.1730118186.git.kai.huang@intel.com/

Signed-off-by: Vishal Verma <vishal.l.verma@intel.com>
---
Chao Gao (1):
      x86/virt/tdx: Retrieve TDX module version

Vishal Verma (1):
      x86/virt/tdx: Print TDX module version during init

 arch/x86/include/asm/tdx_global_metadata.h  |  7 +++++++
 arch/x86/virt/vmx/tdx/tdx.c                 |  5 +++++
 arch/x86/virt/vmx/tdx/tdx_global_metadata.c | 16 ++++++++++++++++
 3 files changed, 28 insertions(+)
---
base-commit: 9ace4753a5202b02191d54e9fdf7f9e3d02b85eb
change-id: 20260107-tdx_print_module_version-e4ca7edc2022

Best regards,
--  
Vishal Verma <vishal.l.verma@intel.com>


^ permalink raw reply	[flat|nested] 18+ messages in thread

end of thread, other threads:[~2026-01-08 20:18 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-10-01  2:22 [PATCH 0/2] Expose TDX Module version Chao Gao
2025-10-01  2:22 ` [PATCH 1/2] x86/virt/tdx: Retrieve TDX module version Chao Gao
2025-10-01 15:15   ` Dave Hansen
2025-10-22  7:54     ` Chao Gao
2025-10-22 10:26       ` Kiryl Shutsemau
2025-10-24  6:33         ` Chao Gao
2025-10-24  9:35           ` Kiryl Shutsemau
2025-10-24 10:04             ` Chao Gao
2025-11-13  1:24       ` Chao Gao
2025-10-24 14:20   ` Vishal Annapurve
2025-10-01  2:22 ` [PATCH 2/2] coco/tdx-host: Expose " Chao Gao
2025-10-01  4:12   ` Huang, Kai
2025-10-01 11:27     ` Kiryl Shutsemau
2025-10-01 21:41       ` Huang, Kai
2025-10-01 11:30   ` Kiryl Shutsemau
  -- strict thread matches above, loose matches on Subject: below --
2026-01-08  0:31 [PATCH 0/2] x86/virt/tdx: Print TDX module version to dmesg Vishal Verma
2026-01-08  0:31 ` [PATCH 1/2] x86/virt/tdx: Retrieve TDX module version Vishal Verma
2026-01-08 10:41   ` Kiryl Shutsemau
2026-01-08 20:18   ` Edgecombe, Rick P

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox