[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <261b253ff5bcf593adbddbc34f7a5b4befaa4c21.camel@intel.com>
Date: Thu, 8 Jan 2026 18:39:50 +0000
From: "Verma, Vishal L" <vishal.l.verma@...el.com>
To: "kas@...nel.org" <kas@...nel.org>
CC: "Gao, Chao" <chao.gao@...el.com>, "Edgecombe, Rick P"
<rick.p.edgecombe@...el.com>, "dave.hansen@...ux.intel.com"
<dave.hansen@...ux.intel.com>, "Huang, Kai" <kai.huang@...el.com>,
"x86@...nel.org" <x86@...nel.org>, "bp@...en8.de" <bp@...en8.de>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>, "Williams, Dan
J" <dan.j.williams@...el.com>, "tglx@...utronix.de" <tglx@...utronix.de>,
"kvm@...r.kernel.org" <kvm@...r.kernel.org>, "linux-coco@...ts.linux.dev"
<linux-coco@...ts.linux.dev>, "hpa@...or.com" <hpa@...or.com>,
"mingo@...hat.com" <mingo@...hat.com>
Subject: Re: [PATCH 2/2] x86/virt/tdx: Print TDX module version during init
On Thu, 2026-01-08 at 10:50 +0000, Kiryl Shutsemau wrote:
> On Wed, Jan 07, 2026 at 05:31:29PM -0700, Vishal Verma wrote:
> > It is useful to print the TDX module version 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].
> >
> > Include the version in the log messages during init, e.g.:
> >
> > virt/tdx: TDX module version: 1.5.24
> > virt/tdx: 1034220 KB allocated for PAMT
> > virt/tdx: module initialized
> >
> > ..followed by remaining TDX initialization messages (or errors).
> >
> > Print the version early in init_tdx_module(), right after the global
> > metadata is read, which makes it available even if there are subsequent
> > initialization failures.
>
> One thing to note that if metadata read fails, we will not get there.
>
> The daisy chaining we use for metadata read makes it fragile. Some
> metadata fields are version/feature dependant, like you can see in DPAMT
> case.
>
> It can be useful to dump version information, even if get_tdx_sys_info()
> fails. Version info is likely to be valid on failure.
Good point, maybe something like this to print it as soon as it is
retrieved?
---3<---
diff --git a/arch/x86/virt/vmx/tdx/tdx.c b/arch/x86/virt/vmx/tdx/tdx.c
index fba00ddc11f1..5ce4ebe99774 100644
--- a/arch/x86/virt/vmx/tdx/tdx.c
+++ b/arch/x86/virt/vmx/tdx/tdx.c
@@ -1084,11 +1084,6 @@ static int init_tdx_module(void)
if (ret)
return ret;
- pr_info("Module version: %u.%u.%02u\n",
- tdx_sysinfo.version.major_version,
- tdx_sysinfo.version.minor_version,
- tdx_sysinfo.version.update_version);
-
/* Check whether the kernel can support this module */
ret = check_features(&tdx_sysinfo);
if (ret)
diff --git a/arch/x86/virt/vmx/tdx/tdx_global_metadata.c b/arch/x86/virt/vmx/tdx/tdx_global_metadata.c
index 0454124803f3..4c9917a9c2c3 100644
--- a/arch/x86/virt/vmx/tdx/tdx_global_metadata.c
+++ b/arch/x86/virt/vmx/tdx/tdx_global_metadata.c
@@ -105,6 +105,12 @@ static int get_tdx_sys_info(struct tdx_sys_info *sysinfo)
int ret = 0;
ret = ret ?: get_tdx_sys_info_version(&sysinfo->version);
+
+ pr_info("Module version: %u.%u.%02u\n",
+ sysinfo->version.major_version,
+ sysinfo->version.minor_version,
+ sysinfo->version.update_version);
+
ret = ret ?: get_tdx_sys_info_features(&sysinfo->features);
ret = ret ?: get_tdx_sys_info_tdmr(&sysinfo->tdmr);
ret = ret ?: get_tdx_sys_info_td_ctrl(&sysinfo->td_ctrl);
Powered by blists - more mailing lists