Changeset 14411 in vbox for trunk/src/recompiler
- Timestamp:
- Nov 20, 2008 1:26:47 PM (16 years ago)
- svn:sync-xref-src-repo-rev:
- 39642
- Location:
- trunk/src/recompiler
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/recompiler/VBoxREMWrapper.cpp
r13852 r14411 480 480 }; 481 481 482 /* CPUMGetGuestMsr args */ 483 static const REMPARMDESC g_aArgsCPUMGetGuestMsr[] = 484 { 485 { REMPARMDESC_FLAGS_INT, sizeof(PVM), NULL }, 486 { REMPARMDESC_FLAGS_INT, sizeof(uint32_t), NULL }, 487 }; 488 489 /* CPUMGetGuestMsr args */ 490 static const REMPARMDESC g_aArgsCPUMSetGuestMsr[] = 491 { 492 { REMPARMDESC_FLAGS_INT, sizeof(PVM), NULL }, 493 { REMPARMDESC_FLAGS_INT, sizeof(uint32_t), NULL }, 494 { REMPARMDESC_FLAGS_INT, sizeof(uint64_t), NULL }, 495 }; 496 482 497 static const REMPARMDESC g_aArgsCPUMGetGuestCpuId[] = 483 498 { … … 1043 1058 { "CPUMSetChangedFlags", (void *)(uintptr_t)&CPUMSetChangedFlags, &g_aArgsCPUMSetChangedFlags[0], RT_ELEMENTS(g_aArgsCPUMSetChangedFlags), REMFNDESC_FLAGS_RET_VOID, 0, NULL }, 1044 1059 { "CPUMGetGuestCPL", (void *)(uintptr_t)&CPUMGetGuestCPL, &g_aArgsCPUMGetGuestCpl[0], RT_ELEMENTS(g_aArgsCPUMGetGuestCpl), REMFNDESC_FLAGS_RET_INT, sizeof(unsigned), NULL }, 1060 { "CPUMGetGuestMsr", (void *)(uintptr_t)&CPUMGetGuestMsr, &g_aArgsCPUMGetGuestMsr[0], RT_ELEMENTS(g_aArgsCPUMGetGuestMsr), REMFNDESC_FLAGS_RET_INT, sizeof(uint64_t), NULL }, 1061 { "CPUMSetGuestMsr", (void *)(uintptr_t)&CPUMSetGuestMsr, &g_aArgsCPUMSetGuestMsr[0], RT_ELEMENTS(g_aArgsCPUMSetGuestMsr), REMFNDESC_FLAGS_RET_VOID, 0, NULL }, 1045 1062 { "CPUMGetGuestCpuId", (void *)(uintptr_t)&CPUMGetGuestCpuId, &g_aArgsCPUMGetGuestCpuId[0], RT_ELEMENTS(g_aArgsCPUMGetGuestCpuId), REMFNDESC_FLAGS_RET_VOID, 0, NULL }, 1046 1063 { "CPUMGetGuestEAX", (void *)(uintptr_t)&CPUMGetGuestEAX, &g_aArgsVM[0], RT_ELEMENTS(g_aArgsVM), REMFNDESC_FLAGS_RET_INT, sizeof(uint32_t), NULL }, -
trunk/src/recompiler/VBoxRecompiler.c
r13840 r14411 1773 1773 #endif 1774 1774 1775 1776 1775 /* 1777 1776 * Registers which are rarely changed and require special handling / order when changed. … … 4133 4132 LogFlow(("cpu_apic_wrmsr: rc=%Rrc\n", rc)); NOREF(rc); 4134 4133 } 4134 4135 uint64_t cpu_rdmsr(CPUX86State *env, uint32_t msr) 4136 { 4137 return CPUMGetGuestMsr(env->pVM, msr); 4138 } 4139 4140 void cpu_wrmsr(CPUX86State *env, uint32_t msr, uint64_t val) 4141 { 4142 CPUMSetGuestMsr(env->pVM, msr, val); 4143 } 4144 4135 4145 /* -+- I/O Ports -+- */ 4136 4146 -
trunk/src/recompiler/target-i386/cpu.h
r13034 r14411 857 857 void cpu_smm_update(CPUX86State *env); 858 858 859 #ifdef VBOX 860 uint64_t cpu_rdmsr(CPUX86State *env, uint32_t msr); 861 void cpu_wrmsr(CPUX86State *env, uint32_t msr, uint64_t val); 862 #endif 863 859 864 /* will be suppressed */ 860 865 void cpu_x86_update_cr0(CPUX86State *env, uint32_t new_cr0); -
trunk/src/recompiler/target-i386/exec.h
r11982 r14411 215 215 void helper_sysret(int dflag); 216 216 void helper_rdtsc(void); 217 #ifdef VBOX 218 void helper_rdtscp(void); 219 #endif 217 220 void helper_rdmsr(void); 218 221 void helper_wrmsr(void); -
trunk/src/recompiler/target-i386/helper.c
r13839 r14411 3023 3023 } 3024 3024 3025 #ifdef VBOX 3026 void 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 3025 3041 #if defined(CONFIG_USER_ONLY) 3026 3042 void helper_wrmsr(void) … … 3106 3122 break; 3107 3123 } 3124 case MSR_K8_TSC_AUX: 3125 cpu_wrmsr(env, MSR_K8_TSC_AUX, val); 3126 break; 3108 3127 #endif /* VBOX */ 3109 3128 } … … 3170 3189 break; 3171 3190 } 3191 case MSR_K8_TSC_AUX: 3192 val = cpu_rdmsr(env, MSR_K8_TSC_AUX); 3193 break; 3172 3194 #endif /* VBOX */ 3173 3195 } -
trunk/src/recompiler/target-i386/op.c
r13449 r14411 1055 1055 helper_rdtsc(); 1056 1056 } 1057 1058 #ifdef VBOX 1059 void OPPROTO op_rdtscp(void) 1060 { 1061 helper_rdtscp(); 1062 } 1063 #endif 1057 1064 1058 1065 void OPPROTO op_cpuid(void) -
trunk/src/recompiler/target-i386/translate.c
r13839 r14411 5940 5940 op = (modrm >> 3) & 7; 5941 5941 rm = modrm & 7; 5942 5943 #ifdef VBOX 5944 /* 0f 01 f9 */ 5945 if (modrm == 0xf9) 5946 { 5947 if (!(s->cpuid_ext2_features & CPUID_EXT2_RDTSCP)) 5948 goto illegal_op; 5949 gen_jmp_im(pc_start - s->cs_base); 5950 gen_op_rdtscp(); 5951 break; 5952 } 5953 #endif 5954 5942 5955 switch(op) { 5943 5956 case 0: /* sgdt */
Note:
See TracChangeset
for help on using the changeset viewer.