All of lore.kernel.org
 help / color / mirror / Atom feed
From: Gleb Natapov <gleb@qumranet.com>
To: avi@redhat.com
Cc: kvm@vger.kernel.org
Subject: [PATCH] don't enter guest after SIPI was received by a CPU
Date: Mon, 22 Sep 2008 14:28:53 +0300	[thread overview]
Message-ID: <20080922112853.GF27089@minantech.com> (raw)

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 11:28 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-09-22 11:28 Gleb Natapov [this message]
2008-09-22 16:50 ` [PATCH] don't enter guest after SIPI was received by a CPU Marcelo Tosatti
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=20080922112853.GF27089@minantech.com \
    --to=gleb@qumranet.com \
    --cc=avi@redhat.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 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.