From patchwork Sun Sep 13 12:55:21 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gleb Natapov X-Patchwork-Id: 47144 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 n8DCtm3U013031 for ; Sun, 13 Sep 2009 12:55:48 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753551AbZIMMzU (ORCPT ); Sun, 13 Sep 2009 08:55:20 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1753533AbZIMMzU (ORCPT ); Sun, 13 Sep 2009 08:55:20 -0400 Received: from mx1.redhat.com ([209.132.183.28]:46976 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753374AbZIMMzT (ORCPT ); Sun, 13 Sep 2009 08:55:19 -0400 Received: from int-mx03.intmail.prod.int.phx2.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.16]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id n8DCtNc2008112 for ; Sun, 13 Sep 2009 08:55:23 -0400 Received: from dhcp-1-237.tlv.redhat.com (dhcp-1-237.tlv.redhat.com [10.35.1.237]) by int-mx03.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id n8DCtLsZ025251; Sun, 13 Sep 2009 08:55:22 -0400 Received: by dhcp-1-237.tlv.redhat.com (Postfix, from userid 13519) id 7776F18D467; Sun, 13 Sep 2009 15:55:21 +0300 (IDT) Date: Sun, 13 Sep 2009 15:55:21 +0300 From: Gleb Natapov To: Avi Kivity Cc: kvm@vger.kernel.org Subject: Re: [PATCH 4/4] Make cpu runnable after sipi Message-ID: <20090913125521.GQ22885@redhat.com> References: <1252830613-2185-1-git-send-email-gleb@redhat.com> <1252830613-2185-4-git-send-email-gleb@redhat.com> <4AACE001.5030303@redhat.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <4AACE001.5030303@redhat.com> X-Scanned-By: MIMEDefang 2.67 on 10.5.11.16 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org On Sun, Sep 13, 2009 at 03:05:21PM +0300, Avi Kivity wrote: > On 09/13/2009 11:30 AM, Gleb Natapov wrote: > >Signed-off-by: Gleb Natapov > >--- > > hw/apic.c | 3 +++ > > 1 files changed, 3 insertions(+), 0 deletions(-) > > > >diff --git a/hw/apic.c b/hw/apic.c > >index 11d4759..ac5e7ba 100644 > >--- a/hw/apic.c > >+++ b/hw/apic.c > >@@ -534,6 +534,9 @@ void apic_sipi(CPUState *env) > > env->segs[R_CS].limit, env->segs[R_CS].flags); > > env->halted = 0; > > s->wait_for_sipi = 0; > >+#ifdef KVM_CAP_MP_STATE > >+ env->mp_state = KVM_MP_STATE_RUNNABLE; > >+#endif > > } > > -no-kvm-irqchip shouldn't use mp_state at all (since really old > kernels don't have this ioctl). > Correct. Use patch below instead. mp_state shouldn't be touched if irq chip is in userspace. I removed pu_synchronize_state() since it is done before apic_init_reset() is called. Signed-off-by: Gleb Natapov --- Gleb. -- To unsubscribe from this list: send the line "unsubscribe kvm" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/hw/apic.c b/hw/apic.c index 11d4759..f9fef70 100644 --- a/hw/apic.c +++ b/hw/apic.c @@ -488,7 +488,6 @@ void apic_init_reset(CPUState *env) if (!s) return; - cpu_synchronize_state(env); s->tpr = 0; s->spurious_vec = 0xff; s->log_dest = 0; @@ -509,8 +508,9 @@ void apic_init_reset(CPUState *env) env->halted = !(s->apicbase & MSR_IA32_APICBASE_BSP); #ifdef KVM_CAP_MP_STATE - env->mp_state - = env->halted ? KVM_MP_STATE_INIT_RECEIVED : KVM_MP_STATE_RUNNABLE; + if (kvm_irqchip_in_kernel(kvm_context)) + env->mp_state + = env->halted ? KVM_MP_STATE_UNINITIALIZED : KVM_MP_STATE_RUNNABLE; #endif }