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>,
"kas@kernel.org" <kas@kernel.org>,
"Annapurve, Vishal" <vannapurve@google.com>,
"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: Wed, 16 Sep 2026 18:49:47 +0000 [thread overview]
Message-ID: <736a9315f3cc3d8ef7079b784bfcc7b014386bd8.camel@intel.com> (raw)
In-Reply-To: <aqrZUZtSZ-YItclT@google.com>
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.
>
> Is the CPU spinning the entire time? Or is the quote degeneration I/O-like?
Today the CPU will mostly be working. In the future it could be waiting for the
shared HW. This would take much longer.
> >
>
> > A resumable TDG quote call would have to solve a slightly different
> > problem. A bad guest could refuse to resume the TDG call and hold the TDX
> > module extension save state slot hostage.
>
> The whole "what about guest interrupts?" thing makes me think the quote
> generation is CPU-bound, i.e. not I/O-like.
>
> 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.
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. Or, hmm, I guess the
guest could coordinate entering the TDX module on each vCPU to get a flush. That
would be a new one.
>
> > If a quote operation is long enough, the TDG SEAMCALL should probably
> > support
> > a resumable-like flow from the guest side too, where it also monitors for
> > pending guest interrupts and returns from the TDG call to let the guest
> > handle them.
> >
> > Then the host wouldn't need a thread and a completion guest notification
> > mechanism. It basically transfers that complexity to the TDX module.
>
>
> > But it also might transfer some of the control. The TDX module would have
> > to embed some policy on how to decide when to inject guest interrupts. If
> > the host and TDX module had different logic on when to actually re-enter the
> > TD, that could be annoying.
>
> But the TDX-Module already has some policy, no? In the sense that it decides
> when to exit to the host because there's an interrupt pending.
Yes for exiting to the host. I was talking about re-entering the guest for a
guest pending event of some sort. Like if KVM decides to re-enter to handle some
event, but TDX module decides, nah we are going to work on the in-progress guest
call for a bit first.
>
> > == Summary ==
> >
> > From what we found, I think it doesn't seem overly impossible for the
> > module. But the exact cancellation rules and timeout logic would need to be
> > hashed out a bit more. The simple mutex on the host side does still seem a
> > fair amount simpler than the TDX module's fairness options.
> >
> > How do we feel about the roles and responsibility shifts? Any other problems
> > to solve?
>
> 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?
next prev parent reply other threads:[~2026-09-16 18:49 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 [this message]
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
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=736a9315f3cc3d8ef7079b784bfcc7b014386bd8.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