Re: [PATCH v1 3/8] x86/virt/tdx: Add a table-driven TDX global metadata reader

From: Edgecombe, Rick P

Date: Wed Aug 05 2026 - 13:54:51 EST


On Tue, 2026-08-04 at 04:29 -0700, Chao Gao wrote:
> +/*
> + * Mapping between a TDX global metadata field and the C member that
> + * holds its value. Use TD_SYSINFO_MAP() to populate entries.
> + */
> +struct tdx_sys_field {
> + u64 field_id;
> + u16 offset;
> + u8  size;

We are supposed to be able to extract the size from the field id too. We could
leave the bits out of the field id and have it constructed on the fly, or we
could do a static assert based on the size matching between field id size and
struct size. It depends on how we want to have the field ids defines I guess.