Re: [PATCH v3 3/4] virt: tdx-guest: Use a variable to store the Quote buffer size
From: Peter Fang
Date: Fri Sep 04 2026 - 03:09:23 EST
On Thu, Sep 03, 2026 at 05:17:02PM +0800, Binbin Wu wrote:
> On 7/29/2026 8:29 PM, Peter Fang wrote:
> > In preparation for dynamic Quote buffer sizes, replace the fixed size
> > constant with a variable.
> >
> > The size is currently a constant sprinkled across several places. Store
> > it in a variable and have all the users read it from there.
> >
> > Signed-off-by: Peter Fang <peter.fang@xxxxxxxxx>
>
> Reviewed-by: Binbin Wu <binbin.wu@xxxxxxxxxxxxxxx>
Thanks Binbin!
>
> > @@ -191,8 +191,9 @@ struct tdx_quote_buf {
> > u8 data[];
> > };
> >
> > -/* Quote data buffer */
> > +/* Quote data buffer and length */
> > static void *quote_data;
> > +static size_t quote_data_len;
>
> Nit:
> The existing code is using "quote_data", it's natural to follow the style.
> I personally feel the var names are a bit ambiguous on whether it's the full
> quote buffer or just the data part.
Yeah I agree... How about I change it to:
static struct tdx_quote_buf *quote_buf;
This way it's explicitly typed, and should work better with functions
like alloc_quote_buf() and free_quote_buf()?