Re: [RFC PATCH v2 00/10] TDX: Stop auto-generating the global metadata code
From: Tony Lindgren
Date: Wed Sep 23 2026 - 01:49:18 EST
On Fri, Sep 18, 2026 at 06:29:19AM -0700, Chao Gao wrote:
> This series cleans up the TDX global metadata code. It has two goals:
>
> 1. Replace the generated code with a table-driven metadata reader.
>
> 2. Make the existing code easier to read and maintain, and simplify
> adding new metadata fields.
>
> During the v1 review, Dave raised concerns about signing off on
> AI-generated code. I have since rewritten the affected patches based on
> my own understanding of the code.
>
> The main goal of this RFC is to agree on whether the table-driven reader is
> the right replacement for the generated code. Please raise any concerns or
> alternative design ideas.
For alternatives, I wonder if grouping the metadata would help in the long
run. Some of TDX metadata needs to be cached. Some of the metadata is init
time data for how much memory to allocate etc. Some of the metadata needs
to be re-read after TDX module update.
Should we have the table-driven metadata reader use the TDX module
metadata directly by default instead of always copying the data? That
could be used for the init time data. And data could still be cached for
CPUIDs etc.