]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
KVM: Protect update_cr8_intercept() when running without an apic
authorAvi Kivity <avi@redhat.com>
Mon, 17 Aug 2009 19:49:40 +0000 (22:49 +0300)
committerAvi Kivity <avi@redhat.com>
Thu, 10 Sep 2009 07:46:54 +0000 (10:46 +0300)
update_cr8_intercept() can be triggered from userspace while there
is no apic present.

Signed-off-by: Avi Kivity <avi@redhat.com>
arch/x86/kvm/x86.c

index 59a8ba4d56bda32a30d20c4f3c1bb6915186f151..35e7fc54de35d818ab3cde6ff8d9172b444bc8a5 100644 (file)
@@ -3500,6 +3500,9 @@ static void update_cr8_intercept(struct kvm_vcpu *vcpu)
        if (!kvm_x86_ops->update_cr8_intercept)
                return;
 
+       if (!vcpu->arch.apic)
+               return;
+
        if (!vcpu->arch.apic->vapic_addr)
                max_irr = kvm_lapic_find_highest_irr(vcpu);
        else