Преглед изворни кода

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>
Avi Kivity пре 16 година
родитељ
комит
88c808fd42
1 измењених фајлова са 3 додато и 0 уклоњено
  1. 3 0
      arch/x86/kvm/x86.c

+ 3 - 0
arch/x86/kvm/x86.c

@@ -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