public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2] KVM: x86: Do runtime updates during KVM_SET_CPUID2
@ 2025-12-02  1:50 Sean Christopherson
  2025-12-02  1:50 ` [PATCH 1/2] KVM: x86: Apply runtime updates to current CPUID during KVM_SET_CPUID{,2} Sean Christopherson
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Sean Christopherson @ 2025-12-02  1:50 UTC (permalink / raw)
  To: Sean Christopherson, Paolo Bonzini; +Cc: kvm, linux-kernel, Igor Mammedov

Do runtime updates (if necessary) when userspace sets CPUID to fix a bug
where KVM drops a pending update (KVM will clear the dirty flag when doing
updates on the new/incoming CPUID).  The bug most visibly manifests as an
-EINVAL failure on KVM_SET_CPUID{,2} due to the old/current CPUID not
matching the new/incoming CPUID, but if userspace were to continue running
past the failure, the vCPU would run with stale CPUID/caps.

Sean Christopherson (2):
  KVM: x86: Apply runtime updates to current CPUID during
    KVM_SET_CPUID{,2}
  KVM: selftests: Add a CPUID testcase for KVM_SET_CPUID2 with runtime
    updates

 arch/x86/kvm/cpuid.c                         | 11 +++++++++--
 tools/testing/selftests/kvm/x86/cpuid_test.c | 15 +++++++++++++++
 2 files changed, 24 insertions(+), 2 deletions(-)


base-commit: 115d5de2eef32ac5cd488404b44b38789362dbe6
-- 
2.52.0.107.ga0afd4fd5b-goog


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2025-12-05 17:00 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-12-02  1:50 [PATCH 0/2] KVM: x86: Do runtime updates during KVM_SET_CPUID2 Sean Christopherson
2025-12-02  1:50 ` [PATCH 1/2] KVM: x86: Apply runtime updates to current CPUID during KVM_SET_CPUID{,2} Sean Christopherson
2025-12-02 12:02   ` Igor Mammedov
2025-12-02  1:50 ` [PATCH 2/2] KVM: selftests: Add a CPUID testcase for KVM_SET_CPUID2 with runtime updates Sean Christopherson
2025-12-05 16:59 ` [PATCH 0/2] KVM: x86: Do runtime updates during KVM_SET_CPUID2 Sean Christopherson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox