linux-coco.lists.linux.dev archive mirror
 help / color / mirror / Atom feed
* [PATCH] x86/virt/tdx: accurately distinguishes TDX module loading situations
@ 2024-06-22 17:50 Jun Miao
  2024-06-24 11:26 ` Kirill A. Shutemov
  2024-07-19  1:31 ` Huang, Kai
  0 siblings, 2 replies; 4+ messages in thread
From: Jun Miao @ 2024-06-22 17:50 UTC (permalink / raw)
  To: kirill.shutemov, dave.hansen; +Cc: linux-coco, Jun Miao

The first SEAMCALL is important to response the state of TDX Module/BIOS.

In actual incorrect BIOS setup or deployment, the sysinit_ret will be
-EOPNOTSUPP. But the message "module not loaded" isn`t enough to describe
the accurate loading situation when module loaded but SEAMCALL failed
for some BIOS wrong setting. So add the error return operation code number.

Signed-off-by: Jun Miao <jun.miao@intel.com>
---
 arch/x86/virt/vmx/tdx/tdx.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/arch/x86/virt/vmx/tdx/tdx.c b/arch/x86/virt/vmx/tdx/tdx.c
index 4e2b2e2ac9f9..787dfaf44036 100644
--- a/arch/x86/virt/vmx/tdx/tdx.c
+++ b/arch/x86/virt/vmx/tdx/tdx.c
@@ -122,10 +122,14 @@ static int try_init_module_global(void)
 	/*
 	 * The first SEAMCALL also detects the TDX module, thus
 	 * it can fail due to the TDX module is not loaded.
-	 * Dump message to let the user know.
+	 * Dump more detailed message to let the user know.
 	 */
 	if (sysinit_ret == -ENODEV)
 		pr_err("module not loaded\n");
+	else if (sysinit_ret)
+		pr_warn("module loaded error ret=%d\n",sysinit_ret);
+	else
+		pr_info("module loaded\n");
 
 	sysinit_done = true;
 out:
-- 
2.32.0


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

end of thread, other threads:[~2024-07-19  1:31 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-06-22 17:50 [PATCH] x86/virt/tdx: accurately distinguishes TDX module loading situations Jun Miao
2024-06-24 11:26 ` Kirill A. Shutemov
2024-06-28 17:17   ` Jun Miao
2024-07-19  1:31 ` Huang, Kai

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).