VirtualBox

儲存庫 vbox 的更動 12162


忽略:
時間撮記:
2008-9-5 下午11:28:27 (16 年 以前)
作者:
vboxsync
訊息:

VMM: Assert that we don't change CPU unexpectedly while executing in VT-x or AMD-V mode. (strict builds only)

位置:
trunk/src/VBox/VMM
檔案:
修改 3 筆資料

圖例:

未更動
新增
刪除
  • trunk/src/VBox/VMM/HWACCMInternal.h

    r12121 r12162  
    387387        bool                    fHostDebugRegsSaved;
    388388    } savedhoststate;
     389#endif
     390
     391#ifdef VBOX_STRICT
     392    /** The CPU ID of the CPU currently owning the VMCS. Set in
     393     * HWACCMR0Enter and cleared in HWACCMR0Leave. */
     394    RTCPUID                 idEnteredCpu;
     395# if HC_ARCH_BITS == 32
     396    RTCPUID                 Alignment0;
     397# endif
    389398#endif
    390399
  • trunk/src/VBox/VMM/VMMR0/HWACCMR0.cpp

    r12121 r12162  
    681681    pVM->hwaccm.s.cpuid.u32AMDFeatureEDX    = HWACCMR0Globals.cpuid.u32AMDFeatureEDX;
    682682    pVM->hwaccm.s.lLastError                = HWACCMR0Globals.lLastError;
     683#ifdef VBOX_STRICT
     684    pVM->hwaccm.s.idEnteredCpu              = NIL_RTCPUID;
     685#endif
    683686
    684687    /* Init a VT-x or AMD-V VM. */
     
    774777    rc |= HWACCMR0Globals.pfnLoadGuestState(pVM, pCtx);
    775778    AssertRC(rc);
     779
     780#ifdef VBOX_STRICT
     781    /* keep track of the CPU owning the VMCS for debugging scheduling weirdness and ring-3 calls. */
     782    if (RT_SUCCESS(rc))
     783    {
     784        AssertMsg(pVM->hwaccm.s.idEnteredCpu == NIL_RTCPUID, ("%d", (int)pVM->hwaccm.s.idEnteredCpu));
     785        pVM->hwaccm.s.idEnteredCpu = idCpu;
     786    }
     787#endif
    776788    return rc;
    777789}
     
    826838    /* Resync the debug register on the next entry. */
    827839    pVM->hwaccm.s.fContextUseFlags |= HWACCM_CHANGED_GUEST_DEBUG;
    828     return HWACCMR0Globals.pfnLeaveSession(pVM);
     840    rc = HWACCMR0Globals.pfnLeaveSession(pVM);
     841
     842#ifdef VBOX_STRICT
     843    /* keep track of the CPU owning the VMCS for debugging scheduling weirdness and ring-3 calls. */
     844    RTCPUID idCpu = RTMpCpuId();
     845    AssertMsg(pVM->hwaccm.s.idEnteredCpu == idCpu, ("owner is %d, I'm %d", (int)pVM->hwaccm.s.idEnteredCpu, (int)idCpu));
     846    pVM->hwaccm.s.idEnteredCpu = NIL_RTCPUID;
     847#endif
     848
     849    return rc;
    829850}
    830851
  • trunk/src/VBox/VMM/VMMR0/HWVMXR0.cpp

    r12121 r12162  
    11951195     */
    11961196ResumeExecution:
     1197    AssertMsg(pVM->hwaccm.s.idEnteredCpu == RTMpCpuId(),
     1198              ("Expected %d, I'm %d; cResume=%d exitReason=%RTreg exitQualification=%RTreg\n",
     1199               (int)pVM->hwaccm.s.idEnteredCpu, (int)RTMpCpuId(), cResume, exitReason, exitQualification));
     1200
    11971201    /* Safety precaution; looping for too long here can have a very bad effect on the host */
    11981202    if (++cResume > HWACCM_MAX_RESUME_LOOPS)
     
    17631767            case X86_XCPT_DB:   /* Debug exception. */
    17641768            {
    1765                 /* DR6, DR7.GD and IA32_DEBUGCTL.LBR are not updated yet. 
     1769                /* DR6, DR7.GD and IA32_DEBUGCTL.LBR are not updated yet.
    17661770                 *
    17671771                 * Exit qualification bits:
注意: 瀏覽 TracChangeset 來幫助您使用更動檢視器

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