[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 21/33] i386: fix read/write cr with icount option
From: |
Paolo Bonzini |
Subject: |
[Qemu-devel] [PULL 21/33] i386: fix read/write cr with icount option |
Date: |
Thu, 1 Jun 2017 14:41:39 +0200 |
From: Mihail Abakumov <address@hidden>
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 <address@hidden>
Message-Id: <address@hidden>
Signed-off-by: Paolo Bonzini <address@hidden>
---
target/i386/translate.c | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/target/i386/translate.c b/target/i386/translate.c
index 1d1372f..39912f3 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:
--
1.8.3.1
- [Qemu-devel] [PULL 13/33] nbd: add errp to read_sync, write_sync and drop_sync, (continued)
[Qemu-devel] [PULL 19/33] target/i386: enable A20 automatically in system management mode, Paolo Bonzini, 2017/06/01
[Qemu-devel] [PULL 18/33] vhost-user-scsi: Introduce a vhost-user-scsi sample application, Paolo Bonzini, 2017/06/01
[Qemu-devel] [PULL 21/33] i386: fix read/write cr with icount option,
Paolo Bonzini <=
[Qemu-devel] [PULL 20/33] target/i386: use multiple CPU AddressSpaces, Paolo Bonzini, 2017/06/01
[Qemu-devel] [PULL 23/33] exec: fix address_space_get_iotlb_entry page mask, Paolo Bonzini, 2017/06/01
[Qemu-devel] [PULL 24/33] nbd: Fully initialize client in case of failed negotiation, Paolo Bonzini, 2017/06/01
[Qemu-devel] [PULL 22/33] sockets: improve error reporting if UNIX socket path is too long, Paolo Bonzini, 2017/06/01
[Qemu-devel] [PULL 26/33] kvmclock: update system_time_msr address forcibly, Paolo Bonzini, 2017/06/01
[Qemu-devel] [PULL 25/33] qtest: add rtc periodic timer test, Paolo Bonzini, 2017/06/01