All of lore.kernel.org
 help / color / mirror / Atom feed
From: Gleb Natapov <gleb@redhat.com>
To: Marcelo Tosatti <mtosatti@redhat.com>
Cc: Avi Kivity <avi@redhat.com>, kvm@vger.kernel.org
Subject: Re: [PATCH 4/4] Make cpu runnable after sipi
Date: Fri, 18 Sep 2009 19:22:22 +0300	[thread overview]
Message-ID: <20090918162222.GA13618@redhat.com> (raw)
In-Reply-To: <20090918161818.GC3888@amt.cnet>

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<gleb@redhat.com>
> > > >---
> > > >  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@redhat.com>
> > 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.

  reply	other threads:[~2009-09-18 16:22 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-09-13  8:30 [PATCH 1/4] Remove unused function Gleb Natapov
2009-09-13  8:30 ` [PATCH 2/4] Use kvm_cpu_synchronize_state() instead of kvm_arch_(save|load)_regs() Gleb Natapov
2009-09-13  8:30 ` [PATCH 3/4] set correct CS seg limit and flags on sipi Gleb Natapov
2009-09-13  8:30 ` [PATCH 4/4] Make cpu runnable after sipi Gleb Natapov
2009-09-13 12:05   ` Avi Kivity
2009-09-13 12:55     ` Gleb Natapov
2009-09-18 16:18       ` Marcelo Tosatti
2009-09-18 16:22         ` Gleb Natapov [this message]
2009-09-18 16:23           ` Marcelo Tosatti

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20090918162222.GA13618@redhat.com \
    --to=gleb@redhat.com \
    --cc=avi@redhat.com \
    --cc=kvm@vger.kernel.org \
    --cc=mtosatti@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.