[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Z6vhTGHKIC_hK5z4@google.com>
Date: Tue, 11 Feb 2025 15:46:20 -0800
From: Sean Christopherson <seanjc@...gle.com>
To: Chao Gao <chao.gao@...el.com>
Cc: Binbin Wu <binbin.wu@...ux.intel.com>, pbonzini@...hat.com, kvm@...r.kernel.org,
rick.p.edgecombe@...el.com, kai.huang@...el.com, adrian.hunter@...el.com,
reinette.chatre@...el.com, xiaoyao.li@...el.com, tony.lindgren@...el.com,
isaku.yamahata@...el.com, yan.y.zhao@...el.com, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2 3/8] KVM: TDX: Add a place holder for handler of TDX
hypercalls (TDG.VP.VMCALL)
On Tue, Feb 11, 2025, Chao Gao wrote:
> >@@ -810,6 +829,7 @@ static bool tdx_guest_state_is_invalid(struct kvm_vcpu *vcpu)
> > static __always_inline u32 tdx_to_vmx_exit_reason(struct kvm_vcpu *vcpu)
> > {
> > struct vcpu_tdx *tdx = to_tdx(vcpu);
> >+ u32 exit_reason;
> >
> > switch (tdx->vp_enter_ret & TDX_SEAMCALL_STATUS_MASK) {
> > case TDX_SUCCESS:
> >@@ -822,7 +842,21 @@ static __always_inline u32 tdx_to_vmx_exit_reason(struct kvm_vcpu *vcpu)
> > return -1u;
> > }
> >
> >- return tdx->vp_enter_ret;
> >+ exit_reason = tdx->vp_enter_ret;
> >+
> >+ switch (exit_reason) {
> >+ case EXIT_REASON_TDCALL:
> >+ if (tdvmcall_exit_type(vcpu))
> >+ return EXIT_REASON_VMCALL;
> >+
> >+ if (tdvmcall_leaf(vcpu) < 0x10000)
>
> Can you add a comment for the hard-coded 0x10000?
Or better yet, a #define of some kind (with a comment ;-) ).
Powered by blists - more mailing lists