VirtualBox

Changeset 48448 in vbox


Ignore:
Timestamp:
Sep 12, 2013 12:53:17 PM (11 years ago)
Author:
vboxsync
Message:

VMM: Assertions.

Location:
trunk/src/VBox/VMM/VMMR0
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/VMM/VMMR0/HMR0.cpp

    r48426 r48448  
    800800{
    801801    PHMR0FIRSTRC pFirstRc = (PHMR0FIRSTRC)pvUser1;
     802    Assert(!RTThreadPreemptIsEnabled(NIL_RTTHREAD));
    802803    Assert(idCpu == (RTCPUID)RTMpCpuIdToSetIndex(idCpu)); /** @todo fix idCpu == index assumption (rainy day) */
    803     Assert(!RTThreadPreemptIsEnabled(NIL_RTTHREAD));
    804804    NOREF(pvUser2);
    805805
     
    904904 * @param   pVM         Pointer to the VM (can be NULL).
    905905 * @param   idCpu       The identifier for the CPU the function is called on.
     906 *
     907 * @remarks Maybe called with interrupts disabled!
    906908 */
    907909static int hmR0EnableCpu(PVM pVM, RTCPUID idCpu)
     
    10711073
    10721074    Assert(!g_HvmR0.vmx.fSupported || !g_HvmR0.vmx.fUsingSUPR0EnableVTx);
     1075    Assert(!RTThreadPreemptIsEnabled(NIL_RTTHREAD));
    10731076    Assert(idCpu == (RTCPUID)RTMpCpuIdToSetIndex(idCpu)); /** @todo fix idCpu == index assumption (rainy day) */
    10741077    Assert(idCpu < RT_ELEMENTS(g_HvmR0.aCpuInfo));
    10751078    Assert(!pCpu->fConfigured || pCpu->hMemObj != NIL_RTR0MEMOBJ);
    1076     Assert(!RTThreadPreemptIsEnabled(NIL_RTTHREAD));
    10771079
    10781080    if (pCpu->hMemObj == NIL_RTR0MEMOBJ)
  • trunk/src/VBox/VMM/VMMR0/VMMR0.cpp

    r48394 r48448  
    948948                    rc = vmmR0CallRing3SetJmp(&pVCpu->vmm.s.CallRing3JmpBufR0, HMR0RunGuestCode, pVM, pVCpu);
    949949
     950                    /* Manual assert as normal assertions are going to crash in this case. */
    950951                    if (RT_UNLIKELY(   VMCPU_GET_STATE(pVCpu) != VMCPUSTATE_STARTED_HM
    951952                                    && RT_SUCCESS_NP(rc)  && rc !=  VINF_VMM_CALL_HOST ))
    952953                    {
    953                         /* Manual assert as normal assertions are going to crash in this case. */
    954954                        pVM->vmm.s.szRing0AssertMsg1[0] = '\0';
    955955                        RTStrPrintf(pVM->vmm.s.szRing0AssertMsg2, sizeof(pVM->vmm.s.szRing0AssertMsg2),
     
    957957                        rc = VERR_VMM_WRONG_HM_VMCPU_STATE;
    958958                    }
     959                    else if (RT_UNLIKELY(VMMR0ThreadCtxHooksAreRegistered(pVCpu)))
     960                    {
     961                        pVM->vmm.s.szRing0AssertMsg1[0] = '\0';
     962                        RTStrPrintf(pVM->vmm.s.szRing0AssertMsg2, sizeof(pVM->vmm.s.szRing0AssertMsg2),
     963                                    "Thread-context hooks still registered! VCPU=%p Id=%u rc=%d.\n", pVCpu, pVCpu->idCpu, rc);
     964                        rc = VERR_INVALID_STATE;
     965                    }
     966
    959967                    VMCPU_SET_STATE(pVCpu, VMCPUSTATE_STARTED);
    960968                }
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