From mboxrd@z Thu Jan 1 00:00:00 1970 From: Marcelo Tosatti Subject: Re: [PATCH 4/4] Make cpu runnable after sipi Date: Fri, 18 Sep 2009 13:18:18 -0300 Message-ID: <20090918161818.GC3888@amt.cnet> References: <1252830613-2185-1-git-send-email-gleb@redhat.com> <1252830613-2185-4-git-send-email-gleb@redhat.com> <4AACE001.5030303@redhat.com> <20090913125521.GQ22885@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Avi Kivity , kvm@vger.kernel.org To: Gleb Natapov Return-path: Received: from mx1.redhat.com ([209.132.183.28]:5021 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752735AbZIRQSs (ORCPT ); Fri, 18 Sep 2009 12:18:48 -0400 Received: from int-mx04.intmail.prod.int.phx2.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.17]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id n8IGIqBx020019 for ; Fri, 18 Sep 2009 12:18:52 -0400 Content-Disposition: inline In-Reply-To: <20090913125521.GQ22885@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: On Sun, Sep 13, 2009 at 03:55:21PM +0300, Gleb Natapov wrote: > 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 > 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; Gleb, I've dropped this cleanup hunk. Please send it separately if you like. Applied the remaining patches too, thanks. > @@ -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 > }