From: Sean Christopherson <seanjc@google.com>
To: Rick P Edgecombe <rick.p.edgecombe@intel.com>
Cc: Xiaoyao Li <xiaoyao.li@intel.com>,
"sashiko-reviews@lists.linux.dev"
<sashiko-reviews@lists.linux.dev>,
"pbonzini@redhat.com" <pbonzini@redhat.com>,
"kvm@vger.kernel.org" <kvm@vger.kernel.org>
Subject: Re: [PATCH v3 3/4] KVM: TDX: Don't assume exit_reason[31:16] as all-0 in tdx_to_vmx_exit_reason()
Date: Thu, 13 Aug 2026 16:44:37 -0700 [thread overview]
Message-ID: <an5W5XC97HK229MX@google.com> (raw)
In-Reply-To: <138969948dac13369ddebd72bf523dda4dda6b85.camel@intel.com>
On Wed, Aug 12, 2026, Rick P Edgecombe wrote:
> Side note. I really dislike how tangled this area is for something that seems
> like it should be much more straightforward. Deriving partially I think from the
> overloading of the TDVMCALL leafs with the exit reasons. So we have things like:
> ...
> case EXIT_REASON_EPT_VIOLATION:
> return EXIT_REASON_EPT_MISCONFIG;
> ...
I peeked at that code again, and FWIW I still think swizzling the exit_reason for
TDVMCALL is the least awful solution. If we don't do that, then we'll have to
update every single use of the exit_reason to demux TDVMCALL into the "real" exit
reason, which will be a mess.
And once we track the exit_reason separately from vp_enter_ret, IMO it all becomes
more logical and easier to follow. vp_enter_ret holds the information about why
VP.ENTER returned/exited, while exit_reason holds information about why the _guest_
exited. Obviously it's imperfect since we're still fudging EXIT_REASON_EPT_MISCONFIG,
but again, I think that's a better alternative than demuxing exit_reason in multiple
locations.
next prev parent reply other threads:[~2026-08-13 23:44 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-12 8:02 [PATCH v3 0/4] KVM: TDX: Enable VM-DoS Prevention Features for TDX Xiaoyao Li
2026-08-12 8:02 ` [PATCH v3 1/4] KVM: TDX: Enable Notify VM exit Xiaoyao Li
2026-08-12 8:02 ` [PATCH v3 2/4] KVM: TDX: Set bits 31:16 to 0 for the synthesized Exit Reason Xiaoyao Li
2026-08-12 21:58 ` Edgecombe, Rick P
2026-08-12 8:02 ` [PATCH v3 3/4] KVM: TDX: Don't assume exit_reason[31:16] as all-0 in tdx_to_vmx_exit_reason() Xiaoyao Li
2026-08-12 8:23 ` sashiko-bot
2026-08-12 9:07 ` Xiaoyao Li
2026-08-12 22:55 ` Edgecombe, Rick P
2026-08-13 23:44 ` Sean Christopherson [this message]
2026-08-14 1:02 ` Xiaoyao Li
2026-08-13 0:14 ` Sean Christopherson
2026-08-13 8:42 ` Xiaoyao Li
2026-08-12 8:02 ` [PATCH v3 4/4] KVM: TDX: Enable Bus Lock VM exit Xiaoyao Li
2026-08-12 8:20 ` sashiko-bot
2026-08-12 9:11 ` Xiaoyao Li
2026-08-13 0:06 ` Sean Christopherson
2026-08-12 22:58 ` Edgecombe, Rick P
2026-08-13 11:17 ` Xiaoyao Li
2026-08-13 14:43 ` Sean Christopherson
2026-08-14 0:49 ` 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=an5W5XC97HK229MX@google.com \
--to=seanjc@google.com \
--cc=kvm@vger.kernel.org \
--cc=pbonzini@redhat.com \
--cc=rick.p.edgecombe@intel.com \
--cc=sashiko-reviews@lists.linux.dev \
--cc=xiaoyao.li@intel.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