From mboxrd@z Thu Jan 1 00:00:00 1970 From: Marcelo Tosatti Subject: Re: [PATCH] don't enter guest after SIPI was received by a CPU Date: Mon, 22 Sep 2008 13:50:07 -0300 Message-ID: <20080922165007.GB15498@dmt.cnet> References: <20080922112853.GF27089@minantech.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: avi@redhat.com, kvm@vger.kernel.org To: Gleb Natapov Return-path: Received: from mx2.redhat.com ([66.187.237.31]:55599 "EHLO mx2.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750982AbYIVQv0 (ORCPT ); Mon, 22 Sep 2008 12:51:26 -0400 Content-Disposition: inline In-Reply-To: <20080922112853.GF27089@minantech.com> Sender: kvm-owner@vger.kernel.org List-ID: Looks good. Thanks Gleb. On Mon, Sep 22, 2008 at 02:28:53PM +0300, Gleb Natapov wrote: > Don't enter guest after SIPI was issued. > > CPU should process SIPI message before entering a guest mode again. > kvm_arch_vcpu_runnable() return true if CPU is in SIPI state, so > we can't call it here. > > Signed-off-by: Gleb Natapov > > diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c > index 61eddbe..612099f 100644 > --- a/arch/x86/kvm/x86.c > +++ b/arch/x86/kvm/x86.c > @@ -3239,7 +3239,7 @@ static int __vcpu_run(struct kvm_vcpu *vcpu, struct kvm_run *kvm_run) > > r = 1; > while (r > 0) { > - if (kvm_arch_vcpu_runnable(vcpu)) > + if (vcpu->arch.mp_state == KVM_MP_STATE_RUNNABLE) > r = vcpu_enter_guest(vcpu, kvm_run); > else { > up_read(&vcpu->kvm->slots_lock); > -- > Gleb.