VirtualBox

vbox的更動 16340 路徑 trunk/src/recompiler_new


忽略:
時間撮記:
2009-1-28 下午09:11:20 (16 年 以前)
作者:
vboxsync
訊息:

target-i386/op_helper.c: fixed stack alignment check in helper_external_event so it works on 64-bit darwin as well.

檔案:
修改 1 筆資料

圖例:

未更動
新增
刪除
  • trunk/src/recompiler_new/target-i386/op_helper.c

    r16156 r16340  
    153153        raise_exception(EXCP0D_GPF);
    154154    } else {
    155         load_eflags(new_eflags, 
     155        load_eflags(new_eflags,
    156156                    (TF_MASK | AC_MASK | ID_MASK | NT_MASK) & 0xffff);
    157157
     
    185185{
    186186    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],
    189189            (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]));
    193193}
    194194#endif
     
    206206    target_ulong ptr;
    207207
    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
    216216
    217217    if (selector & 0x4)
     
    332332    int rpl, dpl, cpl;
    333333
    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
    344344
    345345    if ((selector & 0xfffc) != 0) {
     
    14291429{
    14301430#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));
    14341438#endif
    14351439    /* Keep in sync with flags checked by gen_check_external_event() */
     
    36533657}
    36543658
    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
     3660void 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
    36693673
    36703674void helper_rdpmc(void)
     
    38573861            break;
    38583862        }
    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;
    38623866#endif /* VBOX */
    38633867    }
     
    54695473#if defined(VBOX) && defined(REM_PHYS_ADDR_IN_TLB)
    54705474/* 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. */
    54725476RTCCUINTREG REGPARM __ldb_vbox_phys(RTCCUINTREG addr)
    54735477{
     
    56755679    else
    56765680    {
    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
    56785682           time critical - let's not do that */
    56795683#if 0
注意: 瀏覽 TracChangeset 來幫助您使用更動檢視器

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