From: Xiaoyao Li <xiaoyao.li@intel.com>
To: Sean Christopherson <seanjc@google.com>
Cc: Rick P Edgecombe <rick.p.edgecombe@intel.com>,
"pbonzini@redhat.com" <pbonzini@redhat.com>,
"kvm@vger.kernel.org" <kvm@vger.kernel.org>,
"linux-coco@lists.linux.dev" <linux-coco@lists.linux.dev>,
"kas@kernel.org" <kas@kernel.org>,
"nik.borisov@suse.com" <nik.borisov@suse.com>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v2 2/3] KVM: TDX: Fix the exit reason handling
Date: Thu, 13 Aug 2026 16:34:42 +0800 [thread overview]
Message-ID: <d8bfdff4-f380-4a29-b0da-366ffca4dbd3@intel.com> (raw)
In-Reply-To: <an0M-LwrKxLrNC9H@google.com>
On 8/13/2026 8:16 AM, Sean Christopherson wrote:
> On Tue, Aug 11, 2026, Xiaoyao Li wrote:
>> On 8/11/2026 8:38 AM, Edgecombe, Rick P wrote:
>>> On Mon, 2026-08-10 at 19:21 +0800, Xiaoyao Li wrote:
>>>> ---
>>>> arch/x86/kvm/vmx/tdx.c | 35 ++++++++++++++++++++++-------------
>>>> 1 file changed, 22 insertions(+), 13 deletions(-)
>>>>
>>>> diff --git a/arch/x86/kvm/vmx/tdx.c b/arch/x86/kvm/vmx/tdx.c
>>>> index 7338ac0af693..a89885d550c9 100644
>>>> --- a/arch/x86/kvm/vmx/tdx.c
>>>> +++ b/arch/x86/kvm/vmx/tdx.c
>>>> @@ -921,10 +921,10 @@ static __always_inline u32 tdcall_to_vmx_exit_reason(struct kvm_vcpu *vcpu)
>>>> return EXIT_REASON_TDCALL;
>>>> }
>>>> -static __always_inline u32 tdx_to_vmx_exit_reason(struct kvm_vcpu *vcpu)
>>>> +static __always_inline union vmx_exit_reason tdx_to_vmx_exit_reason(struct kvm_vcpu *vcpu)
>>>> {
>>>> struct vcpu_tdx *tdx = to_tdx(vcpu);
>>>> - u32 exit_reason;
>>>> + union vmx_exit_reason exit_reason;
>>>> switch (tdx->vp_enter_ret & TDX_SEAMCALL_STATUS_MASK) {
>>>> case TDX_SUCCESS:
>>>> @@ -934,23 +934,33 @@ static __always_inline u32 tdx_to_vmx_exit_reason(struct kvm_vcpu *vcpu)
>>>> case TDX_NON_RECOVERABLE_TD_WRONG_APIC_MODE:
>>>> break;
>>>> default:
>>>> - return -1u;
>>>> + /*
>>>> + * Synthesize an invalid bogus Exit Reason, as the TDX-Module
>>>
>>> I think this blurb came from Sean, but can we standardize on "TDX module"? The
>>> code currently uses "TDX module" and "TDX-module" and "TDX-module" used much
>>> less. I also don't see why it needs the "-".
>
> FWIW, I like TDX-Module to clearly identify it as _the_ TDX-Module, versus a
> potential TDX module provided the kernel, i.e. a tdx.ko module.
# git grep "TDX-Module" | wc -l
13
# git grep "TDX module" | wc -l
162
#git grep "TDX-Module" | grep kvm | wc -l
9
#git grep "TDX module" | grep kvm | wc -l
42
There are 13 "TDX-Module" vs 162 "TDX module" in the kernel, and
9 "TDX-Module" vs 42 "TDX module" in KVM files. Given this, I changed to
use "TDX module"
next prev parent reply other threads:[~2026-08-13 8:34 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-10 11:21 [PATCH v2 0/3] KVM: TDX: Enable VM-DoS Prevention Features for TDX Xiaoyao Li
2026-08-10 11:21 ` [PATCH v2 1/3] KVM: TDX: Enable Notify VM exit Xiaoyao Li
2026-08-11 0:37 ` Edgecombe, Rick P
2026-08-10 11:21 ` [PATCH v2 2/3] KVM: TDX: Fix the exit reason handling Xiaoyao Li
2026-08-10 11:39 ` sashiko-bot
2026-08-10 12:02 ` Xiaoyao Li
2026-08-10 23:57 ` Sean Christopherson
2026-08-11 0:04 ` Sean Christopherson
2026-08-12 3:20 ` Xiaoyao Li
2026-08-12 12:28 ` Xiaoyao Li
2026-08-11 0:19 ` Xiaoyao Li
2026-08-13 0:20 ` Sean Christopherson
2026-08-13 8:10 ` Xiaoyao Li
2026-08-11 0:03 ` Sean Christopherson
2026-08-11 3:17 ` Xiaoyao Li
2026-08-11 17:36 ` Sean Christopherson
2026-08-11 0:38 ` Edgecombe, Rick P
[not found] ` <6bb1328d-e995-4ad7-9744-3ab01d2ae591@intel.com>
2026-08-11 15:20 ` Edgecombe, Rick P
2026-08-12 7:29 ` Xiaoyao Li
2026-08-12 20:21 ` Edgecombe, Rick P
2026-08-13 0:16 ` Sean Christopherson
2026-08-13 8:34 ` Xiaoyao Li [this message]
2026-08-10 11:22 ` [PATCH v2 3/3] KVM: TDX: Enable Bus Lock VM exit Xiaoyao Li
2026-08-10 11:46 ` sashiko-bot
2026-08-10 12:03 ` Xiaoyao Li
2026-08-11 1:18 ` Edgecombe, Rick P
2026-08-11 1:44 ` Xiaoyao Li
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=d8bfdff4-f380-4a29-b0da-366ffca4dbd3@intel.com \
--to=xiaoyao.li@intel.com \
--cc=kas@kernel.org \
--cc=kvm@vger.kernel.org \
--cc=linux-coco@lists.linux.dev \
--cc=linux-kernel@vger.kernel.org \
--cc=nik.borisov@suse.com \
--cc=pbonzini@redhat.com \
--cc=rick.p.edgecombe@intel.com \
--cc=seanjc@google.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