Re: [PATCH v1 2/8] x86/virt/tdx: Name the TDX module global metadata field IDs
From: Edgecombe, Rick P
Date: Wed Aug 05 2026 - 13:15:36 EST
On Tue, 2026-08-04 at 04:29 -0700, Chao Gao wrote:
> +/*
> + * Global Scope Metadata field IDs.
> + *
> + * See "Global-Scope (TDX Module) Metadata" in the Intel TDX Module ABI
> + * spec.
> + *
> + * A field ID is a 64-bit value that encodes the metadata "Class"
> + * (which Linux mirrors in 'struct tdx_sys_info' sub-structures),
> + * the element size, and a per-class field index. Each ID below
> + * is paired with the C member that holds its value.
> + */
I wonder about having a macro to construct these. See "Table 3.55: MD_FIELD_ID
(Metadata Field Identifier / Sequence Header) Definition" in the TDX ABI spec
for the meaning of the bits set in these defines.
But I'd also think it would nice to have an easy way to cross reference the
fields between kernel and TDX docs. We could probably consider adjustments to
the docs as part of the solution for that. Of if the macro makes that cross
reference harder, then not do it.