From patchwork Mon Jun 28 16:14:13 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marcelo Tosatti X-Patchwork-Id: 108392 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.4/8.14.3) with ESMTP id o5SGFokw025567 for ; Mon, 28 Jun 2010 16:15:50 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754141Ab0F1QPq (ORCPT ); Mon, 28 Jun 2010 12:15:46 -0400 Received: from mx1.redhat.com ([209.132.183.28]:63895 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753067Ab0F1QPm (ORCPT ); Mon, 28 Jun 2010 12:15:42 -0400 Received: from int-mx05.intmail.prod.int.phx2.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.18]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o5SGFe5c026080 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Mon, 28 Jun 2010 12:15:40 -0400 Received: from ns3.rdu.redhat.com (ns3.rdu.redhat.com [10.11.255.199]) by int-mx05.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o5SGFdf7024372; Mon, 28 Jun 2010 12:15:39 -0400 Received: from amt.cnet (vpn2-11-80.ams2.redhat.com [10.36.11.80]) by ns3.rdu.redhat.com (8.13.8/8.13.8) with ESMTP id o5SGFb9Q017392; Mon, 28 Jun 2010 12:15:38 -0400 Received: from amt.cnet (amt.cnet [127.0.0.1]) by amt.cnet (Postfix) with ESMTP id 560FC68A8A7; Mon, 28 Jun 2010 13:14:45 -0300 (BRT) Received: (from marcelo@localhost) by amt.cnet (8.14.3/8.14.3/Submit) id o5SGEg9S007583; Mon, 28 Jun 2010 13:14:42 -0300 From: Marcelo Tosatti To: Anthony Liguori Cc: qemu-devel@nongnu.org, kvm@vger.kernel.org, Marcelo Tosatti , Avi Kivity Subject: [PATCH 6/7] kvm: init mp_state Date: Mon, 28 Jun 2010 13:14:13 -0300 Message-Id: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.67 on 10.5.11.18 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter.kernel.org [140.211.167.41]); Mon, 28 Jun 2010 16:15:50 +0000 (UTC) diff --git a/target-i386/kvm.c b/target-i386/kvm.c index 436c0c4..576d3b5 100644 --- a/target-i386/kvm.c +++ b/target-i386/kvm.c @@ -282,6 +282,12 @@ void kvm_arch_reset_vcpu(CPUState *env) env->interrupt_injected = -1; env->nmi_injected = 0; env->nmi_pending = 0; + if (kvm_irqchip_in_kernel()) { + env->mp_state = cpu_is_bsp(env) ? KVM_MP_STATE_RUNNABLE : + KVM_MP_STATE_UNINITIALIZED; + } else { + env->mp_state = KVM_MP_STATE_RUNNABLE; + } } static int kvm_has_msr_star(CPUState *env)