From: Zihui Guo <youzih27@gmail.com>
To: Sean Christopherson <seanjc@google.com>,
Paolo Bonzini <pbonzini@redhat.com>
Cc: Chao Gao <chao.gao@intel.com>,
Binbin Wu <binbin.wu@linux.intel.com>,
kvm@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH 0/3] KVM: nVMX: Add missing guest-state checks on nested VM-Enter
Date: Thu, 3 Dec 2026 05:34:45 +0000 [thread overview]
Message-ID: <20261203053449.25917-1-youzih27@gmail.com> (raw)
Three guest-state checks from SDM Vol. 3C (rev. 093) 29.3.1 are missing
from nested_vmx_check_guest_state().
Patch 1 adds the canonical check of the guest's IA32_S_CET. The CET
consistency checks were meant to cover it but treat S_CET like SSP. The
hardware still checks the value on VM-Enter of vmcs02, since KVM loads
it unchanged, so this only moves the failure to the consistency checks.
Patches 2 and 3 add the HLT checks: SS.DPL must be 0, and only some
events may be injected. Here the hardware cannot help, because KVM
emulates the HLT state of L2 and never loads vmcs12's activity state
into vmcs02, so L1 currently gets a successful VM-Enter where the
architecture requires a VM-Entry failure. The injected-event check is
the TODO suggested in [1]. The v3 series [2] adds other activity-state
checks to the same function, so these patches may need a trivial rebase
on top of it. A 2019 patch [3] had similar HLT checks and was not
merged.
All three are compile-tested only (x86_64 defconfig with KVM_INTEL, W=1,
no warnings). No machine with VMX was available, so none of them was
run, and there are no kvm-unit-tests for these cases yet.
Assisted-by: Claude:claude-opus-5-5
[1] https://lore.kernel.org/all/atqDVkHjdJ2iF9Uv@google.com/
[2] https://lore.kernel.org/all/20261022215146.233479-1-amirmohammad.eftekhar@cispa.de/
[3] https://lore.kernel.org/all/20190819214650.41991-3-nikita.leshchenko@oracle.com/
Zihui Guo (3):
KVM: nVMX: Check that the guest's IA32_S_CET is canonical on VM-Enter
KVM: nVMX: Reject nested VM-Enter to HLT with a non-zero SS.DPL
KVM: nVMX: Check the event injected into the HLT state on nested
VM-Enter
arch/x86/kvm/vmx/nested.c | 31 +++++++++++++++++++++++++++++++
1 file changed, 31 insertions(+)
base-commit: cbe54fc3462b3949ab27b9ae81fb9ddb509040c7
--
2.43.0
next reply other threads:[~2026-12-03 5:34 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-12-03 5:34 Zihui Guo [this message]
2026-12-03 5:34 ` [PATCH 1/3] KVM: nVMX: Check that the guest's IA32_S_CET is canonical on VM-Enter Zihui Guo
2026-12-03 5:34 ` [PATCH 2/3] KVM: nVMX: Reject nested VM-Enter to HLT with a non-zero SS.DPL Zihui Guo
2026-12-03 5:34 ` [PATCH 3/3] KVM: nVMX: Check the event injected into the HLT state on nested VM-Enter Zihui Guo
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=20261203053449.25917-1-youzih27@gmail.com \
--to=youzih27@gmail.com \
--cc=binbin.wu@linux.intel.com \
--cc=chao.gao@intel.com \
--cc=kvm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=pbonzini@redhat.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
all inboxes | Powered by JetHome®