]> www.infradead.org Git - users/jedix/linux-maple.git/commit
KVM: x86: Allow vendor code to disable quirks
authorPaolo Bonzini <pbonzini@redhat.com>
Mon, 3 Mar 2025 16:18:38 +0000 (11:18 -0500)
committerPaolo Bonzini <pbonzini@redhat.com>
Fri, 14 Mar 2025 18:20:58 +0000 (14:20 -0400)
commita4dae7c7a41d803a05192015b2d47aca8aca4abf
tree66921b7bc85f93329323df5bf2d8959fe27811f1
parent9966b7822b3f49b3aea5d926ece4bc92f1f0a700
KVM: x86: Allow vendor code to disable quirks

In some cases, the handling of quirks is split between platform-specific
code and generic code, or it is done entirely in generic code, but the
relevant bug does not trigger on some platforms; for example,
this will be the case for "ignore guest PAT".  Allow unaffected vendor
modules to disable handling of a quirk for all VMs via a new entry in
kvm_caps.

Such quirks remain available in KVM_CAP_DISABLE_QUIRKS2, because that API
tells userspace that KVM *knows* that some of its past behavior was bogus
or just undesirable.  In other words, it's plausible for userspace to
refuse to run if a quirk is not listed by KVM_CAP_DISABLE_QUIRKS2, so
preserve that and make it part of the API.

As an example, mark KVM_X86_QUIRK_CD_NW_CLEARED as auto-disabled on
Intel systems.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/x86/include/asm/kvm_host.h
arch/x86/kvm/svm/svm.c
arch/x86/kvm/x86.c
arch/x86/kvm/x86.h