Re: [PATCH 2/2] virt: tdx-guest: Allocate Quote buffer dynamically
From: Kiryl Shutsemau
Date: Fri Jun 12 2026 - 08:41:21 EST
On Fri, Jun 12, 2026 at 04:08:49AM -0700, Peter Fang wrote:
> @@ -171,7 +171,7 @@ static void tdx_mr_deinit(const struct attribute_group *mr_grp)
> #define GET_QUOTE_SUCCESS 0
> #define GET_QUOTE_IN_FLIGHT 0xffffffffffffffff
>
> -#define TDX_QUOTE_MAX_LEN (GET_QUOTE_BUF_SIZE - sizeof(struct tdx_quote_buf))
> +#define TDX_QUOTE_BUF_LEN(n) (offsetof(struct tdx_quote_buf, data) + (n))
I've got confused by this offsetof(). It is valid, but why not plain
sizeof()?
Otherwise looks okay to me:
Reviewed-by: Kiryl Shutsemau (Meta) <kas@xxxxxxxxxx>
--
Kiryl Shutsemau / Kirill A. Shutemov