VirtualBox

Ignore:
Timestamp:
Nov 20, 2008 1:26:47 PM (16 years ago)
Author:
vboxsync
Message:

RDTSCP support added. Enabled only for AMD-V guests.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/recompiler/target-i386/helper.c

    r13839 r14411  
    30233023}
    30243024
     3025#ifdef VBOX
     3026void helper_rdtscp(void)
     3027{
     3028    uint64_t val;
     3029
     3030    if ((env->cr[4] & CR4_TSD_MASK) && ((env->hflags & HF_CPL_MASK) != 0)) {
     3031        raise_exception(EXCP0D_GPF);
     3032    }
     3033
     3034    val = cpu_get_tsc(env);
     3035    EAX = (uint32_t)(val);
     3036    EDX = (uint32_t)(val >> 32);
     3037    ECX = cpu_rdmsr(env, MSR_K8_TSC_AUX);
     3038}
     3039#endif
     3040
    30253041#if defined(CONFIG_USER_ONLY)
    30263042void helper_wrmsr(void)
     
    31063122        break;
    31073123    }
     3124    case MSR_K8_TSC_AUX:
     3125        cpu_wrmsr(env, MSR_K8_TSC_AUX, val);
     3126        break;
    31083127#endif /* VBOX */
    31093128    }
     
    31703189        break;
    31713190    }
     3191    case MSR_K8_TSC_AUX:
     3192        val = cpu_rdmsr(env, MSR_K8_TSC_AUX);
     3193        break;
    31723194#endif /* VBOX */
    31733195    }
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette