Re: [RFC PATCH 10/15] x86/tdx: Move and rename Quote request structure
From: Adrian Hunter
Date: Thu Jun 11 2026 - 13:19:42 EST
On 22/05/2026 06:41, Xu Yilun wrote:
> From: Peter Fang <peter.fang@xxxxxxxxx>
>
> struct tdx_quote_buf is currently used only by the guest, but the Quote
> buffer format will also be needed by the host for in-kernel Quote
> generation. Move the definition to tdx.h so it can be shared by both.
>
> Rename the struct to tdx_quote_req to better reflect its purpose.
>
> Signed-off-by: Peter Fang <peter.fang@xxxxxxxxx>
> Signed-off-by: Xu Yilun <yilun.xu@xxxxxxxxxxxxxxx>
> ---
> -static int wait_for_quote_completion(struct tdx_quote_buf *quote_buf, u32 timeout)
> +static int wait_for_quote_completion(struct tdx_quote_req *quote_buf, u32 timeout)
Seems inconsistent to rename the struct but not the variable names
> {
> int i = 0;
Please note, the timeout condition in wait_for_quote_completion() is
broken, in that the final value of i is timeout + 1 not timeout.
Since you are in the same area, that needs fixing that too.
>
> @@ -269,7 +250,7 @@ static int wait_for_quote_completion(struct tdx_quote_buf *quote_buf, u32 timeou
> static int tdx_report_new_locked(struct tsm_report *report, void *data)
> {
> u8 *buf;
> - struct tdx_quote_buf *quote_buf = quote_data;
> + struct tdx_quote_req *quote_buf = quote_data;
> struct tsm_report_desc *desc = &report->desc;
> u32 out_len;
> int ret;