Re: [PATCH v3 3/4] virt: tdx-guest: Use a variable to store the Quote buffer size
From: Binbin Wu
Date: Mon Sep 07 2026 - 04:06:02 EST
On 9/4/2026 2:49 PM, Peter Fang wrote:
> 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()?
tdx_report_new_locked() already uses the name 'quote_buf' as a local var. :(
Maybe the local var can be dropped, but tdx_hcall_get_quote() takes a "u8 *"
pointer, which will require a type cast.
Anyway, this is a nit and it could be addressed in a separately if needed.