From patchwork Tue Mar 23 16:37:14 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marcelo Tosatti X-Patchwork-Id: 87689 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.3/8.14.3) with ESMTP id o2NGgFK0008282 for ; Tue, 23 Mar 2010 16:42:15 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755284Ab0CWQmN (ORCPT ); Tue, 23 Mar 2010 12:42:13 -0400 Received: from mx1.redhat.com ([209.132.183.28]:30687 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751933Ab0CWQmL (ORCPT ); Tue, 23 Mar 2010 12:42:11 -0400 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o2NGgBUk019546 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Tue, 23 Mar 2010 12:42:11 -0400 Received: from ns3.rdu.redhat.com (ns3.rdu.redhat.com [10.11.255.199]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o2NGgAOG032210; Tue, 23 Mar 2010 12:42:11 -0400 Received: from amt.cnet (vpn-10-84.rdu.redhat.com [10.11.10.84]) by ns3.rdu.redhat.com (8.13.8/8.13.8) with ESMTP id o2NGg8Cw031015; Tue, 23 Mar 2010 12:42:09 -0400 Received: from amt.cnet (amt.cnet [127.0.0.1]) by amt.cnet (Postfix) with ESMTP id C2A7E652093; Tue, 23 Mar 2010 13:40:07 -0300 (BRT) Received: (from marcelo@localhost) by amt.cnet (8.14.3/8.14.3/Submit) id o2NGe6vg019165; Tue, 23 Mar 2010 13:40:06 -0300 Message-Id: <20100323163812.665650073@redhat.com> User-Agent: quilt/0.47-1 Date: Tue, 23 Mar 2010 13:37:14 -0300 From: Marcelo Tosatti To: kvm@vger.kernel.org Cc: Marcelo Tosatti Subject: [patch 5/6] kvm: init mp_state References: <20100323163709.033115262@redhat.com> Content-Disposition: inline; filename=reset-mpstate X-Scanned-By: MIMEDefang 2.67 on 10.5.11.12 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]); Tue, 23 Mar 2010 16:42:16 +0000 (UTC) Index: qemu-uq/target-i386/kvm.c =================================================================== --- qemu-uq.orig/target-i386/kvm.c +++ qemu-uq/target-i386/kvm.c @@ -279,6 +279,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)