CR4.TSD flag support (Matt Schulkind)
authorbellard <bellard@c046a42c-6fe2-441c-8c8c-71466251a162>
Sun, 21 Aug 2005 10:28:44 +0000 (10:28 +0000)
committerbellard <bellard@c046a42c-6fe2-441c-8c8c-71466251a162>
Sun, 21 Aug 2005 10:28:44 +0000 (10:28 +0000)
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@1556 c046a42c-6fe2-441c-8c8c-71466251a162

target-i386/helper.c
target-i386/translate.c

index c41cbb7..424dc52 100644 (file)
@@ -2328,7 +2328,10 @@ void helper_invlpg(target_ulong addr)
 void helper_rdtsc(void)
 {
     uint64_t val;
-    
+
+    if ((env->cr[4] & CR4_TSD_MASK) && ((env->hflags & HF_CPL_MASK) != 0)) {
+        raise_exception(EXCP0D_GPF);
+    }
     val = cpu_get_tsc(env);
     EAX = (uint32_t)(val);
     EDX = (uint32_t)(val >> 32);
index 619522a..0f6b0eb 100644 (file)
@@ -4909,7 +4909,7 @@ static target_ulong disas_insn(DisasContext *s, target_ulong pc_start)
             gen_op_movl_T1_imu(offset);
         }
         goto do_lcall;
-    case 0xe9: /* jmp */
+    case 0xe9: /* jmp im */
         if (dflag)
             tval = (int32_t)insn_get(s, OT_LONG);
         else
@@ -5366,6 +5366,7 @@ static target_ulong disas_insn(DisasContext *s, target_ulong pc_start)
         }
         break;
     case 0x131: /* rdtsc */
+        gen_jmp_im(pc_start - s->cs_base);
         gen_op_rdtsc();
         break;
     case 0x134: /* sysenter */