From mboxrd@z Thu Jan 1 00:00:00 1970 From: Sheng Yang Subject: [PATCH] KVM: Fix NULL pointer reference by update_cr8_intercept() Date: Wed, 19 Aug 2009 10:52:09 +0800 Message-ID: <1250650329-28537-1-git-send-email-sheng@linux.intel.com> Cc: arcezed@gmail.com, kvm@vger.kernel.org, Sheng Yang To: Avi Kivity Return-path: Received: from mga01.intel.com ([192.55.52.88]:27829 "EHLO mga01.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751640AbZHSCwA (ORCPT ); Tue, 18 Aug 2009 22:52:00 -0400 Sender: kvm-owner@vger.kernel.org List-ID: Commit 0d11419a result in NULL pointer reference when using --no-kvm-irqchip. Signed-off-by: Sheng Yang --- arch/x86/kvm/x86.c | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c index 850cf56..9ac2d9e 100644 --- a/arch/x86/kvm/x86.c +++ b/arch/x86/kvm/x86.c @@ -4453,7 +4453,8 @@ int kvm_arch_vcpu_ioctl_set_sregs(struct kvm_vcpu *vcpu, kvm_set_segment(vcpu, &sregs->tr, VCPU_SREG_TR); kvm_set_segment(vcpu, &sregs->ldt, VCPU_SREG_LDTR); - update_cr8_intercept(vcpu); + if (kvm_lapic_enabled(vcpu)) + update_cr8_intercept(vcpu); /* Older userspace won't unhalt the vcpu on reset. */ if (kvm_vcpu_is_bsp(vcpu) && kvm_rip_read(vcpu) == 0xfff0 && -- 1.5.4.5