From patchwork Wed Aug 26 10:30:08 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Avi Kivity X-Patchwork-Id: 43963 Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n7QAdu1N017419 for ; Wed, 26 Aug 2009 10:39:57 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932409AbZHZKc7 (ORCPT ); Wed, 26 Aug 2009 06:32:59 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S932489AbZHZKc4 (ORCPT ); Wed, 26 Aug 2009 06:32:56 -0400 Received: from mx1.redhat.com ([209.132.183.28]:62922 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757129AbZHZKaO (ORCPT ); Wed, 26 Aug 2009 06:30:14 -0400 Received: from int-mx08.intmail.prod.int.phx2.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id n7QAUG2R011834; Wed, 26 Aug 2009 06:30:16 -0400 Received: from cleopatra.tlv.redhat.com (cleopatra.tlv.redhat.com [10.35.255.11]) by int-mx08.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id n7QAUDHU027725; Wed, 26 Aug 2009 06:30:15 -0400 Received: from localhost.localdomain (cleopatra.tlv.redhat.com [10.35.255.11]) by cleopatra.tlv.redhat.com (Postfix) with ESMTP id D22F925004A; Wed, 26 Aug 2009 13:30:11 +0300 (IDT) From: Avi Kivity To: kvm@vger.kernel.org Cc: linux-kernel@vger.kernel.org Subject: [PATCH 46/47] KVM: Protect update_cr8_intercept() when running without an apic Date: Wed, 26 Aug 2009 13:30:08 +0300 Message-Id: <1251282609-12835-47-git-send-email-avi@redhat.com> In-Reply-To: <1251282609-12835-1-git-send-email-avi@redhat.com> References: <1251282609-12835-1-git-send-email-avi@redhat.com> X-Scanned-By: MIMEDefang 2.67 on 10.5.11.21 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org update_cr8_intercept() can be triggered from userspace while there is no apic present. Signed-off-by: Avi Kivity --- 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 59a8ba4..35e7fc5 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) 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