From: Paolo Bonzini <pbonzini@redhat.com>
To: qemu-devel@nongnu.org
Cc: Mihail Abakumov <mikhail.abakumov@ispras.ru>
Subject: [Qemu-devel] [PULL 21/22] i386: fix read/write cr with icount option
Date: Fri, 26 May 2017 16:38:25 +0200 [thread overview]
Message-ID: <20170526143826.27780-3-pbonzini@redhat.com> (raw)
In-Reply-To: <20170526143826.27780-1-pbonzini@redhat.com>
From: Mihail Abakumov <mikhail.abakumov@ispras.ru>
Running Windows with icount causes a crash in instruction of write cr.
This patch fixes it.
Reading and writing cr cause an icount read because there are called
cpu_get_apic_tpr and cpu_set_apic_tpr functions. So, there is need
gen_io_start()/gen_io_end() calls.
Signed-off-by: Mihail Abakumov <mikhail.abakumov@ispras.ru>
Message-Id: <ffb376034ff184f2fcbe93d5317d9e76@ispras.ru>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
target/i386/translate.c | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/target/i386/translate.c b/target/i386/translate.c
index 1d1372fb43..39912f369f 100644
--- a/target/i386/translate.c
+++ b/target/i386/translate.c
@@ -7914,14 +7914,26 @@ static target_ulong disas_insn(CPUX86State *env, DisasContext *s,
gen_update_cc_op(s);
gen_jmp_im(pc_start - s->cs_base);
if (b & 2) {
+ if (s->tb->cflags & CF_USE_ICOUNT) {
+ gen_io_start();
+ }
gen_op_mov_v_reg(ot, cpu_T0, rm);
gen_helper_write_crN(cpu_env, tcg_const_i32(reg),
cpu_T0);
+ if (s->tb->cflags & CF_USE_ICOUNT) {
+ gen_io_end();
+ }
gen_jmp_im(s->pc - s->cs_base);
gen_eob(s);
} else {
+ if (s->tb->cflags & CF_USE_ICOUNT) {
+ gen_io_start();
+ }
gen_helper_read_crN(cpu_T0, cpu_env, tcg_const_i32(reg));
gen_op_mov_reg_v(ot, rm, cpu_T0);
+ if (s->tb->cflags & CF_USE_ICOUNT) {
+ gen_io_end();
+ }
}
break;
default:
--
2.13.0
next prev parent reply other threads:[~2017-05-26 14:38 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-05-26 14:38 [Qemu-devel] [PULL v3 00/22] Misc patches for 2017-05-19 Paolo Bonzini
2017-05-26 14:38 ` [Qemu-devel] [PULL 14/22] nbd/client.c: use errp instead of LOG Paolo Bonzini
2017-05-26 14:38 ` Paolo Bonzini [this message]
2017-05-26 14:38 ` [Qemu-devel] [PULL 22/22] sockets: improve error reporting if UNIX socket path is too long Paolo Bonzini
2017-05-30 9:22 ` [Qemu-devel] [PULL v3 00/22] Misc patches for 2017-05-19 Stefan Hajnoczi
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=20170526143826.27780-3-pbonzini@redhat.com \
--to=pbonzini@redhat.com \
--cc=mikhail.abakumov@ispras.ru \
--cc=qemu-devel@nongnu.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;
as well as URLs for NNTP newsgroup(s).