Re: [PATCH v4 0/4] tdx-guest: Make Quote buffer size dynamic
From: Peter Fang
Date: Tue Sep 15 2026 - 20:35:01 EST
On Tue, Sep 15, 2026 at 05:06:14PM -0700, Edgecombe, Rick P wrote:
> On Tue, 2026-09-15 at 16:04 -0700, Peter Fang wrote:
> > Just to be extra clear... Patch 4 added this:
> >
> > if (quote_size)
> > /* The reported size does not include the buffer header */
> > len = TDX_QUOTE_BUF_LEN(quote_size);
> >
> > And it is about adding the GHCI header to the buffer size. So if there
> > is a design change and this header is no longer needed, this line could
> > become redundant. The macro might cause the driver to allocate more
> > memory than needed (up to one page), so things should still work and we
> > could fix this up later.
>
> So this series uses a new ability to query the max size of the quote. This size
> applies to SGX quotes too.
>
> Depending on the DICE design, the guest quoting code may need to change. Maybe
> heavily. These changes could touch LOC in this series as well as other TDX guest
> quoting code. But the code is still correct and useful based on non-DICE
> existing quoting.
>
> Is it all correct?
Yes. If a new TDX module decides to report this field on a non-DICE
platform, this code still works [1]. And quotes in the DICE world will
continue to get larger. This metadata reporting is useful regardless of
how DICE is implemented in the end. I wanted to be upfront about what
the potential impact may be if the guest did DICE differently. The guest
would still need this reported size from the TDX module.
[1] https://lore.kernel.org/kvm/apsxN4jYe3G3meNz@xxxxxxxxx/