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,
Igor Mammedov <imammedo@redhat.com>
Subject: [PATCH 0/2] KVM: x86: Do runtime updates during KVM_SET_CPUID2
Date: Mon, 1 Dec 2025 17:50:47 -0800 [thread overview]
Message-ID: <20251202015049.1167490-1-seanjc@google.com> (raw)
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
next reply other threads:[~2025-12-02 1:50 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-12-02 1:50 Sean Christopherson [this message]
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
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=20251202015049.1167490-1-seanjc@google.com \
--to=seanjc@google.com \
--cc=imammedo@redhat.com \
--cc=kvm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=pbonzini@redhat.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.