Commit c3443b43 authored by Avi Kivity's avatar Avi Kivity Committed by Greg Kroah-Hartman

KVM: Protect update_cr8_intercept() when running without an apic

(cherry picked from commit 88c808fd)

update_cr8_intercept() can be triggered from userspace while there
is no apic present.
Signed-off-by: default avatarAvi Kivity <avi@redhat.com>
Cc: Marcelo Tosatti <mtosatti@redhat.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent c05d2ba2
...@@ -3202,6 +3202,9 @@ static void update_cr8_intercept(struct kvm_vcpu *vcpu) ...@@ -3202,6 +3202,9 @@ static void update_cr8_intercept(struct kvm_vcpu *vcpu)
if (!kvm_x86_ops->update_cr8_intercept) if (!kvm_x86_ops->update_cr8_intercept)
return; return;
if (!vcpu->arch.apic)
return;
if (!vcpu->arch.apic->vapic_addr) if (!vcpu->arch.apic->vapic_addr)
max_irr = kvm_lapic_find_highest_irr(vcpu); max_irr = kvm_lapic_find_highest_irr(vcpu);
else else
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment