Commit efade670fe2c97c820cff17bb9d7817b8607c5fb
1 parent
bf20dc07
Fix rdtsc instruction counting.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@4810 c046a42c-6fe2-441c-8c8c-71466251a162
Showing
1 changed file
with
6 additions
and
0 deletions
target-i386/translate.c
| @@ -6382,7 +6382,13 @@ static target_ulong disas_insn(DisasContext *s, target_ulong pc_start) | @@ -6382,7 +6382,13 @@ static target_ulong disas_insn(DisasContext *s, target_ulong pc_start) | ||
| 6382 | if (s->cc_op != CC_OP_DYNAMIC) | 6382 | if (s->cc_op != CC_OP_DYNAMIC) |
| 6383 | gen_op_set_cc_op(s->cc_op); | 6383 | gen_op_set_cc_op(s->cc_op); |
| 6384 | gen_jmp_im(pc_start - s->cs_base); | 6384 | gen_jmp_im(pc_start - s->cs_base); |
| 6385 | + if (use_icount) | ||
| 6386 | + gen_io_start(); | ||
| 6385 | tcg_gen_helper_0_0(helper_rdtsc); | 6387 | tcg_gen_helper_0_0(helper_rdtsc); |
| 6388 | + if (use_icount) { | ||
| 6389 | + gen_io_end(); | ||
| 6390 | + gen_jmp(s, s->pc - s->cs_base); | ||
| 6391 | + } | ||
| 6386 | break; | 6392 | break; |
| 6387 | case 0x133: /* rdpmc */ | 6393 | case 0x133: /* rdpmc */ |
| 6388 | if (s->cc_op != CC_OP_DYNAMIC) | 6394 | if (s->cc_op != CC_OP_DYNAMIC) |