Re: [PATCH v5 5/6] x86/tdx: Add a helper to query maximum Quote size
From: Peter Fang
Date: Mon Sep 28 2026 - 17:04:04 EST
On Mon, Sep 28, 2026 at 11:35:11AM -0700, Edgecombe, Rick P wrote:
> On Mon, 2026-09-28 at 03:08 -0700, Peter Fang wrote:
> > TDX attestation report ("Quote") sizes can grow with newer crypto
> > algorithms, so guests can no longer rely on a fixed-size buffer for the
> > Quote.
> >
> > The TDX module added a new ABI that reports the largest possible Quote
> > size via a metadata field [1]. Add a helper to query the size instead of
> > exposing tdg_vm_rd() directly, as it can read arbitrary metadata fields.
> >
> > The reported size covers every Quote type the platform can produce,
> > including SGX-based Quotes.
> >
> > Thanks to Xu Yilun for suggesting this in an off-list discussion.
>
> Suggesting what?
Suggesting using another helper instead of exposing tdg_vm_rd()
directly. I'll clarify it in the next version.
>
> > diff --git a/arch/x86/coco/tdx/tdx.c b/arch/x86/coco/tdx/tdx.c
> > index bcaf4180a8db..323e1efc78ea 100644
> > --- a/arch/x86/coco/tdx/tdx.c
> > +++ b/arch/x86/coco/tdx/tdx.c
> > @@ -198,6 +198,22 @@ u64 tdx_hcall_get_quote(void *buf, size_t size)
> > }
> > EXPORT_SYMBOL_GPL(tdx_hcall_get_quote);
> >
> > +/*
> > + * Ask the TDX module what the largest possible Quote might be.
>
> How about adding the "largest on the host platform" detail to this comment.
I'll do that. Thanks.
>