public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Binbin Wu <binbin.wu@linux.intel.com>
To: Paolo Bonzini <pbonzini@redhat.com>,
	"Edgecombe, Rick P" <rick.p.edgecombe@intel.com>
Cc: "seanjc@google.com" <seanjc@google.com>,
	"Li, Xiaoyao" <xiaoyao.li@intel.com>,
	"kvm@vger.kernel.org" <kvm@vger.kernel.org>,
	"Shutemov, Kirill" <kirill.shutemov@intel.com>,
	"Wu, Binbin" <binbin.wu@intel.com>
Subject: Re: Drop "KVM: TDX: Handle TDG.VP.VMCALL<GetTdVmCallInfo> hypercall"
Date: Thu, 24 Apr 2025 17:18:27 +0800	[thread overview]
Message-ID: <2c070dfe-5e50-4dbf-a52a-6b5e3a1da9ff@linux.intel.com> (raw)
In-Reply-To: <CABgObfaMRjeyhnP+QvTcZ+jKb6q-opCQ_a_MBFbj3AYF0ZDewg@mail.gmail.com>



On 4/23/2025 10:09 PM, Paolo Bonzini wrote:
> On Sat, Apr 19, 2025 at 12:16 AM Edgecombe, Rick P
> <rick.p.edgecombe@intel.com> wrote:
>> TDG.VP.VMCALL<INSTRUCTION.WBINVD> - Missing
>> TDG.VP.VMCALL<INSTRUCTION.PCONFIG> - Missing
> WBINVD and PCONFIG need to be implemented (PCONFIG can be a stub).
>
>> TDG.VP.VMCALL<Service.Query> - Missing
>> TDG.VP.VMCALL<Service.MigTD> - Missing
> Service needs to be implemented and return Unsupported (0xFFFFFFFE)
> for all services.
>
>> TDG.VP.VMCALL<GETQUOTE> - Have patches, but missing
>> TDG.VP.VMCALL<SETUPEVENTNOTIFYINTERRUPT> - Have patches, but missing
> These two need to be supported by userspace and one could say that
> (therefore) GetTdVmCallInfo would also have to be implemented by
> userspace. This probably is a good idea in general to leave the door
> open to more GetTdVmCallInfo leaves.
>
> In order to make it easy for userspace to implement GetQuote, it would
> be nice to have a status for Unsupported
> listed for GetQuote, because they need to add it anyway for future tdvcalls
>
> SetupEventNotifyInterrupt can be a stub if GetQuote is unsupported;
> therefore it's also trivial for userspace to implement it if the specs
> adds the "unsupported" return code for GetQuote.

IIUC, there are two things:
1. Add a "unsupported" status code to GHCI spec and list "unsupported" as the
    possible return code for GetQuote.
2. Userspace still needs handle the exit reason due to GetQuote and
    SetupEventNotifyInterrupt. But Userspace has two choices:
    - To have a full implementation for GetQuote, and also a full implementation
      for SetupEventNotifyInterrupt.
    - Just return "unsupported" for GetQuote, and the handling for
      SetupEventNotifyInterrupt can be a stub.

It is correct?

>
>> Xiaoyao was tossing around the idea of adding a dedicated "not implemented"
>> return code too. It could make it simpler to evolve the GHCI spec vs the all or
>> nothing approach. To me, the main finding here is that we need to have more
>> clarity on how the GHCI will evolve going forward.
> I agree that both of these are independently useful, the main action
> item for KVM being to move TdVmCallInfo to userspace

Implementing GetTdVmCallInfo in userspace is helpful only when there is GHCI
spec update, i.e., userspace is able to return the bitmaps for supported
TDVMCALLs, right?

Before the GHCI is changed, can we just leave the implementation of
GetTdVmCallInfo as it is or we want the userspace to implement GetTdVmCallInfo
now?


>   and add support
> for the other two userspace TDCALLs.
>
> Adding WBINVD/PCONFIG/Service is also something that has to be done,
> but less urgent since nobody is using them.
>
>
> Paolo
>
>


      parent reply	other threads:[~2025-04-24  9:18 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-04-16  3:12 Drop "KVM: TDX: Handle TDG.VP.VMCALL<GetTdVmCallInfo> hypercall" Edgecombe, Rick P
2025-04-18 13:24 ` Paolo Bonzini
2025-04-18 22:16   ` Edgecombe, Rick P
2025-04-23 14:09     ` Paolo Bonzini
2025-04-24  6:51       ` Shutemov, Kirill
2025-04-24 12:19         ` Paolo Bonzini
2025-04-24  9:18       ` Binbin Wu [this message]

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=2c070dfe-5e50-4dbf-a52a-6b5e3a1da9ff@linux.intel.com \
    --to=binbin.wu@linux.intel.com \
    --cc=binbin.wu@intel.com \
    --cc=kirill.shutemov@intel.com \
    --cc=kvm@vger.kernel.org \
    --cc=pbonzini@redhat.com \
    --cc=rick.p.edgecombe@intel.com \
    --cc=seanjc@google.com \
    --cc=xiaoyao.li@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