All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sean Christopherson <seanjc@google.com>
To: Binbin Wu <binbin.wu@linux.intel.com>
Cc: Rick P Edgecombe <rick.p.edgecombe@intel.com>,
	"kvm@vger.kernel.org" <kvm@vger.kernel.org>,
	 "pbonzini@redhat.com" <pbonzini@redhat.com>,
	 "mikko.ylinen@linux.intel.com" <mikko.ylinen@linux.intel.com>,
	Kai Huang <kai.huang@intel.com>,
	 Jiewen Yao <jiewen.yao@intel.com>,
	Xiaoyao Li <xiaoyao.li@intel.com>,
	 Tony Lindgren <tony.lindgren@intel.com>,
	Adrian Hunter <adrian.hunter@intel.com>,
	 Reinette Chatre <reinette.chatre@intel.com>,
	 "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	Yan Y Zhao <yan.y.zhao@intel.com>,
	 Isaku Yamahata <isaku.yamahata@intel.com>,
	Kirill Shutemov <kirill.shutemov@intel.com>
Subject: Re: [RFC PATCH 4/4] KVM: TDX: Check KVM exit on KVM_HC_MAP_GPA_RANGE when TD finalize
Date: Wed, 11 Jun 2025 06:36:13 -0700	[thread overview]
Message-ID: <aEmGTZbMpZhtlkIh@google.com> (raw)
In-Reply-To: <31c4ab96-55bf-4f80-a6fd-3478cc1d1117@linux.intel.com>

On Wed, Jun 11, 2025, Binbin Wu wrote:
> On 6/11/2025 3:58 AM, Sean Christopherson wrote:
> > On Tue, Jun 10, 2025, Rick P Edgecombe wrote:
> > > It seems like the reasoning could be just to shrink the possible configurations
> > > KVM has to think about, and that we only have the option to do this now before
> > > the ABI becomes harder to change.
> > > 
> > > Did you need any QEMU changes as a result of this patch?
> > > 
> > > Wait, actually I think the patch is wrong, because KVM_CAP_EXIT_HYPERCALL could
> > > be called again after KVM_TDX_FINALIZE_VM. In which case userspace could get an
> > > exit unexpectedly. So should we drop this patch?
> > Yes, drop it.
> > 
> So, when the TDX guest calls MapGPA and KVM finds userspace doesn't opt-in
> KVM_HC_MAP_GPA_RANGE, just return error to userspace?

Why can't KVM just do what it already does, and return an error to the guest?

	if (!user_exit_on_hypercall(vcpu->kvm, KVM_HC_MAP_GPA_RANGE)) {
		ret = TDVMCALL_STATUS_INVALID_OPERAND;
		goto error;
	}

  reply	other threads:[~2025-06-11 13:36 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-06-10  2:14 [RFC PATCH 0/4] TDX attestation support and GHCI fixup Binbin Wu
2025-06-10  2:14 ` [RFC PATCH 1/4] KVM: TDX: Add new TDVMCALL status code for unsupported subfuncs Binbin Wu
2025-06-10  2:14 ` [RFC PATCH 2/4] KVM: TDX: Handle TDG.VP.VMCALL<GetQuote> Binbin Wu
2025-06-10  2:14 ` [RFC PATCH 3/4] KVM: TDX: Exit to userspace for GetTdVmCallInfo Binbin Wu
2025-06-10  9:16   ` Xiaoyao Li
2025-06-10 16:50     ` Edgecombe, Rick P
2025-06-10 16:54       ` Edgecombe, Rick P
2025-06-11  2:04         ` Binbin Wu
2025-06-11  2:37           ` Xiaoyao Li
2025-06-11 14:17             ` Edgecombe, Rick P
2025-06-11 14:34               ` Xiaoyao Li
2025-06-11 14:41                 ` Edgecombe, Rick P
2025-06-11  1:37     ` Binbin Wu
2025-06-11  2:17       ` Xiaoyao Li
2025-06-11 14:54         ` Sean Christopherson
2025-06-11 14:58           ` Edgecombe, Rick P
2025-06-11 16:26             ` Sean Christopherson
2025-06-11 16:53               ` Edgecombe, Rick P
2025-06-11 18:13                 ` Sean Christopherson
2025-06-11 18:52                   ` Edgecombe, Rick P
2025-06-12  8:27                   ` Huang, Kai
2025-06-12 15:26                     ` Edgecombe, Rick P
2025-06-20 18:27                   ` Edgecombe, Rick P
2025-06-10  2:14 ` [RFC PATCH 4/4] KVM: TDX: Check KVM exit on KVM_HC_MAP_GPA_RANGE when TD finalize Binbin Wu
2025-06-10 17:01   ` Edgecombe, Rick P
2025-06-10 19:58     ` Sean Christopherson
2025-06-11  1:22       ` Binbin Wu
2025-06-11 13:36         ` Sean Christopherson [this message]
2025-06-11 14:01           ` Xiaoyao Li
2025-06-11 14:04             ` Edgecombe, Rick P
2025-06-11 14:26               ` Xiaoyao Li
2025-06-11 16:00                 ` Binbin Wu
2025-06-11 15:33           ` 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=aEmGTZbMpZhtlkIh@google.com \
    --to=seanjc@google.com \
    --cc=adrian.hunter@intel.com \
    --cc=binbin.wu@linux.intel.com \
    --cc=isaku.yamahata@intel.com \
    --cc=jiewen.yao@intel.com \
    --cc=kai.huang@intel.com \
    --cc=kirill.shutemov@intel.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mikko.ylinen@linux.intel.com \
    --cc=pbonzini@redhat.com \
    --cc=reinette.chatre@intel.com \
    --cc=rick.p.edgecombe@intel.com \
    --cc=tony.lindgren@intel.com \
    --cc=xiaoyao.li@intel.com \
    --cc=yan.y.zhao@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.