Re: [PATCH 2/3] KVM: x86: Harden against unexpected adjustments to kvm_cpu_caps
From: Chao Gao
Date: Tue Jan 27 2026 - 02:48:13 EST
On Fri, Jan 23, 2026 at 02:15:41PM -0800, Sean Christopherson wrote:
>Add a flag to track when KVM is actively configuring its CPU caps, and
>WARN if a cap is set or cleared if KVM isn't in its configuration stage.
>Modifying CPU caps after {svm,vmx}_set_cpu_caps() can be fatal to KVM, as
>vendor setup code expects the CPU caps to be frozen at that point, e.g.
>will do additional configuration based on the caps.
>
>Signed-off-by: Sean Christopherson <seanjc@xxxxxxxxxx>
Reviewed-by: Chao Gao <chao.gao@xxxxxxxxx>