Re: [PATCH v5 2/6] virt: tdx-guest: Give the Quote buffer an explicit type
From: Peter Fang
Date: Tue Sep 29 2026 - 03:42:38 EST
On Tue, Sep 29, 2026 at 10:13:32AM +0800, Binbin Wu wrote:
> On 9/28/2026 6:08 PM, Peter Fang wrote:
> > The Quote buffer is always a "struct tdx_quote_buf", but its global
> > pointer is a "void *". A function would have to convert it back to make
> > sense of it.
> >
> > Declare the global with its actual type, and give it a better name.
> >
> > This creates variable shadowing in wait_for_quote_completion(), so
> > rename its parameter for clarity.
> >
> > AI was used under supervision to collect/apply feedback, review code and
> > workshop logs.
> >
> > Signed-off-by: Peter Fang <peter.fang@xxxxxxxxx>
>
> Reviewed-by: Binbin Wu <binbin.wu@xxxxxxxxxxxxxxx>
Thanks Binbin!
>
> One nit below.
>
> > ---
> > v5:
> > - New patch. [Dave]
> > ---
> > drivers/virt/coco/tdx-guest/tdx-guest.c | 35 ++++++++++++-------------
> > 1 file changed, 17 insertions(+), 18 deletions(-)
> >
> > diff --git a/drivers/virt/coco/tdx-guest/tdx-guest.c b/drivers/virt/coco/tdx-guest/tdx-guest.c
> > index d0303e31e816..896eb0a09c4a 100644
> > --- a/drivers/virt/coco/tdx-guest/tdx-guest.c
> > +++ b/drivers/virt/coco/tdx-guest/tdx-guest.c
> > @@ -192,7 +192,7 @@ struct tdx_quote_buf {
> > };
> >
> > /* Quote data buffer */
>
> The comment should be updated as well.
>
> "Quote buffer" or "Quote request buffer"?
Hmm... I think with this refactoring, either one becomes kind of
redundant. I was thinking of adding something like "GHCI Quote buffer",
but that's pretty much documented by struct tdx_quote_buf itself.
How about I just drop the comment?
>
> > -static void *quote_data;
> > +static struct tdx_quote_buf *quote_buf;
> >