From nobody Sat Feb 7 13:05:28 2026 Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 19EE4254B18; Mon, 5 Jan 2026 07:43:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.18 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1767599035; cv=none; b=HJZzoUQ2JEVK13Bm+YqWy+EReCgVO6CEiEVr7j5Wlfnglh54wvA2wjWIJYKslQ9ywTH+rgY4ANT9/3jQ/WQeR99y8MEKb9DTBFugUS5MHtJky8uuJwWxvXeU/A9naIPgd6I73YzWBED+8nNtwYKrBqiIyfuC2WgvqKIAdTgUuBo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1767599035; c=relaxed/simple; bh=wdW74S61SCgSttb2rGhh+LvM7ykrIQN7oR9lhODs13E=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=hsiFq5hF8FovcDC147o3xX9LUegtPlG9VZjylhE/zBdUii6j0CT9xjZXSJkFinbT8HhAMZ5yGMbbCb7UnTdyeZZsKjo79hKcuii0wOseirlbZ7i99ocMsBEWHokoL8ZYgEYqlFofYmJB+CkoCAEa6gVwv312La2QS3AZJPvTuDI= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com; spf=pass smtp.mailfrom=intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=YMI3OLbi; arc=none smtp.client-ip=198.175.65.18 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=intel.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="YMI3OLbi" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1767599034; x=1799135034; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=wdW74S61SCgSttb2rGhh+LvM7ykrIQN7oR9lhODs13E=; b=YMI3OLbiNYTSUwiWqzM3KN+msQDjPylir6+UtIzNkqqClFYZc2dHHijx L7CUFSXMLCJP2Y5vBG8HyJIyw5v6D/L+ZzCQH9X+azrbzo1x3jAygq41f ybAnQsgCA65iUNXUAd8z9DWhnAuo2p4Yz7i4DwqAGcagVno5lv1fPoHxA LGjKOFOUV2lNmlNCwvsjZ02EWsy1q15qN5NGLxi743W+ysxUAIiBIJtzV sw20clziVrT4DWX0p+ufynQZ2mkZMEPp752n+/hL6BLiyxMGpUYWTfDQZ 0HI3L9AJulvmdsH4xKdGjBa/nql6QdXgpMDnbj49lbn9Pn+E9wNrim47K A==; X-CSE-ConnectionGUID: yKhQZpUAS7q+OmhyeaBJ0g== X-CSE-MsgGUID: WNB08uBOTbCwpnHTwFSqeg== X-IronPort-AV: E=McAfee;i="6800,10657,11661"; a="69012565" X-IronPort-AV: E=Sophos;i="6.21,203,1763452800"; d="scan'208";a="69012565" Received: from orviesa001.jf.intel.com ([10.64.159.141]) by orvoesa110.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Jan 2026 23:43:53 -0800 X-CSE-ConnectionGUID: tt/4A70hToWxwApQ7pPziQ== X-CSE-MsgGUID: J6naa9QWTcez840mWTp/4w== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.21,203,1763452800"; d="scan'208";a="239799056" Received: from 984fee019967.jf.intel.com ([10.165.54.94]) by smtpauth.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Jan 2026 23:43:53 -0800 From: Chao Gao To: linux-kernel@vger.kernel.org, linux-coco@lists.linux.dev, kvm@vger.kernel.org Cc: vishal.l.verma@intel.com, kai.huang@intel.com, dan.j.williams@intel.com, yilun.xu@linux.intel.com, vannapurve@google.com, Chao Gao , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , x86@kernel.org, "H. Peter Anvin" , Kiryl Shutsemau , Rick Edgecombe Subject: [PATCH v2 1/3] x86/virt/tdx: Retrieve TDX Module version Date: Sun, 4 Jan 2026 23:43:44 -0800 Message-ID: <20260105074350.98564-2-chao.gao@intel.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260105074350.98564-1-chao.gao@intel.com> References: <20260105074350.98564-1-chao.gao@intel.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Each TDX Module is associated with a version in the x.y.z format, where x represents the major version, y the minor version, and z the update version. Knowing the running TDX Module version is valuable for bug reporting and debugging. Retrieve the TDX Module version using the existing metadata reading interface, in preparation for exposing it to userspace via sysfs. Signed-off-by: Chao Gao --- v2: - Remove all descriptions about autogeneration (Rick) - TDH.SYS.RDALL isn't worth the code churn. So, stick with TDH.SYS.RD (Dave/Yilun) arch/x86/include/asm/tdx_global_metadata.h | 7 +++++++ arch/x86/virt/vmx/tdx/tdx_global_metadata.c | 16 ++++++++++++++++ 2 files changed, 23 insertions(+) diff --git a/arch/x86/include/asm/tdx_global_metadata.h b/arch/x86/include/= asm/tdx_global_metadata.h index 060a2ad744bf..40689c8dc67e 100644 --- a/arch/x86/include/asm/tdx_global_metadata.h +++ b/arch/x86/include/asm/tdx_global_metadata.h @@ -5,6 +5,12 @@ =20 #include =20 +struct tdx_sys_info_version { + u16 minor_version; + u16 major_version; + u16 update_version; +}; + struct tdx_sys_info_features { u64 tdx_features0; }; @@ -35,6 +41,7 @@ struct tdx_sys_info_td_conf { }; =20 struct tdx_sys_info { + struct tdx_sys_info_version version; struct tdx_sys_info_features features; struct tdx_sys_info_tdmr tdmr; struct tdx_sys_info_td_ctrl td_ctrl; diff --git a/arch/x86/virt/vmx/tdx/tdx_global_metadata.c b/arch/x86/virt/vm= x/tdx/tdx_global_metadata.c index 360963bc9328..85ab17b36c81 100644 --- a/arch/x86/virt/vmx/tdx/tdx_global_metadata.c +++ b/arch/x86/virt/vmx/tdx/tdx_global_metadata.c @@ -7,6 +7,21 @@ * Include this file to other C file instead. */ =20 +static __init int get_tdx_sys_info_version(struct tdx_sys_info_version *sy= sinfo_version) +{ + int ret =3D 0; + u64 val; + + if (!ret && !(ret =3D read_sys_metadata_field(0x0800000100000003, &val))) + sysinfo_version->minor_version =3D val; + if (!ret && !(ret =3D read_sys_metadata_field(0x0800000100000004, &val))) + sysinfo_version->major_version =3D val; + if (!ret && !(ret =3D read_sys_metadata_field(0x0800000100000005, &val))) + sysinfo_version->update_version =3D val; + + return ret; +} + static __init int get_tdx_sys_info_features(struct tdx_sys_info_features *= sysinfo_features) { int ret =3D 0; @@ -89,6 +104,7 @@ static __init int get_tdx_sys_info(struct tdx_sys_info *= sysinfo) { int ret =3D 0; =20 + ret =3D ret ?: get_tdx_sys_info_version(&sysinfo->version); ret =3D ret ?: get_tdx_sys_info_features(&sysinfo->features); ret =3D ret ?: get_tdx_sys_info_tdmr(&sysinfo->tdmr); ret =3D ret ?: get_tdx_sys_info_td_ctrl(&sysinfo->td_ctrl); --=20 2.47.3 From nobody Sat Feb 7 13:05:28 2026 Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1F84B2D839F; Mon, 5 Jan 2026 07:43:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.18 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1767599036; cv=none; b=hgjIP/7yRQUjVe76FBlfcTETrMfyM4IiSwKkF++Cei5KAjPt5Vw5dp0/iOulZOX3ahDDOSpx76ev8EWRvvVDJU+keZGFFZc/oyN4P9x/9Gpy9714IHTI+yDGoElG59ocDiL72yRaxSW6hcJgF0ry/76+iHMmR2+H7fGV3xvZ0pk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1767599036; c=relaxed/simple; bh=on1iStjClW+lJkJ3X9Vw4QkQuB8Ww7b1fEyqqUMdF30=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Xnv977FcAn+ua+yi2ft2flDcDOZCDuoGhOKRrvLmWVMjnep27Z/l2NFBeDL3KT0L5R62fzInuGB7VCqhAa/tMznz9/t1bTQK3M4rID3du2iayP0bf6m4V3vznHxDAIXSgUDcDS6PMiF2nbCuOYzjYCt+Xt+dvduLfK8oVGhyGEM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com; spf=pass smtp.mailfrom=intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=aTH9EjyG; arc=none smtp.client-ip=198.175.65.18 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=intel.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="aTH9EjyG" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1767599035; x=1799135035; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=on1iStjClW+lJkJ3X9Vw4QkQuB8Ww7b1fEyqqUMdF30=; b=aTH9EjyGRj2ek9Hln8I93r2e6G/mz8PVZAVAC1vW69KU72EY1lzqthCi 5v13T0Ku5dPIjl+UP7Z6AyeRC/NfSFi2ZMp7jN6ZYdWwFKp66sJA3dgWw GKuphEvKXpUKWfUG6V0Wb1/8f4gMCwB3bivpaI+gZQ6M8ubuRSD07Dnv+ Kt/nKHKRwF0jSVgtaQaR4jewamb7sz4rsuV9Hh3n4xycQkuoJWbdOpBSE PnMt8NEkC3i8j0In2uwrVFBZDGcsGUpU7Cp7sO83CnaevfWP/OtRFWqwL V3hasnzOf8Mw46nqNneudWFm3PDv1n5sw3hCuaBbgZa7M/JOtcQoZTWCg A==; X-CSE-ConnectionGUID: ennwjxscTzSyJJgXgvVavA== X-CSE-MsgGUID: 8+omKWwQQfKDHSppFFkslQ== X-IronPort-AV: E=McAfee;i="6800,10657,11661"; a="69012575" X-IronPort-AV: E=Sophos;i="6.21,203,1763452800"; d="scan'208";a="69012575" Received: from orviesa001.jf.intel.com ([10.64.159.141]) by orvoesa110.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Jan 2026 23:43:54 -0800 X-CSE-ConnectionGUID: wDjuU+LCTkCOvPM3R4TM4w== X-CSE-MsgGUID: zxeipqbtQMaifeicVrt9Kw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.21,203,1763452800"; d="scan'208";a="239799059" Received: from 984fee019967.jf.intel.com ([10.165.54.94]) by smtpauth.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Jan 2026 23:43:54 -0800 From: Chao Gao To: x86@kernel.org, linux-coco@lists.linux.dev, kvm@vger.kernel.org, linux-kernel@vger.kernel.org Cc: vishal.l.verma@intel.com, kai.huang@intel.com, dan.j.williams@intel.com, yilun.xu@linux.intel.com, vannapurve@google.com, Chao Gao , Kiryl Shutsemau , Dave Hansen , Rick Edgecombe Subject: [PATCH v2 2/3] coco/tdx-host: Expose TDX Module version Date: Sun, 4 Jan 2026 23:43:45 -0800 Message-ID: <20260105074350.98564-3-chao.gao@intel.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260105074350.98564-1-chao.gao@intel.com> References: <20260105074350.98564-1-chao.gao@intel.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Currently there is no way to know the TDX Module version from the userspace. Such information is always helpful for bug reporting or debugging. With the tdx-host device in place, expose the TDX Module version as a device attribute via sysfs. Signed-off-by: Chao Gao --- v2:=20 - No need to update MAINTAINERS to include sysfs-devices-faux-tdx-host explicitly (Kirill) .../ABI/testing/sysfs-devices-faux-tdx-host | 6 +++++ drivers/virt/coco/tdx-host/tdx-host.c | 26 ++++++++++++++++++- 2 files changed, 31 insertions(+), 1 deletion(-) create mode 100644 Documentation/ABI/testing/sysfs-devices-faux-tdx-host diff --git a/Documentation/ABI/testing/sysfs-devices-faux-tdx-host b/Docume= ntation/ABI/testing/sysfs-devices-faux-tdx-host new file mode 100644 index 000000000000..35ef21f53c2e --- /dev/null +++ b/Documentation/ABI/testing/sysfs-devices-faux-tdx-host @@ -0,0 +1,6 @@ +What: /sys/devices/faux/tdx_host/version +Contact: linux-coco@lists.linux.dev +Description: (RO) Report the version of the loaded TDX Module. The TDX Mod= ule + version is formatted as x.y.z, where "x" is the major version, + "y" is the minor version and "z" is the update version. Versions + are used for bug reporting, TD-Preserving updates and etc. diff --git a/drivers/virt/coco/tdx-host/tdx-host.c b/drivers/virt/coco/tdx-= host/tdx-host.c index ced1c980dc6f..2883c6638faf 100644 --- a/drivers/virt/coco/tdx-host/tdx-host.c +++ b/drivers/virt/coco/tdx-host/tdx-host.c @@ -9,6 +9,7 @@ #include #include #include +#include =20 static const struct x86_cpu_id tdx_host_ids[] =3D { X86_MATCH_FEATURE(X86_FEATURE_TDX_HOST_PLATFORM, NULL), @@ -18,12 +19,35 @@ MODULE_DEVICE_TABLE(x86cpu, tdx_host_ids); =20 static struct faux_device *fdev; =20 +static ssize_t version_show(struct device *dev, struct device_attribute *a= ttr, + char *buf) +{ + const struct tdx_sys_info *tdx_sysinfo =3D tdx_get_sysinfo(); + const struct tdx_sys_info_version *ver; + + if (!tdx_sysinfo) + return -ENXIO; + + ver =3D &tdx_sysinfo->version; + + return sysfs_emit(buf, "%u.%u.%02u\n", ver->major_version, + ver->minor_version, + ver->update_version); +} +static DEVICE_ATTR_RO(version); + +static struct attribute *tdx_host_attrs[] =3D { + &dev_attr_version.attr, + NULL, +}; +ATTRIBUTE_GROUPS(tdx_host); + static int __init tdx_host_init(void) { if (!x86_match_cpu(tdx_host_ids)) return -ENODEV; =20 - fdev =3D faux_device_create(KBUILD_MODNAME, NULL, NULL); + fdev =3D faux_device_create_with_groups(KBUILD_MODNAME, NULL, NULL, tdx_h= ost_groups); if (!fdev) return -ENODEV; =20 --=20 2.47.3 From nobody Sat Feb 7 13:05:28 2026 Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 617922DA757; Mon, 5 Jan 2026 07:43:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.18 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1767599037; cv=none; b=qOvu7O+FnskL5nxZaVGUewl5I7M5ES0HLv8NwqkVWIMRrMjBhuKiZF/Z+SGJTz9YXIUittlPE8NC0U7PFrjXHqCwwN3JlmwDWjAIEE+7DEZ6H76sXVhy0jqF8KJA4i1SvGtQX2stXMwzqSor15EpYFra4w9Atl5SOXsf0lgqs6k= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1767599037; c=relaxed/simple; bh=HoyR3hR6cttRXSNo6m4arpXKD/s/WTvls/Hs5c6I9MQ=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=io5fcVppRot8wCuYOSlFOz9tlLQZ2fP+43EN6W/jd6qZQx993yYD3+mW1idb2Crt4GFLvC0ZE+rmCQjbfhJSlq9hNdAqxARiESW5tkMLjUWb3reJPiBsmufatRPCSm2R4IzMID8VoL2sjdv+1AVMhypUcGoFe2/vosZpORVauHs= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com; spf=pass smtp.mailfrom=intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=dE+E9nD4; arc=none smtp.client-ip=198.175.65.18 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=intel.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="dE+E9nD4" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1767599035; x=1799135035; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=HoyR3hR6cttRXSNo6m4arpXKD/s/WTvls/Hs5c6I9MQ=; b=dE+E9nD4yMVKVe2zH9jnx4O4vccXQtY4SJNT5YZqH9weycOg1g7lx+HC ufiNo8YAa0Fo3uPCosUznpWJNHAz7Gya2jk/B1hmY1w1o9JA1eL9U4Jzi +8WC/mqD48pRegAHtqFkZc8VQjS98heVAgQ0PLhwka0WY0QU+uOBYblWg kk/I5CgFzXF0eLx3e3oUXoIQx1PnO8YmbMR1I4l+fn/mhSN4FLfWLcX5P AqbedV6iX784opNai46gCF7wyZEs9e2f8/zIY1MaFt7HswiEy0vDPuL8S Yz3lu4F6NxEU4bYAU8evT7/jm8+5jyQNDa+t0xx8D47qLKeyYt50YFl/+ g==; X-CSE-ConnectionGUID: HDbglsDvRzuV6uIoA+UjMQ== X-CSE-MsgGUID: VLllt7uMRrGgO8Jbew9dBw== X-IronPort-AV: E=McAfee;i="6800,10657,11661"; a="69012581" X-IronPort-AV: E=Sophos;i="6.21,203,1763452800"; d="scan'208";a="69012581" Received: from orviesa001.jf.intel.com ([10.64.159.141]) by orvoesa110.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Jan 2026 23:43:54 -0800 X-CSE-ConnectionGUID: jFI/YOfIQ4GgGgooTu+wAw== X-CSE-MsgGUID: q3Lh+Ks0ReOetW6Aq/o55A== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.21,203,1763452800"; d="scan'208";a="239799067" Received: from 984fee019967.jf.intel.com ([10.165.54.94]) by smtpauth.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Jan 2026 23:43:54 -0800 From: Chao Gao To: linux-kernel@vger.kernel.org, linux-coco@lists.linux.dev, kvm@vger.kernel.org Cc: vishal.l.verma@intel.com, kai.huang@intel.com, dan.j.williams@intel.com, yilun.xu@linux.intel.com, vannapurve@google.com, Chao Gao , Rick Edgecombe , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , x86@kernel.org, "H. Peter Anvin" , Kiryl Shutsemau Subject: [PATCH v2 3/3] x86/virt/tdx: Print TDX Module version during init Date: Sun, 4 Jan 2026 23:43:46 -0800 Message-ID: <20260105074350.98564-4-chao.gao@intel.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260105074350.98564-1-chao.gao@intel.com> References: <20260105074350.98564-1-chao.gao@intel.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Vishal Verma 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 [2] [ Chao: s/TDX module/TDX-Module in the log message tag print_module_version() as __init ] Signed-off-by: Vishal Verma Signed-off-by: Chao Gao Cc: Rick Edgecombe Cc: Kai Huang Link: https://lore.kernel.org/all/CAGtprH8eXwi-TcH2+-Fo5YdbEwGmgLBh9ggcDvd6= N=3DbsKEJ_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) =20 #include "tdx_global_metadata.c" =20 +static __init void print_module_version(struct tdx_sys_info_version *versi= on) +{ + 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 =3D sysinfo->features.tdx_features0; @@ -1158,6 +1165,8 @@ static __init int init_tdx_module(void) if (ret) return ret; =20 + print_module_version(&tdx_sysinfo.version); + /* Check whether the kernel can support this module */ ret =3D check_features(&tdx_sysinfo); if (ret) --=20 2.47.3