aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/arch/x86/kvm/lapic.c
diff options
context:
space:
mode:
authorSean Christopherson <seanjc@google.com>2021-10-12 17:35:54 -0700
committerPaolo Bonzini <pbonzini@redhat.com>2021-10-18 14:07:18 -0400
commit9139a7a64581c80d157027ae20e86f2f24d4292c (patch)
tree5643cb6b724114818124b9a03387d966db389b7d /arch/x86/kvm/lapic.c
parentRevert "KVM: x86: Open code necessary bits of kvm_lapic_set_base() at vCPU RESET" (diff)
downloadwireguard-linux-9139a7a64581c80d157027ae20e86f2f24d4292c.tar.xz
wireguard-linux-9139a7a64581c80d157027ae20e86f2f24d4292c.zip
KVM: x86: WARN if APIC HW/SW disable static keys are non-zero on unload
WARN if the static keys used to track if any vCPU has disabled its APIC are left elevated at module exit. Unlike the underflow case, nothing in the static key infrastructure will complain if a key is left elevated, and because an elevated key only affects performance, nothing in KVM will fail if either key is improperly incremented. Signed-off-by: Sean Christopherson <seanjc@google.com> Message-Id: <20211013003554.47705-3-seanjc@google.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'arch/x86/kvm/lapic.c')
-rw-r--r--arch/x86/kvm/lapic.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/arch/x86/kvm/lapic.c b/arch/x86/kvm/lapic.c
index 7af25304bda9..d6ac32f3f650 100644
--- a/arch/x86/kvm/lapic.c
+++ b/arch/x86/kvm/lapic.c
@@ -2946,5 +2946,7 @@ int kvm_apic_accept_events(struct kvm_vcpu *vcpu)
void kvm_lapic_exit(void)
{
static_key_deferred_flush(&apic_hw_disabled);
+ WARN_ON(static_branch_unlikely(&apic_hw_disabled.key));
static_key_deferred_flush(&apic_sw_disabled);
+ WARN_ON(static_branch_unlikely(&apic_sw_disabled.key));
}