From: Binbin Wu <binbin.wu@linux.intel.com>
To: Sean Christopherson <seanjc@google.com>
Cc: Paolo Bonzini <pbonzini@redhat.com>,
kvm@vger.kernel.org, linux-kernel@vger.kernel.org,
Mathias Krause <minipli@grsecurity.net>,
John Allen <john.allen@amd.com>,
Rick Edgecombe <rick.p.edgecombe@intel.com>,
Chao Gao <chao.gao@intel.com>, Xiaoyao Li <xiaoyao.li@intel.com>,
Jim Mattson <jmattson@google.com>
Subject: Re: [PATCH v2 3/3] KVM: VMX: Print out "bad" offsets+value on VMCS config mismatch
Date: Fri, 30 Jan 2026 17:17:31 +0800 [thread overview]
Message-ID: <775f7a7b-b658-43cc-b1f6-e95bca3f0fc5@linux.intel.com> (raw)
In-Reply-To: <20260128014310.3255561-4-seanjc@google.com>
On 1/28/2026 9:43 AM, Sean Christopherson wrote:
> When kvm-intel.ko refuses to load due to a mismatched VMCS config, print
> all mismatching offsets+values to make it easier to debug goofs during
> development, and it to make it at least feasible to triage failures that
> occur during production. E.g. if a physical core is flaky or is running
> with the "wrong" microcode patch loaded, then a CPU can get a legitimate
> mismatch even without KVM bugs.
>
> Print the mismatches as 32-bit values as a compromise between hand coding
> every field (to provide precise information) and printing individual bytes
> (requires more effort to deduce the mismatch bit(s)). All fields in the
> VMCS config are either 32-bit or 64-bit values, i.e. in many cases,
> printing 32-bit values will be 100% precise, and in the others it's close
> enough, especially when considering that MSR values are split into EDX:EAX
> anyways.
>
> E.g. on mismatch CET entry/exit controls, KVM will print:
>
> kvm_intel: VMCS config on CPU 0 doesn't match reference config:
> Offset 76 REF = 0x107fffff, CPU0 = 0x007fffff, mismatch = 0x10000000
> Offset 84 REF = 0x0010f3ff, CPU0 = 0x0000f3ff, mismatch = 0x00100000
>
> Opportunistically tweak the wording on the initial error message to say
> "mismatch" instead of "inconsistent", as the VMCS config itself isn't
> inconsistent, and the wording conflates the cross-CPU compatibility check
> with the error_on_inconsistent_vmcs_config knob that treats inconsistent
> VMCS configurations as errors (e.g. if a CPU supports CET entry controls
> but no CET exit controls).
>
Reviewed-by: Binbin Wu <binbin.wu@linux.intel.com>
next prev parent reply other threads:[~2026-01-30 9:17 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-01-28 1:43 [PATCH v2 0/3] KVM: x86: CET vs. nVMX fix and hardening Sean Christopherson
2026-01-28 1:43 ` [PATCH v2 1/3] KVM: x86: Explicitly configure supported XSS from {svm,vmx}_set_cpu_caps() Sean Christopherson
2026-01-29 2:55 ` Xiaoyao Li
2026-01-29 15:03 ` Sean Christopherson
2026-01-29 7:34 ` Binbin Wu
2026-01-30 3:23 ` Xiaoyao Li
2026-01-30 5:06 ` Binbin Wu
2026-01-30 8:56 ` Binbin Wu
2026-01-28 1:43 ` [PATCH v2 2/3] KVM: x86: Harden against unexpected adjustments to kvm_cpu_caps Sean Christopherson
2026-01-29 3:09 ` Xiaoyao Li
2026-01-29 15:12 ` Sean Christopherson
2026-01-30 3:01 ` Xiaoyao Li
2026-01-30 8:59 ` Binbin Wu
2026-01-28 1:43 ` [PATCH v2 3/3] KVM: VMX: Print out "bad" offsets+value on VMCS config mismatch Sean Christopherson
2026-01-29 3:16 ` Xiaoyao Li
2026-01-30 9:17 ` Binbin Wu [this message]
2026-02-04 0:10 ` [PATCH v2 0/3] KVM: x86: CET vs. nVMX fix and hardening 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=775f7a7b-b658-43cc-b1f6-e95bca3f0fc5@linux.intel.com \
--to=binbin.wu@linux.intel.com \
--cc=chao.gao@intel.com \
--cc=jmattson@google.com \
--cc=john.allen@amd.com \
--cc=kvm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=minipli@grsecurity.net \
--cc=pbonzini@redhat.com \
--cc=rick.p.edgecombe@intel.com \
--cc=seanjc@google.com \
--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