From: Xiaoyao Li <xiaoyao.li@intel.com>
To: Sean Christopherson <seanjc@google.com>
Cc: Paolo Bonzini <pbonzini@redhat.com>,
Rick Edgecombe <rick.p.edgecombe@intel.com>,
Kiryl Shutsemau <kas@kernel.org>,
Nikolay Borisov <nik.borisov@suse.com>,
kvm@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-coco@lists.linux.dev
Subject: Re: [PATCH v2 2/3] KVM: TDX: Fix the exit reason handling
Date: Tue, 11 Aug 2026 11:17:21 +0800 [thread overview]
Message-ID: <30686bd2-37a4-4cff-82df-29c918444a58@intel.com> (raw)
In-Reply-To: <anpmxJOESl3swUpd@google.com>
On 8/11/2026 8:03 AM, Sean Christopherson wrote:
> The shortlog is way too generic, and the changelog is light on details. Over
> the weekend, I managed to forget why this was necessary, and it took me a few
> seconds to recall why we need to avoid setting bits 31:16. Of course, one could
> argue that says as much about me as it does the shortlog+changelog...
>
> Oh, and shortlogs like "Fix the exit reason handling" sometimes lead to amusing
> follow-ups like "Really fix the exit reason handling". Don't be that person :-)
>
> Something like:
>
> KVM: TDX: Don't clobber exit_reason[31:16] when TDX-Module didn't try VM-Entry
1. It's not only about clobbering the exit_reason[31:16], but also about
how to interpret the basic exit, e.g.. the change
- switch (exit_reason) {
+ switch (exit_reason.basic) {
2. It's not only about TDX module doesn't try VM entry, bus also about a
valid VM exit after successful VM entry. This patch also preserves the
exit_reason[31:16] for a valid VM exit. (One could argue that existing
code cannot clobber exit_reason[31;16] because the code to clobber it
requires the [31:16] to be 0, because of switch (exit_reason))
3. For the case where TDX module doesn't try VM-Entry, I'm not sure if
"clobber" is the correct word. There is no valid exit reason, so nothing
to be really clobbered. Just don't synthesize a exit reason with
non-zero bit 31:16.
My intent was just using one patch to handle them all, so as to make KVM
behave correctly after enabling Bus Lock VM exit for TDX in the next
patch. Because they are targeted for stable kernels.
What's your advice then? What do you think of spliting it into multiple
so that it's easier to write a shortlog and changelog for each one.
next prev parent reply other threads:[~2026-08-11 3:17 UTC|newest]
Thread overview: 11+ 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-11 0:03 ` Sean Christopherson
2026-08-11 3:17 ` Xiaoyao Li [this message]
2026-08-11 0:38 ` Edgecombe, Rick P
2026-08-11 1:32 ` Xiaoyao Li
2026-08-10 11:22 ` [PATCH v2 3/3] KVM: TDX: Enable Bus Lock VM exit 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=30686bd2-37a4-4cff-82df-29c918444a58@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