aboutsummaryrefslogtreecommitdiff
path: root/target-i386/helper.c
diff options
context:
space:
mode:
Diffstat (limited to 'target-i386/helper.c')
-rw-r--r--target-i386/helper.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/target-i386/helper.c b/target-i386/helper.c
index c41cbb7278..424dc52848 100644
--- a/target-i386/helper.c
+++ b/target-i386/helper.c
@@ -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);