Re: [PATCH v3 3/4] virt: tdx-guest: Use a variable to store the Quote buffer size
From: Binbin Wu
Date: Thu Sep 03 2026 - 05:25:11 EST
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>
> ---
> v3:
> - Split out using a variable for the buffer size from the v2 "Allocate
> Quote buffer dynamically" patch to refactor first. [Dave]
> - Pass the buffer size into alloc_quote_buf() by value. [Dave]
> - Drop the Reviewed-by tags from v2 (Kiryl, Binbin) as the patch was
> reworked.
> ---
> drivers/virt/coco/tdx-guest/tdx-guest.c | 22 +++++++++++-----------
> 1 file changed, 11 insertions(+), 11 deletions(-)
>
> diff --git a/drivers/virt/coco/tdx-guest/tdx-guest.c b/drivers/virt/coco/tdx-guest/tdx-guest.c
> index f47c5429d002..3d3f79ab45af 100644
> --- a/drivers/virt/coco/tdx-guest/tdx-guest.c
> +++ b/drivers/virt/coco/tdx-guest/tdx-guest.c
> @@ -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.