public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: "Edgecombe, Rick P" <rick.p.edgecombe@intel.com>,
	"seanjc@google.com" <seanjc@google.com>
Cc: "Li, Xiaoyao" <xiaoyao.li@intel.com>,
	"kvm@vger.kernel.org" <kvm@vger.kernel.org>,
	"Wu, Binbin" <binbin.wu@intel.com>
Subject: Re: Drop "KVM: TDX: Handle TDG.VP.VMCALL<GetTdVmCallInfo> hypercall"
Date: Fri, 18 Apr 2025 15:24:09 +0200	[thread overview]
Message-ID: <5e7e8cb7-27b2-416d-9262-e585034327be@redhat.com> (raw)
In-Reply-To: <da3e2f6bdc67b1b02d99a6b57ffc9df48a0f4743.camel@intel.com>

On 4/16/25 05:12, Edgecombe, Rick P wrote:
> Hi,
> 
> We should consider dropping/reverting "KVM: TDX: Handle
> TDG.VP.VMCALL<GetTdVmCallInfo> hypercall" from the base TDX merge. The reason is
> because Xiaoyao noticed that the GHCI spec[0] implies that KVM should only
> return success for that TDVMCALL if *all* TDVMCALLs are supported, but KVM does
> that despite skipping implementing a few. On investigation there are also no
> users except its selftest[1], and the spec is ambiguous on the right way to
> handle the case in question.
> 
> The spec talks about VMMs not supporting all TDVMCALLs, but doesn't say how to
> enumerate this (i.e. it doesn't says what the GetTdVmCallInfo VMMs should do
> instead of succeed). It actually doesn't cover how to handle if the guest calls
> an unsupported TDVMCALL either. Historically, KVM patches have returned
> TDVMCALL_STATUS_INVALID_OPERAND for any unknown TDVMCALL, as a reasonable
> interpretation of the ambiguous spec. So the spec needs to get clarified in this
> whole area.

It does, but I think we should just implement the remaining TDVMCALLs 
before 6.16 is out, which is in a while.  All that is left is really the 
userspace TDVMCALLs GetQuote, ReportFatalError and 
SetupEventNotifyInterrupt.

For Instruction.PCONFIG and for VE.RequestMMIO a dummy implementation is 
valid and returning success is probably even better than invalid-operand.

Paolo

> Since there are no real callers let's just drop GetTdVmCallInfo for now. We can
> add it back when the GHCI folks amend the spec to close the ambiguities. As a
> bonus we can save some code for the merge.
> 
> We dropped the patch internally and did some testing. Also, Binbin and I
> searched the guest code for any rare callers. Everything seems fine to drop it.
> 
> If we want to leave it in, it's probably not a disaster. We'll just slightly
> diverge from the spec. It may not be a problem depending on how the ambiguity
> resolves in future spec updates.
> 
> Thanks,
> 
> Rick
> 
> [0]
> https://www.intel.com/content/www/us/en/content-details/726790/guest-host-communication-interface-ghci-for-intel-trust-domain-extensions-intel-tdx.html
> [1]
> https://lore.kernel.org/kvm/20250414214801.2693294-14-sagis@google.com/


  reply	other threads:[~2025-04-18 13:24 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 [this message]
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

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=5e7e8cb7-27b2-416d-9262-e585034327be@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=binbin.wu@intel.com \
    --cc=kvm@vger.kernel.org \
    --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