From 933ef379b4b11f10b430536cee2db4d5665fbb6b Mon Sep 17 00:00:00 2001 From: mothran Date: Fri, 28 Aug 2015 03:19:10 -0700 Subject: [PATCH] restricted fpip updates to only non-control instructions --- qemu/target-i386/translate.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/qemu/target-i386/translate.c b/qemu/target-i386/translate.c index d48ed3c8..5b4ccb25 100644 --- a/qemu/target-i386/translate.c +++ b/qemu/target-i386/translate.c @@ -6070,7 +6070,6 @@ static target_ulong disas_insn(CPUX86State *env, DisasContext *s, gen_exception(s, EXCP07_PREX, pc_start - s->cs_base); break; } - fpu_update_ip(env); modrm = cpu_ldub_code(env, s->pc++); mod = (modrm >> 6) & 3; rm = modrm & 7; @@ -6116,6 +6115,7 @@ static target_ulong disas_insn(CPUX86State *env, DisasContext *s, /* fcomp needs pop */ gen_helper_fpop(tcg_ctx, cpu_env); } + fpu_update_ip(env); } break; case 0x08: /* flds */ @@ -6200,6 +6200,7 @@ static target_ulong disas_insn(CPUX86State *env, DisasContext *s, gen_helper_fpop(tcg_ctx, cpu_env); break; } + fpu_update_ip(env); break; case 0x0c: /* fldenv mem */ gen_update_cc_op(s); @@ -6225,12 +6226,14 @@ static target_ulong disas_insn(CPUX86State *env, DisasContext *s, gen_update_cc_op(s); gen_jmp_im(s, pc_start - s->cs_base); gen_helper_fldt_ST0(tcg_ctx, cpu_env, cpu_A0); + fpu_update_ip(env); break; case 0x1f: /* fstpt mem */ gen_update_cc_op(s); gen_jmp_im(s, pc_start - s->cs_base); gen_helper_fstt_ST0(tcg_ctx, cpu_env, cpu_A0); gen_helper_fpop(tcg_ctx, cpu_env); + fpu_update_ip(env); break; case 0x2c: /* frstor mem */ gen_update_cc_op(s); @@ -6251,21 +6254,25 @@ static target_ulong disas_insn(CPUX86State *env, DisasContext *s, gen_update_cc_op(s); gen_jmp_im(s, pc_start - s->cs_base); gen_helper_fbld_ST0(tcg_ctx, cpu_env, cpu_A0); + fpu_update_ip(env); break; case 0x3e: /* fbstp */ gen_update_cc_op(s); gen_jmp_im(s, pc_start - s->cs_base); gen_helper_fbst_ST0(tcg_ctx, cpu_env, cpu_A0); gen_helper_fpop(tcg_ctx, cpu_env); + fpu_update_ip(env); break; case 0x3d: /* fildll */ tcg_gen_qemu_ld_i64(s->uc, cpu_tmp1_i64, cpu_A0, s->mem_index, MO_LEQ); gen_helper_fildll_ST0(tcg_ctx, cpu_env, cpu_tmp1_i64); + fpu_update_ip(env); break; case 0x3f: /* fistpll */ gen_helper_fistll_ST0(tcg_ctx, cpu_tmp1_i64, cpu_env); tcg_gen_qemu_st_i64(s->uc, cpu_tmp1_i64, cpu_A0, s->mem_index, MO_LEQ); gen_helper_fpop(tcg_ctx, cpu_env); + fpu_update_ip(env); break; default: goto illegal_op; @@ -6580,6 +6587,7 @@ static target_ulong disas_insn(CPUX86State *env, DisasContext *s, default: goto illegal_op; } + fpu_update_ip(env); } break; /************************/