diff options
author | Avi Kivity <avi@redhat.com> | 2009-09-18 17:29:28 -0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2009-10-05 09:32:27 -0700 |
commit | c3443b436a0767cbc0d4ab405f8fa13fb34bd56c (patch) | |
tree | 4ead411aaaa8bc971ffe4ff9751a17e5645f1b03 /arch | |
parent | c05d2ba2c54deb24cd2c8cb8345bd4d7624cbdba (diff) |
KVM: Protect update_cr8_intercept() when running without an apic
(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>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/x86/kvm/x86.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c index a30e2858a76..e27054b8df8 100644 --- a/arch/x86/kvm/x86.c +++ b/arch/x86/kvm/x86.c @@ -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 |