diff options
| author | Sean Christopherson <seanjc@google.com> | 2026-07-09 13:49:35 -0700 |
|---|---|---|
| committer | Sean Christopherson <seanjc@google.com> | 2026-07-10 09:01:11 -0700 |
| commit | ba76b23ed36ab230fc2577aba24f65851114902f (patch) | |
| tree | 56f40a4a9d5a2202006074a3d2ba5ee71d136052 /include/linux/timerqueue_types.h | |
| parent | 01a96ff30dde5127c37497f1e098e639e7ae152f (diff) | |
KVM: x86: Serialize writes to disabled_quirks using kvm->lock
Protect writes to disabled_quirks with kvm->lock to ensure KVM doesn't
clobber state in the unlikely scenario that userspace disables disparate
quirks from multiple tasks. More importantly, this will allow wrapping
accesses with {READ,WRITE}_ONCE without "needing" to also guard the writer
with a useless and confusing READ_ONCE (since the RMW wouldn't be atomic
anyways).
Ideally, KVM would disallow disabling quirks once quirks are "live", but
that would be a potentially breaking userspace ABI change, and while all
existing quirks are fully live only after vCPUs have been created, several
MMU-related quirks, IGNORE_GUEST_PAT and SLOT_ZAP_ALL, are partially live
at all times. Because populating MMUs requires a vCPU, the guest-visible
behavior of IGNORE_GUEST_PAT and SLOT_ZAP_ALL requires a vCPU, but for KVM
itself, processing the quirk (or not) has functional impact, i.e. for all
intents and purposes, KVM can't prevent those quirks from being disabled
after they've been consumed.
Cc: stable@vger.kernel.org # 6.12.x
Reviewed-by: Michael Roth <michael.roth@amd.com>
Link: https://patch.msgid.link/20260709204948.1988414-6-seanjc@google.com
Signed-off-by: Sean Christopherson <seanjc@google.com>
Diffstat (limited to 'include/linux/timerqueue_types.h')
0 files changed, 0 insertions, 0 deletions
