aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kvm/lapic.c
diff options
context:
space:
mode:
authorSean Christopherson <seanjc@google.com>2021-07-13 09:32:49 -0700
committerPaolo Bonzini <pbonzini@redhat.com>2021-08-02 11:01:50 -0400
commitc2f79a65b4b66681894ef7d7e3912ba55acc20d5 (patch)
tree0b4fe1408bc9fccd7a4f4b449f88e2b5371608d0 /arch/x86/kvm/lapic.c
parentKVM: SVM: Drop explicit MMU reset at RESET/INIT (diff)
downloadlinux-dev-c2f79a65b4b66681894ef7d7e3912ba55acc20d5.tar.xz
linux-dev-c2f79a65b4b66681894ef7d7e3912ba55acc20d5.zip
KVM: x86: WARN if the APIC map is dirty without an in-kernel local APIC
WARN if KVM ends up in a state where it thinks its APIC map needs to be recalculated, but KVM is not emulating the local APIC. This is mostly to document KVM's "rules" in order to provide clarity in future cleanups. Signed-off-by: Sean Christopherson <seanjc@google.com> Message-Id: <20210713163324.627647-12-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.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/arch/x86/kvm/lapic.c b/arch/x86/kvm/lapic.c
index ba5a27879f1d..add4dd1e3528 100644
--- a/arch/x86/kvm/lapic.c
+++ b/arch/x86/kvm/lapic.c
@@ -192,6 +192,9 @@ void kvm_recalculate_apic_map(struct kvm *kvm)
if (atomic_read_acquire(&kvm->arch.apic_map_dirty) == CLEAN)
return;
+ WARN_ONCE(!irqchip_in_kernel(kvm),
+ "Dirty APIC map without an in-kernel local APIC");
+
mutex_lock(&kvm->arch.apic_map_lock);
/*
* Read kvm->arch.apic_map_dirty before kvm->arch.apic_map