Re: [RFC PATCH 12/15] KVM: TDX: Add in-kernel Quote generation
From: Peter Fang
Date: Sun Jun 14 2026 - 07:58:25 EST
On Fri, Jun 12, 2026 at 05:20:31PM -0700, Dan Williams (nvidia) wrote:
> [..]
> > +static u64 __get_quote_kernel(struct kvm_vcpu *vcpu, struct tdx_quote_req *req,
> > + size_t req_len, gpa_t req_gpa, size_t total_len)
> > +{
> > + struct tdx_td *td = &to_kvm_tdx(vcpu->kvm)->td;
> > +
> > + /* Only support version 1 as defined in the GHCI spec */
> > + if (req->version != 1)
> > + return TDX_QUOTE_STATUS_ERROR;
> > +
> > + if ((size_t)req->in_len + TDX_QUOTE_REQ_HDR_SIZE > req_len)
> > + return TDX_QUOTE_STATUS_ERROR;
> > +
> > + /* The caller frees the quote data */
>
> No, it is freed by cleanup as far as I can see
Ah makes sense. I'll fix it up.
>
> > + void *quote_data __free(kvfree) =
>
> ...this shadows the global "quote_data". A global really should be
> properly namespaced.
Good point... I'll fix the naming. Thanks.