From mboxrd@z Thu Jan 1 00:00:00 1970 From: Gleb Natapov Subject: Re: [PATCH 4/4] Make cpu runnable after sipi Date: Fri, 18 Sep 2009 19:22:22 +0300 Message-ID: <20090918162222.GA13618@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> <20090913125521.GQ22885@redhat.com> <20090918161818.GC3888@amt.cnet> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Avi Kivity , kvm@vger.kernel.org To: Marcelo Tosatti Return-path: Received: from mx1.redhat.com ([209.132.183.28]:11073 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752735AbZIRQWU (ORCPT ); Fri, 18 Sep 2009 12:22:20 -0400 Received: from int-mx01.intmail.prod.int.phx2.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id n8IGMOWW018257 for ; Fri, 18 Sep 2009 12:22:24 -0400 Content-Disposition: inline In-Reply-To: <20090918161818.GC3888@amt.cnet> Sender: kvm-owner@vger.kernel.org List-ID: On Fri, Sep 18, 2009 at 01:18:18PM -0300, Marcelo Tosatti wrote: > 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. > All callers already do cpu_synchronize_state(). I'll send another path. > 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 > > } -- Gleb.