From patchwork Thu Jun 25 12:20:59 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gleb Natapov X-Patchwork-Id: 32375 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 n5PCL7Ls029342 for ; Thu, 25 Jun 2009 12:21:08 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752388AbZFYMVB (ORCPT ); Thu, 25 Jun 2009 08:21:01 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1752730AbZFYMVB (ORCPT ); Thu, 25 Jun 2009 08:21:01 -0400 Received: from mx2.redhat.com ([66.187.237.31]:56669 "EHLO mx2.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752242AbZFYMU7 (ORCPT ); Thu, 25 Jun 2009 08:20:59 -0400 Received: from int-mx2.corp.redhat.com (int-mx2.corp.redhat.com [172.16.27.26]) by mx2.redhat.com (8.13.8/8.13.8) with ESMTP id n5PCL3C8029490 for ; Thu, 25 Jun 2009 08:21:03 -0400 Received: from ns3.rdu.redhat.com (ns3.rdu.redhat.com [10.11.255.199]) by int-mx2.corp.redhat.com (8.13.1/8.13.1) with ESMTP id n5PCL12d006144; Thu, 25 Jun 2009 08:21:02 -0400 Received: from dhcp-1-237.tlv.redhat.com (dhcp-1-237.tlv.redhat.com [10.35.1.237]) by ns3.rdu.redhat.com (8.13.8/8.13.8) with ESMTP id n5PCL1wN018020; Thu, 25 Jun 2009 08:21:01 -0400 Received: by dhcp-1-237.tlv.redhat.com (Postfix, from userid 13519) id B181A18D47A; Thu, 25 Jun 2009 15:21:00 +0300 (IDT) From: Gleb Natapov To: avi@redhat.com Cc: kvm@vger.kernel.org Subject: [PATCH] Use cpu_is_bsp() to check for bsp cpu. Date: Thu, 25 Jun 2009 15:20:59 +0300 Message-Id: <1245932460-15616-2-git-send-email-gleb@redhat.com> X-Scanned-By: MIMEDefang 2.58 on 172.16.27.26 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org Signed-off-by: Gleb Natapov --- qemu-kvm-x86.c | 5 +++-- 1 files changed, 3 insertions(+), 2 deletions(-) diff --git a/qemu-kvm-x86.c b/qemu-kvm-x86.c index 568df53..a78073e 100644 --- a/qemu-kvm-x86.c +++ b/qemu-kvm-x86.c @@ -23,6 +23,7 @@ #include #include "kvm.h" +#include "hw/pc.h" #define MSR_IA32_TSC 0x10 @@ -1349,7 +1350,7 @@ int handle_tpr_access(void *opaque, kvm_vcpu_context_t vcpu, void kvm_arch_cpu_reset(CPUState *env) { kvm_arch_load_regs(env); - if (env->cpu_index != 0) { + if (!cpu_is_bsp(env)) { if (kvm_irqchip_in_kernel(kvm_context)) { #ifdef KVM_CAP_MP_STATE kvm_reset_mpstate(env->kvm_cpu_state.vcpu_ctx); @@ -1583,7 +1584,7 @@ void kvm_update_after_sipi(CPUState *env) void kvm_apic_init(CPUState *env) { - if (env->cpu_index != 0) + if (!cpu_is_bsp(env)) env->kvm_cpu_state.init = 1; kvm_update_interrupt_request(env); }