From: Sean Christopherson <seanjc@google.com>
To: Sean Christopherson <seanjc@google.com>,
Paolo Bonzini <pbonzini@redhat.com>
Cc: kvm@vger.kernel.org, linux-kernel@vger.kernel.org,
Xiaoyao Li <xiaoyao.li@intel.com>, Chao Gao <chao.gao@intel.com>,
Xin Li <xin@zytor.com>, Yosry Ahmed <yosry.ahmed@linux.dev>
Subject: [PATCH v3 0/4] KVM: nVMX: Disallow access to vmcs12 fields that aren't supported by "hardware"
Date: Thu, 8 Jan 2026 20:15:19 -0800 [thread overview]
Message-ID: <20260109041523.1027323-1-seanjc@google.com> (raw)
Disallow accesses to vmcs12 fields that are defined by KVM, but are unsupported
in the current incarnation of KVM, e.g. due to lack of hardware support for the
underlying VMCS fields.
The primary motivation is to avoid having to carry the same logic for shadowed
VMCS fields, which can't play nice with unsupported fields since VMREAD/VMWRITE
will fail when attempting to transfer state between vmcs12 and the shadow VMCS.
v3:
- Collect reviews. [Xin, Chao]
- Actually filter out vmcs12 fields when configuring shadow VMCS. [Chao]
- Move VMX MSR configuration into nested_vmx_hardware_setup().
- Add ENC_TO_VMCS12_IDX. [Xiaoyao]
- Use a Xiaoyao's crazy double ROL16 math. :-) [Xiaoyao, obviously]
v2:
- https://lore.kernel.org/all/20251230220220.4122282-1-seanjc@google.com
- Name the array of KVM-defined fields kvm_supported_vmcs12_field_offsets,
e.g. so that it's no confused with what's supported by hardware. [Xin]
- Combine encodings in switch statements for fields shared fate. [Xin]
- Drop the extern declaration of supported_vmcs12_field_offsets. [Chao]
- Handle GUEST_INTR_STATUS in cpu_has_vmcs12_field() and add a patch to
drop the custom handling from init_vmcs_shadow_fields(). [Chao]
v1: https://lore.kernel.org/all/20251216012918.1707681-1-seanjc@google.com
Sean Christopherson (4):
KVM: nVMX: Setup VMX MSRs on loading CPU during
nested_vmx_hardware_setup()
KVM: VMX: Add a wrapper around ROL16() to get a vmcs12 from a field
encoding
KVM: nVMX: Disallow access to vmcs12 fields that aren't supported by
"hardware"
KVM: nVMX: Remove explicit filtering of GUEST_INTR_STATUS from shadow
VMCS fields
arch/x86/kvm/vmx/hyperv_evmcs.c | 2 +-
arch/x86/kvm/vmx/hyperv_evmcs.h | 2 +-
arch/x86/kvm/vmx/nested.c | 28 +++++++------
arch/x86/kvm/vmx/vmcs.h | 9 ++++
arch/x86/kvm/vmx/vmcs12.c | 74 +++++++++++++++++++++++++++++++--
arch/x86/kvm/vmx/vmcs12.h | 8 ++--
arch/x86/kvm/vmx/vmx.c | 2 -
7 files changed, 101 insertions(+), 24 deletions(-)
base-commit: 9448598b22c50c8a5bb77a9103e2d49f134c9578
--
2.52.0.457.g6b5491de43-goog
next reply other threads:[~2026-01-09 4:15 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-01-09 4:15 Sean Christopherson [this message]
2026-01-09 4:15 ` [PATCH v3 1/4] KVM: nVMX: Setup VMX MSRs on loading CPU during nested_vmx_hardware_setup() Sean Christopherson
2026-01-09 11:24 ` Xiaoyao Li
2026-01-09 4:15 ` [PATCH v3 2/4] KVM: VMX: Add a wrapper around ROL16() to get a vmcs12 from a field encoding Sean Christopherson
2026-01-09 11:34 ` Xiaoyao Li
2026-01-09 4:15 ` [PATCH v3 3/4] KVM: nVMX: Disallow access to vmcs12 fields that aren't supported by "hardware" Sean Christopherson
2026-01-09 14:08 ` Xiaoyao Li
2026-01-09 14:44 ` Sean Christopherson
2026-01-09 15:17 ` Sean Christopherson
2026-01-09 4:15 ` [PATCH v3 4/4] KVM: nVMX: Remove explicit filtering of GUEST_INTR_STATUS from shadow VMCS fields Sean Christopherson
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=20260109041523.1027323-1-seanjc@google.com \
--to=seanjc@google.com \
--cc=chao.gao@intel.com \
--cc=kvm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=pbonzini@redhat.com \
--cc=xiaoyao.li@intel.com \
--cc=xin@zytor.com \
--cc=yosry.ahmed@linux.dev \
/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®