Re: [PATCH 01/15] x86/virt/tdx: Read global metadata for TDX Module Extensions

From: Xu Yilun

Date: Fri May 29 2026 - 13:07:56 EST


> Yea It is going to get confusing as to which metadata is populated at which
> step. And if anything updates it.
>
> I'm not sure we need to have all the metadata stored permanently. Some of the
> metadata is needed for KVM and someday TSM. But a lot of it is onetime internal
> use. There is some handiness in referring to a global var, but also those
> reference add confusion as to when it got populated.
>
> We only use ext_required, max_quote_size and memory_pool_required_pages each
> once. So why not just read them to the stack and leave them out of struct
> tdx_sys_info? Making it so there is not confusion of when it was read. And also
> saving a global var that is never used again is a bit wrong.
>
> How about for struct tdx_sys_info_ext read it to the stack in init_tdx_ext() and
> pass it into init_tdx_ext_features(). For max_quote_size read it where it is

I think you mean "pass it into tdx_ext_mem_setup(). Yes, good to me.

> already read, but not into the global struct.