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 22:31:50 +0000 [thread overview]
Message-ID: <dae5a64112c9c949524226c66efac9c669df5b92.camel@intel.com> (raw)
In-Reply-To: <aqrtprn5YaMijVdZ@google.com>
On Wed, 2026-09-16 at 12:27 -0700, Sean Christopherson wrote:
> > 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.
Elena, any updated estimates on CPU based quote generation and HW based?
>
> > > 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.
When you make a non-interruptible/non-restartable call, the TDX module doesn't
rush out if there is an interrupt pending. It lets the call fully complete, if
it is short. During that time, if it is operating on private memory it would
take internal locks to prevent the page from getting zapped out or swapped.
>
> 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.
Imagine the scenario of a vCPU executing the TDG quote operation. From another
CPU in the host, KVM zaps the page the TDG call is using for it's save state.
TDX module would need to know it can't yank the page that was actively being
used by the TDG quote operation. So I guess it would have to leave the GPA's S-
EPT entry locked. The VMM could use the kick scheme to break through.
But I would think it would need to keep the save state page from getting swapped
out during the entire quote operation actually. (i.e. between the resumes).
Because it is probably not safe to reset data on some execution context
operating with secret keys, etc. In that case, then some other more destructive
operation would be needed to let the guest still zap the S-EPT. Because the kick
scheme would not unlock the S-EPT entry in that case.
There might be some other solutions to avoid swapping out the per-operation
state.... Not sure.
>
> > 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.
It is basically asking whether the extension operation would use save state area
mapped with the guests keyid or the TDX modules keyid.
This quoting operation is working with secret keys, so I don't think we can let
the guest modify or see the memory. Think trying to do a secret operation while
the guest could interrupt it and look at the registers.
next prev parent reply other threads:[~2026-09-16 22:32 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 [this message]
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=dae5a64112c9c949524226c66efac9c669df5b92.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