[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20260105074350.98564-4-chao.gao@intel.com>
Date: Sun, 4 Jan 2026 23:43:46 -0800
From: Chao Gao <chao.gao@...el.com>
To: linux-kernel@...r.kernel.org,
linux-coco@...ts.linux.dev,
kvm@...r.kernel.org
Cc: vishal.l.verma@...el.com,
kai.huang@...el.com,
dan.j.williams@...el.com,
yilun.xu@...ux.intel.com,
vannapurve@...gle.com,
Chao Gao <chao.gao@...el.com>,
Rick Edgecombe <rick.p.edgecombe@...el.com>,
Thomas Gleixner <tglx@...utronix.de>,
Ingo Molnar <mingo@...hat.com>,
Borislav Petkov <bp@...en8.de>,
Dave Hansen <dave.hansen@...ux.intel.com>,
x86@...nel.org,
"H. Peter Anvin" <hpa@...or.com>,
Kiryl Shutsemau <kas@...nel.org>
Subject: [PATCH v2 3/3] x86/virt/tdx: Print TDX Module version during init
From: Vishal Verma <vishal.l.verma@...el.com>
Alongside exposing the TDX Module version via sysfs, it is useful to
have a record of it in dmesg logs. This allows for a quick spot check
for whether the correct/expected TDX module is being loaded, and also
creates a record for any future problems being investigated. This was
also requested in [1].
The log message will look like:
virt/tdx: TDX-Module version: 1.5.24
Print this early in init_tdx_module(), right after the global metadata
is read, which makes it available even if there are subsequent
initialization failures.
Based on a patch by Kai Huang <kai.huang@...el.com> [2]
[ Chao: s/TDX module/TDX-Module in the log message
tag print_module_version() as __init ]
Signed-off-by: Vishal Verma <vishal.l.verma@...el.com>
Signed-off-by: Chao Gao <chao.gao@...el.com>
Cc: Rick Edgecombe <rick.p.edgecombe@...el.com>
Cc: Kai Huang <kai.huang@...el.com>
Link: https://lore.kernel.org/all/CAGtprH8eXwi-TcH2+-Fo5YdbEwGmgLBh9ggcDvd6N=bsKEJ_WQ@mail.gmail.com/ # [1]
Link: https://lore.kernel.org/all/6b5553756f56a8e3222bfc36d0bdb3e5192137b7.1731318868.git.kai.huang@intel.com # [2]
---
v2
- new
arch/x86/virt/vmx/tdx/tdx.c | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/arch/x86/virt/vmx/tdx/tdx.c b/arch/x86/virt/vmx/tdx/tdx.c
index ef77135ec373..3282dce5003b 100644
--- a/arch/x86/virt/vmx/tdx/tdx.c
+++ b/arch/x86/virt/vmx/tdx/tdx.c
@@ -352,6 +352,13 @@ static __init int read_sys_metadata_field(u64 field_id, u64 *data)
#include "tdx_global_metadata.c"
+static __init void print_module_version(struct tdx_sys_info_version *version)
+{
+ pr_info("TDX-Module version: %u.%u.%02u\n",
+ version->major_version, version->minor_version,
+ version->update_version);
+}
+
static __init int check_features(struct tdx_sys_info *sysinfo)
{
u64 tdx_features0 = sysinfo->features.tdx_features0;
@@ -1158,6 +1165,8 @@ static __init int init_tdx_module(void)
if (ret)
return ret;
+ print_module_version(&tdx_sysinfo.version);
+
/* Check whether the kernel can support this module */
ret = check_features(&tdx_sysinfo);
if (ret)
--
2.47.3
Powered by blists - more mailing lists