Kernel KVM virtualization development
 help / color / mirror / Atom feed
From: Sean Christopherson <seanjc@google.com>
To: Rick P Edgecombe <rick.p.edgecombe@intel.com>
Cc: Yilun Xu <yilun.xu@intel.com>,
	Elena Reshetova <elena.reshetova@intel.com>,
	 Binbin Wu <binbin.wu@intel.com>,
	Dave Hansen <dave.hansen@intel.com>,
	 "kas@kernel.org" <kas@kernel.org>,
	Vishal Annapurve <vannapurve@google.com>,
	 "pbonzini@redhat.com" <pbonzini@redhat.com>,
	Peter Fang <peter.fang@intel.com>,
	 "kvm@vger.kernel.org" <kvm@vger.kernel.org>
Subject: Re: TDG quote analysis
Date: Wed, 16 Sep 2026 12:27:34 -0700	[thread overview]
Message-ID: <aqrtprn5YaMijVdZ@google.com> (raw)
In-Reply-To: <736a9315f3cc3d8ef7079b784bfcc7b014386bd8.camel@intel.com>

On Wed, Sep 16, 2026, Rick P Edgecombe wrote:
> On Wed, 2026-09-16 at 11:00 -0700, Sean Christopherson wrote:
> > On Wed, Sep 16, 2026, Rick P Edgecombe wrote:
> > > This DICE quote generation can take a long time. Exactly how long is not
> > > known, but it is expected to vary and often exceed the time a SEAMCALL can
> > > be executing in the TDX module by a considerable amount.
> > 
> > What's the ballpark?  Are we talking tens of nanoseconds, tens of
> > microseconds, tens of milliseconds?
> 
> I asked about this too. I have not seen any measurement yet for the real
> implementation. AFAIU the PQC stuff is not settled enough at the industry level
> to be sure in the long run. I have been under the impression of at least a ms or
> 2 for PQC signature based on general PQC signature benchmarks I've seen. That is
> only my guess though.
> 
> If you are thinking the implementation could punt on how to handle the guest
> interrupts for now, that seems reasonable. I'd think exiting to handle the host
> interrupts could not be skipped though.

I'm just trying to understand the scope of the problem we're trying to solve.
E.g. I don't think any design will save us if generating a quote requires a CPU
to be spinning for multiple milliseconds.

> > Does the TDX Module *need* to provide a save slot?  What would prevent TDX
> > from requiring the guest to provide storage for whatever in-flight data is
> > needed? That way there it doesn't matter if the guest never resumes the call,
> > it can only hurt itself.
> 
> I was thinking about this too, but thought it sounded a bit like the NAKed SNP
> secure AVIC pattern. At least the TDX module would need to handle getting asked
> to zap the guest page that was given to be a saved state slot.

But doesn't the TDX Module already need to do this?  It's writing guest memory,
no?  So it needs to prevent the page from being freed while it's handling the
quote.  Just put the onus on the guest to provide the same GPA when restarting
the TDG.

If the host yanks a page away from the guest, the guest is hosed no matter what.
If the guest frees an in-use page, e.g. converts it to SHARED, then that's 100%
a guest bug.

> The host would probably need to be involved in unmapping the page from the S-EPT
> while in use too, since it would need a TLB flush on each vCPU. Otherwise the
> guest could see the intermediate memory of the operation.

Do we care?  I was and am assuming "no".  Unless there is sensitive TDX-Module
data that needs to be saved, it's again on the guest not to read half-baked data.

> > What about the whole "TD-specific data in the quote" thing?  If getting a
> > quote (or report?) is punted to the host, I'd still like to keep it out of
> > KVM.
> 
> I checked another option for this: Write the nonce to the TDX module via some
> new TDG call, then just ask for a TD scoped quote which fills in everything from
> what the TDX module already knows. TD details and nonce. Apparently it could
> work.
> 
> Then nothing gets passed out of the guest except for request for a quote.  We'd
> have to break compatibility with the SGX based quotes though. Is it worth it? Vs
> just utilizing the upstream KVM functionality unchanged?

  reply	other threads:[~2026-09-16 19:27 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-16  0:48 TDG quote analysis Edgecombe, Rick P
2026-09-16 18:00 ` Sean Christopherson
2026-09-16 18:49   ` Edgecombe, Rick P
2026-09-16 19:27     ` Sean Christopherson [this message]
2026-09-16 22:31       ` Edgecombe, Rick P
2026-09-16 23:00         ` Peter Fang
2026-09-16 23:57           ` Sean Christopherson
2026-09-17  0:56             ` Edgecombe, Rick P
2026-09-17 13:37               ` Sean Christopherson
2026-09-17 18:12                 ` Edgecombe, Rick P
2026-09-17 19:57                   ` Sean Christopherson
2026-09-17 21:32                     ` Edgecombe, Rick P
2026-09-18  0:04                       ` Sean Christopherson
2026-09-18  2:39                         ` Edgecombe, Rick P
2026-09-18 13:13                           ` Sean Christopherson
2026-09-18 18:12                             ` Edgecombe, Rick P
2026-09-18 21:32                               ` Sean Christopherson
2026-09-21 23:00                                 ` Peter Fang
2026-09-21 23:06                                   ` Dave Hansen
2026-09-23  4:09                                     ` Vishal Annapurve
2026-09-24  0:03                                       ` Vishal Annapurve
2026-09-24  0:18                                         ` Sean Christopherson
2026-09-24  0:44                                           ` Edgecombe, Rick P
2026-09-24 16:28                                             ` Sean Christopherson
2026-09-21 23:04                                 ` Dave Hansen
2026-09-21 23:19                                   ` Sean Christopherson
2026-09-21 23:36                                     ` Dave Hansen
2026-09-21 23:46                                       ` Sean Christopherson
2026-09-22  0:03                                         ` Dave Hansen
2026-09-22  6:48                                           ` Reshetova, Elena
2026-09-22 17:07                                             ` Edgecombe, Rick P
2026-09-23  8:50                                               ` Reshetova, Elena
2026-09-23 22:50                                                 ` Peter Fang

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=aqrtprn5YaMijVdZ@google.com \
    --to=seanjc@google.com \
    --cc=binbin.wu@intel.com \
    --cc=dave.hansen@intel.com \
    --cc=elena.reshetova@intel.com \
    --cc=kas@kernel.org \
    --cc=kvm@vger.kernel.org \
    --cc=pbonzini@redhat.com \
    --cc=peter.fang@intel.com \
    --cc=rick.p.edgecombe@intel.com \
    --cc=vannapurve@google.com \
    --cc=yilun.xu@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox