public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Gleb Natapov <gleb@redhat.com>
To: kvm@vger.kernel.org
Cc: avi@redhat.com, mtosatti@redhat.com
Subject: [PATCH] Synchronize cpu state with kernel before poking into registers.
Date: Thu, 16 Feb 2012 11:12:51 +0200	[thread overview]
Message-ID: <20120216091251.GD19771@redhat.com> (raw)

Call to kvm_cpu_synchronize_state() is missing. kvm_arch_stop_on_emulation_error may
look at outdated registers here.

Signed-off-by: Gleb Natapov <gleb@redhat.com>
diff --git a/target-i386/kvm.c b/target-i386/kvm.c
index 7079e87..51d0ae7 100644
--- a/target-i386/kvm.c
+++ b/target-i386/kvm.c
@@ -2020,6 +2020,7 @@ int kvm_arch_handle_exit(CPUState *env, struct kvm_run *run)
 
 bool kvm_arch_stop_on_emulation_error(CPUState *env)
 {
+    kvm_cpu_synchronize_state(env);
     return !(env->cr[0] & CR0_PE_MASK) ||
            ((env->segs[R_CS].selector  & 3) != 3);
 }
--
			Gleb.

             reply	other threads:[~2012-02-16  9:12 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-02-16  9:12 Gleb Natapov [this message]
2012-02-16 12:55 ` [PATCH uq/master] Synchronize cpu state with kernel before poking into registers Jan Kiszka
2012-02-16 13:59 ` [PATCH] " 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=20120216091251.GD19771@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox