Re: [RFC PATCH 10/15] x86/tdx: Move and rename Quote request structure

From
Dan Williams (nvidia) <djbw@kernel.org>
Date
2026-06-13 00:04:07
Also in
kvm, lkml
Reply to
Xu Yilun, 2026-05-22
Xu Yilun wrote:
quoted hunk ↗ jump to hunk
From: Peter Fang <redacted>

struct tdx_quote_buf is currently used only by the guest, but the Quote
buffer format will also be needed by the host for in-kernel Quote
generation. Move the definition to tdx.h so it can be shared by both.

Rename the struct to tdx_quote_req to better reflect its purpose.

Signed-off-by: Peter Fang <redacted>
Signed-off-by: Xu Yilun <redacted>
---
 arch/x86/include/asm/tdx.h              | 21 +++++++++++++++++++++
 drivers/virt/coco/tdx-guest/tdx-guest.c | 25 +++----------------------
 2 files changed, 24 insertions(+), 22 deletions(-)
diff --git a/arch/x86/include/asm/tdx.h b/arch/x86/include/asm/tdx.h
index bc512a00a0d0..945e6817abb2 100644
--- a/arch/x86/include/asm/tdx.h
+++ b/arch/x86/include/asm/tdx.h
@@ -96,6 +96,27 @@ static inline long tdx_kvm_hypercall(unsigned int nr, unsigned long p1,
 }
 #endif /* CONFIG_INTEL_TDX_GUEST && CONFIG_KVM_GUEST */
 
+#if defined(CONFIG_INTEL_TDX_GUEST) || defined(CONFIG_KVM_INTEL_TDX)
+/* struct tdx_quote_req: Format of Quote request message.
+ * @version: Quote format version, filled by TD.
+ * @status: Status code of Quote request, filled by VMM.
+ * @in_len: Length of TDREPORT, filled by TD.
+ * @out_len: Length of Quote data, filled by VMM.
+ * @data: Quote data on output or TDREPORT on input.
+ *
+ * More details of Quote request message can be found in TDX
+ * Guest-Host Communication Interface (GHCI) for Intel TDX 1.0,
+ * section titled "TDG.VP.VMCALL<GetQuote>"
+ */
+struct tdx_quote_req {
+	u64 version;
+	u64 status;
+	u32 in_len;
+	u32 out_len;
+	u8 data[];
+};
+#endif /* CONFIG_INTEL_TDX_GUEST || CONFIG_KVM_INTEL_TDX */
Drop the ifdef guards.

There is no cost to allowing a data structure to be defined
unconditionally. Usually the ifdef guards are to prevent compilation
errors when symbols do not resolve.

Otherwise looks ok.

Reviewed-by: Dan Williams <djbw@kernel.org>
Thread (129 messages) 129 messages, 12 authors, last reply 2026-08-11
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help