Message ID | eb5dd2a1d02c7afe320ab3beb6390da43a9bf0bc.1637799475.git.isaku.yamahata@intel.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | KVM: X86: TDX support | expand |
On Wed, Nov 24 2021 at 16:20, isaku yamahata wrote: > From: Sean Christopherson <sean.j.christopherson@intel.com> > > Define the TDCALL exit reason, which is carved out from the VMX exit > reason namespace as the TDCALL exit from TDX guest to TDX-SEAM is really > just a VM-Exit. How is this carved out? What's the value of this word salad? It's simply a new exit reason. Not more, not less. So what? > Co-developed-by: Xiaoyao Li <xiaoyao.li@intel.com> > Signed-off-by: Xiaoyao Li <xiaoyao.li@intel.com> > Signed-off-by: Sean Christopherson <sean.j.christopherson@intel.com> I'm pretty sure that it does not take two engineers to add a new exit reason define, but it takes at least two engineers to come up with a convoluted explanation for it. Thanks, tglx
On Thu, Nov 25, 2021, Thomas Gleixner wrote: > On Wed, Nov 24 2021 at 16:20, isaku yamahata wrote: > > From: Sean Christopherson <sean.j.christopherson@intel.com> > > > > Define the TDCALL exit reason, which is carved out from the VMX exit > > reason namespace as the TDCALL exit from TDX guest to TDX-SEAM is really > > just a VM-Exit. > > How is this carved out? What's the value of this word salad? > > It's simply a new exit reason. Not more, not less. So what? The changelog is alluding to the fact that KVM should never directly see a TDCALL VM-Exit. For TDX, KVM deals only with "returns" from the TDX-Module. The "carved out" bit is calling out that the transition from SEAM Non-Root (the TDX guest) to SEAM Root (the TDX Module) is actually a VT-x/VMX VM-Exit, e.g. if TDX were somehow implemented without relying on VT-x/VMX, then the TDCALL exit reason wouldn't exist. > > Co-developed-by: Xiaoyao Li <xiaoyao.li@intel.com> > > Signed-off-by: Xiaoyao Li <xiaoyao.li@intel.com> > > Signed-off-by: Sean Christopherson <sean.j.christopherson@intel.com> > > I'm pretty sure that it does not take two engineers to add a new exit > reason define, but it takes at least two engineers to come up with a > convoluted explanation for it. Nah, just one ;-)
diff --git a/arch/x86/include/uapi/asm/vmx.h b/arch/x86/include/uapi/asm/vmx.h index 946d761adbd3..ba5908dfc7c0 100644 --- a/arch/x86/include/uapi/asm/vmx.h +++ b/arch/x86/include/uapi/asm/vmx.h @@ -91,6 +91,7 @@ #define EXIT_REASON_UMWAIT 67 #define EXIT_REASON_TPAUSE 68 #define EXIT_REASON_BUS_LOCK 74 +#define EXIT_REASON_TDCALL 77 #define VMX_EXIT_REASONS \ { EXIT_REASON_EXCEPTION_NMI, "EXCEPTION_NMI" }, \ @@ -153,7 +154,8 @@ { EXIT_REASON_XRSTORS, "XRSTORS" }, \ { EXIT_REASON_UMWAIT, "UMWAIT" }, \ { EXIT_REASON_TPAUSE, "TPAUSE" }, \ - { EXIT_REASON_BUS_LOCK, "BUS_LOCK" } + { EXIT_REASON_BUS_LOCK, "BUS_LOCK" }, \ + { EXIT_REASON_TDCALL, "TDCALL" } #define VMX_EXIT_REASON_FLAGS \ { VMX_EXIT_REASONS_FAILED_VMENTRY, "FAILED_VMENTRY" }