aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kvm/x86.c
diff options
context:
space:
mode:
authorAvi Kivity <avi@redhat.com>2009-08-17 15:49:40 -0400
committerAvi Kivity <avi@redhat.com>2009-09-10 03:46:54 -0400
commit88c808fd42b53a7e01a2ac3253ef31fef74cb5af (patch)
tree570998f7bc61caa35c493bca3b1ca50a3f74af0c /arch/x86/kvm/x86.c
parent95eb84a7588d7d7afd3096807efc052adc7479e1 (diff)
KVM: Protect update_cr8_intercept() when running without an apic
update_cr8_intercept() can be triggered from userspace while there is no apic present. Signed-off-by: Avi Kivity <avi@redhat.com>
Diffstat (limited to 'arch/x86/kvm/x86.c')
-rw-r--r--arch/x86/kvm/x86.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
index 59a8ba4d56bd..35e7fc54de35 100644
--- a/arch/x86/kvm/x86.c
+++ b/arch/x86/kvm/x86.c
@@ -3500,6 +3500,9 @@ static void update_cr8_intercept(struct kvm_vcpu *vcpu)
3500 if (!kvm_x86_ops->update_cr8_intercept) 3500 if (!kvm_x86_ops->update_cr8_intercept)
3501 return; 3501 return;
3502 3502
3503 if (!vcpu->arch.apic)
3504 return;
3505
3503 if (!vcpu->arch.apic->vapic_addr) 3506 if (!vcpu->arch.apic->vapic_addr)
3504 max_irr = kvm_lapic_find_highest_irr(vcpu); 3507 max_irr = kvm_lapic_find_highest_irr(vcpu);
3505 else 3508 else