vbox的更動 16340 路徑 trunk/src/recompiler_new
- 時間撮記:
- 2009-1-28 下午09:11:20 (16 年 以前)
- 檔案:
-
- 修改 1 筆資料
圖例:
- 未更動
- 新增
- 刪除
-
trunk/src/recompiler_new/target-i386/op_helper.c
r16156 r16340 153 153 raise_exception(EXCP0D_GPF); 154 154 } else { 155 load_eflags(new_eflags, 155 load_eflags(new_eflags, 156 156 (TF_MASK | AC_MASK | ID_MASK | NT_MASK) & 0xffff); 157 157 … … 185 185 { 186 186 LogRel(("CS:EIP=%08x:%08x, FLAGS=%08x\n", env->segs[R_CS].base, env->eip, env->eflags)); 187 LogRel(("EAX=%08x\tECX=%08x\tEDX=%08x\tEBX=%08x\n", 188 (uint32_t)env->regs[R_EAX], (uint32_t)env->regs[R_ECX], 187 LogRel(("EAX=%08x\tECX=%08x\tEDX=%08x\tEBX=%08x\n", 188 (uint32_t)env->regs[R_EAX], (uint32_t)env->regs[R_ECX], 189 189 (uint32_t)env->regs[R_EDX], (uint32_t)env->regs[R_EBX])); 190 LogRel(("ESP=%08x\tEBP=%08x\tESI=%08x\tEDI=%08x\n", 191 (uint32_t)env->regs[R_ESP], (uint32_t)env->regs[R_EBP], 192 (uint32_t)env->regs[R_ESI], (uint32_t)env->regs[R_EDI])); 190 LogRel(("ESP=%08x\tEBP=%08x\tESI=%08x\tEDI=%08x\n", 191 (uint32_t)env->regs[R_ESP], (uint32_t)env->regs[R_EBP], 192 (uint32_t)env->regs[R_ESI], (uint32_t)env->regs[R_EDI])); 193 193 } 194 194 #endif … … 206 206 target_ulong ptr; 207 207 208 #ifdef VBOX 209 /* Trying to load a selector with CPL=1? */ 210 if ((env->hflags & HF_CPL_MASK) == 0 && (selector & 3) == 1 && (env->state & CPU_RAW_RING0)) 211 { 212 Log(("RPL 1 -> sel %04X -> %04X\n", selector, selector & 0xfffc)); 213 selector = selector & 0xfffc; 214 } 215 #endif 208 #ifdef VBOX 209 /* Trying to load a selector with CPL=1? */ 210 if ((env->hflags & HF_CPL_MASK) == 0 && (selector & 3) == 1 && (env->state & CPU_RAW_RING0)) 211 { 212 Log(("RPL 1 -> sel %04X -> %04X\n", selector, selector & 0xfffc)); 213 selector = selector & 0xfffc; 214 } 215 #endif 216 216 217 217 if (selector & 0x4) … … 332 332 int rpl, dpl, cpl; 333 333 334 #ifdef VBOX 335 e1 = e2 = 0; 336 cpl = env->hflags & HF_CPL_MASK; 337 /* Trying to load a selector with CPL=1? */ 338 if (cpl == 0 && (selector & 3) == 1 && (env->state & CPU_RAW_RING0)) 339 { 340 Log(("RPL 1 -> sel %04X -> %04X\n", selector, selector & 0xfffc)); 341 selector = selector & 0xfffc; 342 } 343 #endif 334 #ifdef VBOX 335 e1 = e2 = 0; 336 cpl = env->hflags & HF_CPL_MASK; 337 /* Trying to load a selector with CPL=1? */ 338 if (cpl == 0 && (selector & 3) == 1 && (env->state & CPU_RAW_RING0)) 339 { 340 Log(("RPL 1 -> sel %04X -> %04X\n", selector, selector & 0xfffc)); 341 selector = selector & 0xfffc; 342 } 343 #endif 344 344 345 345 if ((selector & 0xfffc) != 0) { … … 1429 1429 { 1430 1430 #if defined(RT_OS_DARWIN) && defined(VBOX_STRICT) 1431 uintptr_t uESP; 1432 __asm__ __volatile__("movl %%esp, %0" : "=r" (uESP)); 1433 AssertMsg(!(uESP & 15), ("esp=%#p\n", uESP)); 1431 uintptr_t uSP; 1432 # ifdef RT_ARCH_AMD64 1433 __asm__ __volatile__("movl %%rsp, %0" : "=r" (uSP)); 1434 # else 1435 __asm__ __volatile__("movl %%esp, %0" : "=r" (uSP)); 1436 # endif 1437 AssertMsg(!(uSP & 15), ("xSP=%#p\n", uSP)); 1434 1438 #endif 1435 1439 /* Keep in sync with flags checked by gen_check_external_event() */ … … 3653 3657 } 3654 3658 3655 #ifdef VBOX 3656 void helper_rdtscp(void) 3657 { 3658 uint64_t val; 3659 if ((env->cr[4] & CR4_TSD_MASK) && ((env->hflags & HF_CPL_MASK) != 0)) { 3660 raise_exception(EXCP0D_GPF); 3661 } 3662 3663 val = cpu_get_tsc(env); 3664 EAX = (uint32_t)(val); 3665 EDX = (uint32_t)(val >> 32); 3666 ECX = cpu_rdmsr(env, MSR_K8_TSC_AUX); 3667 } 3668 #endif 3659 #ifdef VBOX 3660 void helper_rdtscp(void) 3661 { 3662 uint64_t val; 3663 if ((env->cr[4] & CR4_TSD_MASK) && ((env->hflags & HF_CPL_MASK) != 0)) { 3664 raise_exception(EXCP0D_GPF); 3665 } 3666 3667 val = cpu_get_tsc(env); 3668 EAX = (uint32_t)(val); 3669 EDX = (uint32_t)(val >> 32); 3670 ECX = cpu_rdmsr(env, MSR_K8_TSC_AUX); 3671 } 3672 #endif 3669 3673 3670 3674 void helper_rdpmc(void) … … 3857 3861 break; 3858 3862 } 3859 case MSR_K8_TSC_AUX: 3860 val = cpu_rdmsr(env, MSR_K8_TSC_AUX); 3861 break; 3863 case MSR_K8_TSC_AUX: 3864 val = cpu_rdmsr(env, MSR_K8_TSC_AUX); 3865 break; 3862 3866 #endif /* VBOX */ 3863 3867 } … … 5469 5473 #if defined(VBOX) && defined(REM_PHYS_ADDR_IN_TLB) 5470 5474 /* This code assumes real physical address always fit into host CPU reg, 5471 which is wrong in general, but true for our current use cases. */ 5475 which is wrong in general, but true for our current use cases. */ 5472 5476 RTCCUINTREG REGPARM __ldb_vbox_phys(RTCCUINTREG addr) 5473 5477 { … … 5675 5679 else 5676 5680 { 5677 /* For some reasons, it works even w/o save/restore of the jump buffer, so as code is 5681 /* For some reasons, it works even w/o save/restore of the jump buffer, so as code is 5678 5682 time critical - let's not do that */ 5679 5683 #if 0
注意:
瀏覽 TracChangeset
來幫助您使用更動檢視器