public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Marcelo Tosatti <mtosatti@redhat.com>
To: Gleb Natapov <gleb@qumranet.com>
Cc: avi@redhat.com, kvm@vger.kernel.org
Subject: Re: [PATCH] don't enter guest after SIPI was received by a CPU
Date: Mon, 22 Sep 2008 13:50:07 -0300	[thread overview]
Message-ID: <20080922165007.GB15498@dmt.cnet> (raw)
In-Reply-To: <20080922112853.GF27089@minantech.com>


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

  reply	other threads:[~2008-09-22 16:51 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-09-22 11:28 [PATCH] don't enter guest after SIPI was received by a CPU Gleb Natapov
2008-09-22 16:50 ` Marcelo Tosatti [this message]
2008-09-23  8:57 ` Avi Kivity

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=20080922165007.GB15498@dmt.cnet \
    --to=mtosatti@redhat.com \
    --cc=avi@redhat.com \
    --cc=gleb@qumranet.com \
    --cc=kvm@vger.kernel.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox