All of lore.kernel.org
 help / color / mirror / Atom feed
From: Chao Gao <chao.gao@intel.com>
To: linux-kernel@vger.kernel.org, linux-coco@lists.linux.dev,
	kvm@vger.kernel.org
Cc: rick.p.edgecombe@intel.com, kas@kernel.org,
	dave.hansen@linux.intel.com, chao.gao@intel.com
Subject: [PATCH v1 6/8] x86/virt/tdx: Remove the auto-generated tdx_global_metadata.c
Date: Tue,  4 Aug 2026 04:29:34 -0700	[thread overview]
Message-ID: <20260804112941.19894-7-chao.gao@intel.com> (raw)
In-Reply-To: <20260804112941.19894-1-chao.gao@intel.com>

From: Dave Hansen <dave@sr71.net>

With all metadata classes converted, the only thing left in the
auto-generated tdx_global_metadata.c is get_tdx_sys_info().

Move it into tdx.c so that the auto-generated file can be deleted, along
with the unusual `#include "tdx_global_metadata.c"`.

No functional change intended.

Assisted-by: Claude:claude-opus-5
Not-yet-signed-off-by: Dave Hansen <dave@sr71.net>
Signed-off-by: Chao Gao <chao.gao@intel.com>
---
 arch/x86/virt/vmx/tdx/tdx.c                 | 19 ++++++++++++++-
 arch/x86/virt/vmx/tdx/tdx_global_metadata.c | 27 ---------------------
 2 files changed, 18 insertions(+), 28 deletions(-)
 delete mode 100644 arch/x86/virt/vmx/tdx/tdx_global_metadata.c

diff --git a/arch/x86/virt/vmx/tdx/tdx.c b/arch/x86/virt/vmx/tdx/tdx.c
index 98534e702144..1b8cd7656f36 100644
--- a/arch/x86/virt/vmx/tdx/tdx.c
+++ b/arch/x86/virt/vmx/tdx/tdx.c
@@ -527,7 +527,24 @@ static __init int get_tdx_sys_info_td_conf(struct tdx_sys_info_td_conf *td_conf)
 	return 0;
 }
 
-#include "tdx_global_metadata.c"
+static __init 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: " TDX_VERSION_FMT "\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);
+	ret = ret ?: get_tdx_sys_info_td_conf(&sysinfo->td_conf);
+
+	return ret;
+}
 
 static __init int check_features(struct tdx_sys_info *sysinfo)
 {
diff --git a/arch/x86/virt/vmx/tdx/tdx_global_metadata.c b/arch/x86/virt/vmx/tdx/tdx_global_metadata.c
deleted file mode 100644
index 4d673cac0976..000000000000
--- a/arch/x86/virt/vmx/tdx/tdx_global_metadata.c
+++ /dev/null
@@ -1,27 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0
-/*
- * Automatically generated functions to read TDX global metadata.
- *
- * This file doesn't compile on its own as it lacks of inclusion
- * of SEAMCALL wrapper primitive which reads global metadata.
- * Include this file to other C file instead.
- */
-
-static __init 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: " TDX_VERSION_FMT "\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);
-	ret = ret ?: get_tdx_sys_info_td_conf(&sysinfo->td_conf);
-
-	return ret;
-}
-- 
2.52.0


  parent reply	other threads:[~2026-08-04 11:31 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-04 11:29 [PATCH v1 0/8] TDX: Stop auto-generating the global metadata code Chao Gao
2026-08-04 11:29 ` [PATCH v1 1/8] x86/virt/tdx: Stop treating tdx_global_metadata.h as auto-generated Chao Gao
2026-08-04 23:43   ` Dave Hansen
2026-08-05 12:06     ` Chao Gao
2026-08-05 15:26       ` Dave Hansen
2026-08-04 11:29 ` [PATCH v1 2/8] x86/virt/tdx: Name the TDX module global metadata field IDs Chao Gao
2026-08-04 23:52   ` Dave Hansen
2026-08-05 12:45     ` Chao Gao
2026-08-05 17:10   ` Edgecombe, Rick P
2026-08-10  6:35     ` Chao Gao
2026-08-04 11:29 ` [PATCH v1 3/8] x86/virt/tdx: Add a table-driven TDX global metadata reader Chao Gao
2026-08-05 17:48   ` Edgecombe, Rick P
2026-08-10  6:43     ` Chao Gao
2026-08-10 18:32       ` Edgecombe, Rick P
2026-08-04 11:29 ` [PATCH v1 4/8] x86/virt/tdx: Convert version/tdmr/td_ctrl/handoff readers Chao Gao
2026-08-04 11:29 ` [PATCH v1 5/8] x86/virt/tdx: Convert td_conf reader Chao Gao
2026-08-04 11:29 ` Chao Gao [this message]
2026-08-04 11:29 ` [PATCH v1 7/8] x86/virt/tdx: Clean up error handling in get_tdx_sys_info() Chao Gao
2026-08-04 11:29 ` [PATCH v1 8/8] x86/virt/tdx: Verify the C member size against the metadata field ID Chao Gao
2026-08-04 23:38 ` [PATCH v1 0/8] TDX: Stop auto-generating the global metadata code Dave Hansen
2026-08-05 12:11   ` Chao Gao
2026-08-05 17:19 ` Edgecombe, Rick P
2026-08-10  8:49   ` Chao Gao

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260804112941.19894-7-chao.gao@intel.com \
    --to=chao.gao@intel.com \
    --cc=dave.hansen@linux.intel.com \
    --cc=kas@kernel.org \
    --cc=kvm@vger.kernel.org \
    --cc=linux-coco@lists.linux.dev \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rick.p.edgecombe@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.