[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <936ccea77b474fbad1bde799ee92139356f91c5f.camel@intel.com>
Date: Tue, 10 Jun 2025 17:01:41 +0000
From: "Edgecombe, Rick P" <rick.p.edgecombe@...el.com>
To: "kvm@...r.kernel.org" <kvm@...r.kernel.org>, "pbonzini@...hat.com"
<pbonzini@...hat.com>, "seanjc@...gle.com" <seanjc@...gle.com>,
"binbin.wu@...ux.intel.com" <binbin.wu@...ux.intel.com>
CC: "mikko.ylinen@...ux.intel.com" <mikko.ylinen@...ux.intel.com>, "Huang,
Kai" <kai.huang@...el.com>, "Yao, Jiewen" <jiewen.yao@...el.com>, "Li,
Xiaoyao" <xiaoyao.li@...el.com>, "Lindgren, Tony" <tony.lindgren@...el.com>,
"Hunter, Adrian" <adrian.hunter@...el.com>, "Chatre, Reinette"
<reinette.chatre@...el.com>, "linux-kernel@...r.kernel.org"
<linux-kernel@...r.kernel.org>, "Zhao, Yan Y" <yan.y.zhao@...el.com>,
"Yamahata, Isaku" <isaku.yamahata@...el.com>, "Shutemov, Kirill"
<kirill.shutemov@...el.com>
Subject: Re: [RFC PATCH 4/4] KVM: TDX: Check KVM exit on KVM_HC_MAP_GPA_RANGE
when TD finalize
On Tue, 2025-06-10 at 10:14 +0800, Binbin Wu wrote:
> Check userspace has enabled KVM exit on KVM_HC_MAP_GPA_RANGE during
> KVM_TDX_FINALIZE_VM.
>
> TDVMCALL_MAP_GPA is one of the GHCI base TDVMCALLs, so it must be
> implemented by VMM to support TDX guests. KVM converts TDVMCALL_MAP_GPA
> to KVM_HC_MAP_GPA_RANGE, which requires userspace to enable
> KVM_CAP_EXIT_HYPERCALL with KVM_HC_MAP_GPA_RANGE bit set. Check it when
> userspace requests KVM_TDX_FINALIZE_VM, so that there is no need to check
> it during TDX guests running.
>
> Signed-off-by: Binbin Wu <binbin.wu@...ux.intel.com>
Do we need this change? It seems reasonable, but I don't think we need KVM to
ensure that userspace creates a TD that meets the GHCI spec. So I'm not sure
about the justification.
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?
Powered by blists - more mailing lists