]> 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>
Fri, 18 Sep 2009 20:29:28 +0000 (17:29 -0300)
committerGreg Kroah-Hartman <gregkh@suse.de>
Mon, 5 Oct 2009 16:32:27 +0000 (09:32 -0700)
(cherry picked from commit 88c808fd42b53a7e01a2ac3253ef31fef74cb5af)

update_cr8_intercept() can be triggered from userspace while there
is no apic present.

Signed-off-by: Avi Kivity <avi@redhat.com>
Cc: Marcelo Tosatti <mtosatti@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
arch/x86/kvm/x86.c

index a30e2858a76728c9170b4e956f5a357d65a4de4c..e27054b8df8c93d03db1dc1dbec589a5a37adc2c 100644 (file)
@@ -3202,6 +3202,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