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

On Fri, 2026-09-18 at 06:13 -0700, Sean Christopherson wrote:
> On Fri, Sep 18, 2026, Rick P Edgecombe wrote:
> > On Thu, 2026-09-17 at 17:04 -0700, Sean Christopherson wrote:
> > >   If supported for the specific request type, the host VMM can request an
> > >   interrupted request to be aborted.
> > > 
> > > Though per the above, apparently whether or not that's going to be
> > > supported is
> > > TBD?
> > 
> > So extension aborts are a whole 'nother topic. And "support" has a nuanced
> > answer to boot. I'd be very glad to hear your thoughts on it. Should we
> > leave it for a later topic or get into it now? I *think* we don't need it,
> > but the more we get into the details here, the more it's a notable thing we
> > haven't covered.
> 
> How is saying "I no longer want to complete this quote" at all complex?  I can
> see how aborting a request to the S3M might be somewhat pointless, but
> inserting the equivalent to signal_pending() in a long-running operation
> doesn't seem that difficult.

As an interface it is not complex. But as an implementation, there are tradeoffs
and various options.
> > > 
> > > [...]

> > > 
> > 
> > I think the abstract descriptions are not helping, so I'll try some more
> > details. Today the "thread" involves something like a vCPU in a TD. You can
> > see
> > some references in the TDX base spec like:
> >    Currently, TDX Module extensions are implemented as guests running in
> > SEAM non- root mode, called NRX Modules. Technically, each NRX Module is
> > similar to a TD.
> 
> So my above statement that "it's not true interruption, it's basically
> voluntary preemption" is wrong?  Because if the quote crud is running in a TD,
> then events will trigger VM-Exit, and it will be impossible to make forward
> progress without SEAMRETing to the host.
> 
> If that's true, then that changes my understanding of this just a bit, because
> it means the quote operation isn't manually saving state at a "good stopping
> point", it's relying on the VM-Exit to save/restore at whenever it happened to
> be.

Yea, I'd think it is best not to mess with crypto implementations to add
anything like checkpoints. That is what extensions bring to the table. The other
resumable seamcalls basically work like checkpoints. But it is not suitable for
all operations.

>  But given that you say "This idea came up before actually", maybe chunking
> the quote operation isn't a big lift?

The idea that came up was to have a saved state are per-TD. But this only
eliminated concurrency issues in the SW based flow. In the future a HW based
flow would be S3M limited. Which is why I keep saying a redesigned solution
should be robust to concurrency limitations.

> 
> But the original mail says this:
> 
>    -- Guest Interrupts --
> 
>    It is not nice to keep the guest from running for too long. The
> TDH.QUOTE.GET
>    SEAMCALL monitors for host interrupts, but not guest ones. Similarly, the
> SGX
>             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>    quoting enclave doesn't know what is happening in the TD. So, to help
> reduce guest latencies, the GHCI exposes a way to register for a notification
>    (SetupEventNotifyInterrupt) when the quoting is finished. A quote TDVMCALL
>    handler can start the quote operation on another host thread, and resume
>    guest execution waiting for the quote to finish.
> 
> which strongly suggests active polling.  Do you see why I don't want abstract
> descriptions?  Similar to changelogs, there's a balance between "too detailed"
> and "too abstract", and right now all of this is firmly on the "too abstract"
> side of the world.
> 

For a host interrupt, I expected basically the same flow as a normal TD. For the
guest flow, I don't know the exact vmx-level solution for it. I threw out
polling and heard there could be a cleaner option. Not sure what it was.

> > 
> > 
> > Dave will probably not get a chance to respond this week, but we should
> > maybe discuss what acceptable guest latency actually is.
> 
> Yes.  But it's not necessarily about "acceptable" guest latency, I care more
> about *predictable* guest latency.  E.g. making up numbers to illustrate the
> point, achieving 50us latency for the happy case is meaningless if the P99
> latency is 10ms.

The SEAMCALLs today have max latency and they get measured through some testing
process. In practice, some exceed it based on the reasoning that they are only
run once or a few times (setup, etc). So for the host side that is how it got
discussed. It was in terms of worst case.

But now I'm wondering what your specific interest is. It seems you have more
interest in non-KVM in-the-loop guest side latency than you did on host side.
Which is fine. But it makes me want to double check: You want an average and
worse case latency for the first DICE attestation "SW" flow?

Or you want an average and worst case promise for the future flows?

Or you want an average and worse case based on whatever guest interrupt
detection scheme is used for TDG extension calls?

The last one seems the most relevant to me. And the point would be to determine
the tradeoffs between host thread based quote call and a TDG call. But of course
none of this is built yet such that it could be measured. This was the "here is
how it could look in general" discussion. So I think it would take some TDX
module POC work.

  reply	other threads:[~2026-09-18 18:12 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
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 [this message]
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=7d40bcd97e01390a345ce1dbe26264e7b064a619.camel@intel.com \
    --to=rick.p.edgecombe@intel.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=seanjc@google.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