Commit ecada8a2dddff7b0382e35b9ffe5643ed895a7f4
1 parent
1e8a7cfd
CR4.TSD flag support (Matt Schulkind)
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@1556 c046a42c-6fe2-441c-8c8c-71466251a162
Showing
2 changed files
with
6 additions
and
2 deletions
target-i386/helper.c
... | ... | @@ -2328,7 +2328,10 @@ void helper_invlpg(target_ulong addr) |
2328 | 2328 | void helper_rdtsc(void) |
2329 | 2329 | { |
2330 | 2330 | uint64_t val; |
2331 | - | |
2331 | + | |
2332 | + if ((env->cr[4] & CR4_TSD_MASK) && ((env->hflags & HF_CPL_MASK) != 0)) { | |
2333 | + raise_exception(EXCP0D_GPF); | |
2334 | + } | |
2332 | 2335 | val = cpu_get_tsc(env); |
2333 | 2336 | EAX = (uint32_t)(val); |
2334 | 2337 | EDX = (uint32_t)(val >> 32); | ... | ... |
target-i386/translate.c
... | ... | @@ -4909,7 +4909,7 @@ static target_ulong disas_insn(DisasContext *s, target_ulong pc_start) |
4909 | 4909 | gen_op_movl_T1_imu(offset); |
4910 | 4910 | } |
4911 | 4911 | goto do_lcall; |
4912 | - case 0xe9: /* jmp */ | |
4912 | + case 0xe9: /* jmp im */ | |
4913 | 4913 | if (dflag) |
4914 | 4914 | tval = (int32_t)insn_get(s, OT_LONG); |
4915 | 4915 | else |
... | ... | @@ -5366,6 +5366,7 @@ static target_ulong disas_insn(DisasContext *s, target_ulong pc_start) |
5366 | 5366 | } |
5367 | 5367 | break; |
5368 | 5368 | case 0x131: /* rdtsc */ |
5369 | + gen_jmp_im(pc_start - s->cs_base); | |
5369 | 5370 | gen_op_rdtsc(); |
5370 | 5371 | break; |
5371 | 5372 | case 0x134: /* sysenter */ | ... | ... |