VirtualBox

Changeset 39402 in vbox for trunk/src/VBox/VMM/VMMR0


Ignore:
Timestamp:
Nov 23, 2011 4:25:04 PM (13 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
75020
Message:

VMM: don't use generic IPE status codes, use specific ones. Part 1.

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

Legend:

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

    r39084 r39402  
    595595
    596596/** Macro for obtaining and validating the g_pGMM pointer.
    597  * On failure it will return from the invoking function with the specified return value.
     597 * 
     598 * On failure it will return from the invoking function with the specified
     599 * return value.
    598600 *
    599601 * @param   pGMM    The name of the pGMM variable.
    600  * @param   rc      The return value on failure. Use VERR_INTERNAL_ERROR for
    601  *                  VBox status codes.
     602 * @param   rc      The return value on failure. Use VERR_GMM_INSTANCE for VBox
     603 *                  status codes.
    602604 */
    603605#define GMM_GET_VALID_INSTANCE(pGMM, rc) \
     
    608610    } while (0)
    609611
    610 /** Macro for obtaining and validating the g_pGMM pointer, void function variant.
    611  * On failure it will return from the invoking function.
     612/** Macro for obtaining and validating the g_pGMM pointer, void function
     613 * variant.
     614 * 
     615 * On failure it will return from the invoking function.
    612616 *
    613617 * @param   pGMM    The name of the pGMM variable.
     
    10971101static int gmmR0ChunkMutexDropGiant(PGMMR0CHUNKMTXSTATE pMtxState)
    10981102{
    1099     AssertReturn(pMtxState->fFlags == GMMR0CHUNK_MTX_KEEP_GIANT, VERR_INTERNAL_ERROR_2);
     1103    AssertReturn(pMtxState->fFlags == GMMR0CHUNK_MTX_KEEP_GIANT, VERR_GMM_MTX_FLAGS);
    11001104    Assert(pMtxState->pGMM->hMtxOwner == RTThreadNativeSelf());
    11011105    pMtxState->fFlags = GMMR0CHUNK_MTX_RETAKE_GIANT;
     
    14581462     */
    14591463    PGMM pGMM;
    1460     GMM_GET_VALID_INSTANCE(pGMM, VERR_INTERNAL_ERROR);
     1464    GMM_GET_VALID_INSTANCE(pGMM, VERR_GMM_INSTANCE);
    14611465    PGVM pGVM;
    14621466    int rc = GVMMR0ByVMAndEMT(pVM, idCpu, &pGVM);
     
    15021506    }
    15031507    else
    1504         rc = VERR_INTERNAL_ERROR_5;
     1508        rc = VERR_GMM_IS_NOT_SANE;
    15051509    gmmR0MutexRelease(pGMM);
    15061510    LogFlow(("GMMR0InitialReservation: returns %Rrc\n", rc));
     
    15551559     */
    15561560    PGMM pGMM;
    1557     GMM_GET_VALID_INSTANCE(pGMM, VERR_INTERNAL_ERROR);
     1561    GMM_GET_VALID_INSTANCE(pGMM, VERR_GMM_INSTANCE);
    15581562    PGVM pGVM;
    15591563    int rc = GVMMR0ByVMAndEMT(pVM, idCpu, &pGVM);
     
    15961600    }
    15971601    else
    1598         rc = VERR_INTERNAL_ERROR_5;
     1602        rc = VERR_GMM_IS_NOT_SANE;
    15991603    gmmR0MutexRelease(pGMM);
    16001604    LogFlow(("GMMR0UpdateReservation: returns %Rrc\n", rc));
     
    20702074
    20712075                /* bail out */
    2072                 rc = VERR_INTERNAL_ERROR;
     2076                rc = VERR_GMM_CHUNK_INSERT;
    20732077            }
    20742078            else
    2075                 rc = VERR_INTERNAL_ERROR_5;
     2079                rc = VERR_GMM_IS_NOT_SANE;
    20762080            gmmR0MutexRelease(pGMM);
    20772081        }
     
    24152419            break;
    24162420        default:
    2417             AssertMsgFailedReturn(("enmAccount=%d\n", enmAccount), VERR_INTERNAL_ERROR);
     2421            AssertMsgFailedReturn(("enmAccount=%d\n", enmAccount), VERR_IPE_NOT_REACHED_DEFAULT_CASE);
    24182422    }
    24192423
     
    24392443        case GMMACCOUNT_SHADOW: pGVM->gmm.s.Allocated.cShadowPages += cPages; break;
    24402444        case GMMACCOUNT_FIXED:  pGVM->gmm.s.Allocated.cFixedPages  += cPages; break;
    2441         default:                AssertMsgFailedReturn(("enmAccount=%d\n", enmAccount), VERR_INTERNAL_ERROR);
     2445        default:                AssertMsgFailedReturn(("enmAccount=%d\n", enmAccount), VERR_IPE_NOT_REACHED_DEFAULT_CASE);
    24422446    }
    24432447    pGVM->gmm.s.cPrivatePages += cPages;
     
    24512455    {
    24522456        iPage = gmmR0AllocatePagesInBoundMode(pGVM, iPage, cPages, paPages);
    2453         AssertReleaseReturn(iPage == cPages, VERR_INTERNAL_ERROR_3);
     2457        AssertReleaseReturn(iPage == cPages, VERR_GMM_ALLOC_PAGES_IPE);
    24542458        return VINF_SUCCESS;
    24552459    }
     
    25282532            case GMMACCOUNT_SHADOW: pGVM->gmm.s.Allocated.cShadowPages -= cPages; break;
    25292533            case GMMACCOUNT_FIXED:  pGVM->gmm.s.Allocated.cFixedPages  -= cPages; break;
    2530             default:                AssertMsgFailedReturn(("enmAccount=%d\n", enmAccount), VERR_INTERNAL_ERROR);
     2534            default:                AssertMsgFailedReturn(("enmAccount=%d\n", enmAccount), VERR_IPE_NOT_REACHED_DEFAULT_CASE);
    25312535        }
    25322536
     
    25992603     */
    26002604    PGMM pGMM;
    2601     GMM_GET_VALID_INSTANCE(pGMM, VERR_INTERNAL_ERROR);
     2605    GMM_GET_VALID_INSTANCE(pGMM, VERR_GMM_INSTANCE);
    26022606    PGVM pGVM;
    26032607    int rc = GVMMR0ByVMAndEMT(pVM, idCpu, &pGVM);
     
    27552759    }
    27562760    else
    2757         rc = VERR_INTERNAL_ERROR_5;
     2761        rc = VERR_GMM_IS_NOT_SANE;
    27582762    gmmR0MutexRelease(pGMM);
    27592763    LogFlow(("GMMR0AllocateHandyPages: returns %Rrc\n", rc));
     
    27932797     */
    27942798    PGMM pGMM;
    2795     GMM_GET_VALID_INSTANCE(pGMM, VERR_INTERNAL_ERROR);
     2799    GMM_GET_VALID_INSTANCE(pGMM, VERR_GMM_INSTANCE);
    27962800    PGVM pGVM;
    27972801    int rc = GVMMR0ByVMAndEMT(pVM, idCpu, &pGVM);
     
    28302834    }
    28312835    else
    2832         rc = VERR_INTERNAL_ERROR_5;
     2836        rc = VERR_GMM_IS_NOT_SANE;
    28332837    gmmR0MutexRelease(pGMM);
    28342838    LogFlow(("GMMR0AllocatePages: returns %Rrc\n", rc));
     
    28922896     */
    28932897    PGMM pGMM;
    2894     GMM_GET_VALID_INSTANCE(pGMM, VERR_INTERNAL_ERROR);
     2898    GMM_GET_VALID_INSTANCE(pGMM, VERR_GMM_INSTANCE);
    28952899    PGVM pGVM;
    28962900    int rc = GVMMR0ByVMAndEMT(pVM, idCpu, &pGVM);
     
    29692973    {
    29702974        gmmR0MutexRelease(pGMM);
    2971         rc = VERR_INTERNAL_ERROR_5;
     2975        rc = VERR_GMM_IS_NOT_SANE;
    29722976    }
    29732977
     
    29932997     */
    29942998    PGMM pGMM;
    2995     GMM_GET_VALID_INSTANCE(pGMM, VERR_INTERNAL_ERROR);
     2999    GMM_GET_VALID_INSTANCE(pGMM, VERR_GMM_INSTANCE);
    29963000    PGVM pGVM;
    29973001    int rc = GVMMR0ByVMAndEMT(pVM, idCpu, &pGVM);
     
    30363040    }
    30373041    else
    3038         rc = VERR_INTERNAL_ERROR_5;
     3042        rc = VERR_GMM_IS_NOT_SANE;
    30393043
    30403044    gmmR0MutexRelease(pGMM);
     
    33103314            break;
    33113315        default:
    3312             AssertMsgFailedReturn(("enmAccount=%d\n", enmAccount), VERR_INTERNAL_ERROR);
     3316            AssertMsgFailedReturn(("enmAccount=%d\n", enmAccount), VERR_IPE_NOT_REACHED_DEFAULT_CASE);
    33133317    }
    33143318
     
    33813385        case GMMACCOUNT_FIXED:  pGVM->gmm.s.Allocated.cFixedPages  -= iPage; break;
    33823386        default:
    3383             AssertMsgFailedReturn(("enmAccount=%d\n", enmAccount), VERR_INTERNAL_ERROR);
     3387            AssertMsgFailedReturn(("enmAccount=%d\n", enmAccount), VERR_IPE_NOT_REACHED_DEFAULT_CASE);
    33843388    }
    33853389
     
    34153419     */
    34163420    PGMM pGMM;
    3417     GMM_GET_VALID_INSTANCE(pGMM, VERR_INTERNAL_ERROR);
     3421    GMM_GET_VALID_INSTANCE(pGMM, VERR_GMM_INSTANCE);
    34183422    PGVM pGVM;
    34193423    int rc = GVMMR0ByVMAndEMT(pVM, idCpu, &pGVM);
     
    34403444    }
    34413445    else
    3442         rc = VERR_INTERNAL_ERROR_5;
     3446        rc = VERR_GMM_IS_NOT_SANE;
    34433447    gmmR0MutexRelease(pGMM);
    34443448    LogFlow(("GMMR0FreePages: returns %Rrc\n", rc));
     
    35073511     */
    35083512    PGMM pGMM;
    3509     GMM_GET_VALID_INSTANCE(pGMM, VERR_INTERNAL_ERROR);
     3513    GMM_GET_VALID_INSTANCE(pGMM, VERR_GMM_INSTANCE);
    35103514    PGVM pGVM;
    35113515    int rc = GVMMR0ByVMAndEMT(pVM, idCpu, &pGVM);
     
    36063610    }
    36073611    else
    3608         rc = VERR_INTERNAL_ERROR_5;
     3612        rc = VERR_GMM_IS_NOT_SANE;
    36093613
    36103614    gmmR0MutexRelease(pGMM);
     
    36583662     */
    36593663    PGMM pGMM;
    3660     GMM_GET_VALID_INSTANCE(pGMM, VERR_INTERNAL_ERROR);
     3664    GMM_GET_VALID_INSTANCE(pGMM, VERR_GMM_INSTANCE);
    36613665    pReq->cAllocPages     = pGMM->cAllocatedPages;
    36623666    pReq->cFreePages      = (pGMM->cChunks << (GMM_CHUNK_SHIFT- PAGE_SHIFT)) - pGMM->cAllocatedPages;
     
    36923696     */
    36933697    PGMM pGMM;
    3694     GMM_GET_VALID_INSTANCE(pGMM, VERR_INTERNAL_ERROR);
     3698    GMM_GET_VALID_INSTANCE(pGMM, VERR_GMM_INSTANCE);
    36953699    PGVM pGVM;
    36963700    int rc = GVMMR0ByVMAndEMT(pVM, idCpu, &pGVM);
     
    37103714    }
    37113715    else
    3712         rc = VERR_INTERNAL_ERROR_5;
     3716        rc = VERR_GMM_IS_NOT_SANE;
    37133717
    37143718    gmmR0MutexRelease(pGMM);
     
    39773981     */
    39783982    PGMM pGMM;
    3979     GMM_GET_VALID_INSTANCE(pGMM, VERR_INTERNAL_ERROR);
     3983    GMM_GET_VALID_INSTANCE(pGMM, VERR_GMM_INSTANCE);
    39803984    PGVM pGVM;
    39813985    int rc = GVMMR0ByVM(pVM, &pGVM);
     
    40424046    }
    40434047    else
    4044         rc = VERR_INTERNAL_ERROR_5;
     4048        rc = VERR_GMM_IS_NOT_SANE;
    40454049    gmmR0MutexRelease(pGMM);
    40464050
     
    40874091     */
    40884092    PGMM pGMM;
    4089     GMM_GET_VALID_INSTANCE(pGMM, VERR_INTERNAL_ERROR);
     4093    GMM_GET_VALID_INSTANCE(pGMM, VERR_GMM_INSTANCE);
    40904094    PGVM pGVM;
    40914095    int rc = GVMMR0ByVMAndEMT(pVM, idCpu, &pGVM);
     
    41744178     */
    41754179    PGMM pGMM;
    4176     GMM_GET_VALID_INSTANCE(pGMM, VERR_INTERNAL_ERROR);
     4180    GMM_GET_VALID_INSTANCE(pGMM, VERR_GMM_INSTANCE);
    41774181    PGVM pGVM;
    41784182    int rc = GVMMR0ByVMAndEMT(pVM, idCpu, &pGVM);
     
    43224326    }
    43234327    else
    4324         rc = VERR_INTERNAL_ERROR_5;
     4328        rc = VERR_GMM_IS_NOT_SANE;
    43254329
    43264330end:
     
    43784382     */
    43794383    PGMM pGMM;
    4380     GMM_GET_VALID_INSTANCE(pGMM, VERR_INTERNAL_ERROR);
     4384    GMM_GET_VALID_INSTANCE(pGMM, VERR_GMM_INSTANCE);
    43814385    PGVM pGVM;
    43824386    int rc = GVMMR0ByVMAndEMT(pVM, idCpu, &pGVM);
     
    44434447    }
    44444448    else
    4445         rc = VERR_INTERNAL_ERROR_5;
     4449        rc = VERR_GMM_IS_NOT_SANE;
    44464450
    44474451    gmmR0MutexRelease(pGMM);
     
    45534557    int rc = VINF_SUCCESS;
    45544558    PGMM pGMM;
    4555     GMM_GET_VALID_INSTANCE(pGMM, VERR_INTERNAL_ERROR);
     4559    GMM_GET_VALID_INSTANCE(pGMM, VERR_GMM_INSTANCE);
    45564560    unsigned cPages = pModule->aRegions[idxRegion].cbRegion >> PAGE_SHIFT;
    45574561
     
    47014705 * RTAvlGCPtrDestroy callback.
    47024706 *
    4703  * @returns 0 or VERR_INTERNAL_ERROR.
     4707 * @returns 0 or VERR_GMM_INSTANCE.
    47044708 * @param   pNode   The node to destroy.
    47054709 * @param   pvGVM   The GVM handle.
     
    47274731            /* Remove from the tree and free memory. */
    47284732            PGMM pGMM;
    4729             GMM_GET_VALID_INSTANCE(pGMM, VERR_INTERNAL_ERROR);
     4733            GMM_GET_VALID_INSTANCE(pGMM, VERR_GMM_INSTANCE);
    47304734            RTAvlGCPtrRemove(&pGMM->pGlobalSharedModuleTree, pRec->Core.Key);
    47314735            RTMemFree(pRec);
     
    47724776     */
    47734777    PGMM pGMM;
    4774     GMM_GET_VALID_INSTANCE(pGMM, VERR_INTERNAL_ERROR);
     4778    GMM_GET_VALID_INSTANCE(pGMM, VERR_GMM_INSTANCE);
    47754779    PGVM pGVM;
    47764780    int rc = GVMMR0ByVMAndEMT(pVM, idCpu, &pGVM);
     
    47914795    }
    47924796    else
    4793         rc = VERR_INTERNAL_ERROR_5;
     4797        rc = VERR_GMM_IS_NOT_SANE;
    47944798
    47954799    gmmR0MutexRelease(pGMM);
     
    48454849     */
    48464850    PGMM pGMM;
    4847     GMM_GET_VALID_INSTANCE(pGMM, VERR_INTERNAL_ERROR);
     4851    GMM_GET_VALID_INSTANCE(pGMM, VERR_GMM_INSTANCE);
    48484852
    48494853    /*
     
    48524856    gmmR0MutexAcquire(pGMM);
    48534857    if (!GMM_CHECK_SANITY_UPON_ENTERING(pGMM))
    4854         rc = VERR_INTERNAL_ERROR_5;
     4858        rc = VERR_GMM_IS_NOT_SANE;
    48554859    else
    48564860        rc = VINF_SUCCESS;
     
    48714875     */
    48724876    PGMM pGMM;
    4873     GMM_GET_VALID_INSTANCE(pGMM, VERR_INTERNAL_ERROR);
     4877    GMM_GET_VALID_INSTANCE(pGMM, VERR_GMM_INSTANCE);
    48744878
    48754879    gmmR0MutexRelease(pGMM);
     
    48934897     */
    48944898    PGMM pGMM;
    4895     GMM_GET_VALID_INSTANCE(pGMM, VERR_INTERNAL_ERROR);
     4899    GMM_GET_VALID_INSTANCE(pGMM, VERR_GMM_INSTANCE);
    48964900    PGVM pGVM;
    48974901    int rc = GVMMR0ByVMAndEMT(pVM, pVCpu->idCpu, &pGVM);
     
    49234927    }
    49244928    else
    4925         rc = VERR_INTERNAL_ERROR_5;
     4929        rc = VERR_GMM_IS_NOT_SANE;
    49264930
    49274931# ifndef DEBUG_sandervl
     
    50075011
    50085012    PGMM pGMM;
    5009     GMM_GET_VALID_INSTANCE(pGMM, VERR_INTERNAL_ERROR);
     5013    GMM_GET_VALID_INSTANCE(pGMM, VERR_GMM_INSTANCE);
    50105014
    50115015    PGVM pGVM;
     
    50525056    }
    50535057    else
    5054         rc = VERR_INTERNAL_ERROR_5;
     5058        rc = VERR_GMM_IS_NOT_SANE;
    50555059
    50565060    gmmR0MutexRelease(pGMM);
  • trunk/src/VBox/VMM/VMMR0/GVMMR0.cpp

    r39303 r39402  
    272272 *
    273273 * @param   pGVMM   The name of the pGVMM variable.
    274  * @param   rc      The return value on failure. Use VERR_INTERNAL_ERROR for
    275  *                  VBox status codes.
     274 * @param   rc      The return value on failure. Use VERR_GVMM_INSTANCE for VBox
     275 *                  status codes.
    276276 */
    277277#define GVMM_GET_VALID_INSTANCE(pGVMM, rc) \
     
    322322     */
    323323    uint32_t cHostCpus = RTMpGetArraySize();
    324     AssertMsgReturn(cHostCpus > 0 && cHostCpus < _64K, ("%d", (int)cHostCpus), VERR_INTERNAL_ERROR_2);
     324    AssertMsgReturn(cHostCpus > 0 && cHostCpus < _64K, ("%d", (int)cHostCpus), VERR_GVMM_HOST_CPU_RANGE);
    325325
    326326    PGVMM pGVMM = (PGVMM)RTMemAllocZ(RT_UOFFSETOF(GVMM, aHostCpus[cHostCpus]));
     
    535535     */
    536536    PGVMM pGVMM;
    537     GVMM_GET_VALID_INSTANCE(pGVMM, VERR_INTERNAL_ERROR);
     537    GVMM_GET_VALID_INSTANCE(pGVMM, VERR_GVMM_INSTANCE);
    538538    AssertPtrReturn(pSession, VERR_INVALID_HANDLE);
    539539    AssertPtrReturn(pszName, VERR_INVALID_POINTER);
     
    602602     */
    603603    PGVMM pGVMM;
    604     GVMM_GET_VALID_INSTANCE(pGVMM, VERR_INTERNAL_ERROR);
     604    GVMM_GET_VALID_INSTANCE(pGVMM, VERR_GVMM_INSTANCE);
    605605    AssertPtrReturn(pSession, VERR_INVALID_HANDLE);
    606606    AssertPtrReturn(pszName, VERR_INVALID_POINTER);
     
    740740    LogFlow(("GVMMR0CreateVM: pSession=%p\n", pSession));
    741741    PGVMM pGVMM;
    742     GVMM_GET_VALID_INSTANCE(pGVMM, VERR_INTERNAL_ERROR);
     742    GVMM_GET_VALID_INSTANCE(pGVMM, VERR_GVMM_INSTANCE);
    743743
    744744    AssertPtrReturn(ppVM, VERR_INVALID_POINTER);
     
    750750
    751751    RTNATIVETHREAD hEMT0 = RTThreadNativeSelf();
    752     AssertReturn(hEMT0 != NIL_RTNATIVETHREAD, VERR_INTERNAL_ERROR);
     752    AssertReturn(hEMT0 != NIL_RTNATIVETHREAD, VERR_GVMM_BROKEN_IPRT);
    753753    RTNATIVETHREAD ProcId = RTProcSelf();
    754     AssertReturn(ProcId != NIL_RTPROCESS, VERR_INTERNAL_ERROR);
     754    AssertReturn(ProcId != NIL_RTPROCESS, VERR_GVMM_BROKEN_IPRT);
    755755
    756756    /*
     
    927927        }
    928928        else
    929             rc = VERR_INTERNAL_ERROR;
     929            rc = VERR_GVMM_IPE_1;
    930930    }
    931931    else
     
    10661066    LogFlow(("GVMMR0DestroyVM: pVM=%p\n", pVM));
    10671067    PGVMM pGVMM;
    1068     GVMM_GET_VALID_INSTANCE(pGVMM, VERR_INTERNAL_ERROR);
     1068    GVMM_GET_VALID_INSTANCE(pGVMM, VERR_GVMM_INSTANCE);
    10691069
    10701070
     
    11181118                    pHandle, pHandle->pVM, pHandle->hEMT0, pHandle->ProcId, pHandle->pvObj, pVM, hSelf);
    11191119        gvmmR0CreateDestroyUnlock(pGVMM);
    1120         rc = VERR_INTERNAL_ERROR;
     1120        rc = VERR_GVMM_IPE_2;
    11211121    }
    11221122
     
    13911391    RTPROCESS ProcId = RTProcSelf();
    13921392    PGVMM pGVMM;
    1393     GVMM_GET_VALID_INSTANCE(pGVMM, VERR_INTERNAL_ERROR);
     1393    GVMM_GET_VALID_INSTANCE(pGVMM, VERR_GVMM_INSTANCE);
    13941394
    13951395    /*
     
    14841484{
    14851485    PGVMM pGVMM;
    1486     GVMM_GET_VALID_INSTANCE(pGVMM, VERR_INTERNAL_ERROR);
     1486    GVMM_GET_VALID_INSTANCE(pGVMM, VERR_GVMM_INSTANCE);
    14871487
    14881488    /*
     
    15031503    RTPROCESS ProcId = RTProcSelf();
    15041504    AssertReturn(pHandle->ProcId == ProcId, VERR_NOT_OWNER);
    1505     AssertPtrReturn(pHandle->pvObj, VERR_INTERNAL_ERROR);
     1505    AssertPtrReturn(pHandle->pvObj, VERR_NOT_OWNER);
    15061506
    15071507    PGVM pGVM = pHandle->pGVM;
    1508     AssertPtrReturn(pGVM, VERR_INTERNAL_ERROR);
    1509     AssertReturn(pGVM->pVM == pVM, VERR_INTERNAL_ERROR);
     1508    AssertPtrReturn(pGVM, VERR_NOT_OWNER);
     1509    AssertReturn(pGVM->pVM == pVM, VERR_NOT_OWNER);
    15101510    RTNATIVETHREAD hAllegedEMT = RTThreadNativeSelf();
    15111511    AssertReturn(idCpu < pGVM->cCpus, VERR_INVALID_CPU_ID);
    1512     AssertReturn(pGVM->aCpus[idCpu].hEMT == hAllegedEMT, VERR_INTERNAL_ERROR);
     1512    AssertReturn(pGVM->aCpus[idCpu].hEMT == hAllegedEMT, VERR_NOT_OWNER);
    15131513
    15141514    *ppGVM = pGVM;
     
    23522352    else
    23532353    {
    2354         GVMM_GET_VALID_INSTANCE(pGVMM, VERR_INTERNAL_ERROR);
     2354        GVMM_GET_VALID_INSTANCE(pGVMM, VERR_GVMM_INSTANCE);
    23552355        memset(&pStats->SchedVM, 0, sizeof(pStats->SchedVM));
    23562356
     
    25012501    else
    25022502    {
    2503         GVMM_GET_VALID_INSTANCE(pGVMM, VERR_INTERNAL_ERROR);
     2503        GVMM_GET_VALID_INSTANCE(pGVMM, VERR_GVMM_INSTANCE);
    25042504
    25052505        int rc = gvmmR0UsedLock(pGVMM);
  • trunk/src/VBox/VMM/VMMR0/HWACCMR0.cpp

    r39078 r39402  
    926926     *       notification.  Kind of unlikely though, so ignored for now.
    927927     */
    928     AssertReturn(!g_HvmR0.fEnabled, VERR_INTERNAL_ERROR_3);
     928    AssertReturn(!g_HvmR0.fEnabled, VERR_HM_ALREADY_ENABLED_IPE);
    929929    ASMAtomicWriteBool(&g_HvmR0.fEnabled, true);
    930930
  • trunk/src/VBox/VMM/VMMR0/HWSVMR0.cpp

    r39078 r39402  
    280280        SVM_VMCB *pVMCB = (SVM_VMCB *)pVM->aCpus[i].hwaccm.s.svm.pVMCB;
    281281
    282         AssertMsgReturn(pVMCB, ("Invalid pVMCB\n"), VERR_EM_INTERNAL_ERROR);
     282        AssertMsgReturn(pVMCB, ("Invalid pVMCB\n"), VERR_HMSVM_INVALID_PVMCB);
    283283
    284284        /* Program the control fields. Most of them never have to be changed again. */
     
    661661
    662662    pVMCB = (SVM_VMCB *)pVCpu->hwaccm.s.svm.pVMCB;
    663     AssertMsgReturn(pVMCB, ("Invalid pVMCB\n"), VERR_EM_INTERNAL_ERROR);
     663    AssertMsgReturn(pVMCB, ("Invalid pVMCB\n"), VERR_HMSVM_INVALID_PVMCB);
    664664
    665665    /* Guest CPU context: ES, CS, SS, DS, FS, GS. */
     
    979979
    980980    pVMCB = (SVM_VMCB *)pVCpu->hwaccm.s.svm.pVMCB;
    981     AssertMsgReturn(pVMCB, ("Invalid pVMCB\n"), VERR_EM_INTERNAL_ERROR);
     981    AssertMsgReturn(pVMCB, ("Invalid pVMCB\n"), VERR_HMSVM_INVALID_PVMCB);
    982982
    983983    /* We can jump to this point to resume execution after determining that a VM-exit is innocent.
     
    18501850        default:
    18511851            AssertMsgFailed(("Unexpected vm-exit caused by exception %x\n", vector));
    1852             rc = VERR_EM_INTERNAL_ERROR;
     1852            rc = VERR_HMSVM_UNEXPECTED_XCPT_EXIT;
    18531853            break;
    18541854
     
    25162516    default:
    25172517        /* Unexpected exit codes. */
    2518         rc = VERR_EM_INTERNAL_ERROR;
     2518        rc = VERR_HMSVM_UNEXPECTED_EXIT;
    25192519        AssertMsgFailed(("Unexpected exit code %x\n", exitCode));                 /* Can't happen. */
    25202520        break;
     
    26202620            break;
    26212621        default:
    2622             AssertMsgFailedReturn(("Unexpected type %d\n", pPatch->enmType), VERR_INTERNAL_ERROR);
     2622            AssertMsgFailedReturn(("Unexpected type %d\n", pPatch->enmType), VERR_HMSVM_UNEXPECTED_PATCH_TYPE);
    26232623        }
    26242624    }
     
    27932793
    27942794        pVMCB = (SVM_VMCB *)pVCpu->hwaccm.s.svm.pVMCB;
    2795         AssertMsgReturn(pVMCB, ("Invalid pVMCB\n"), VERR_EM_INTERNAL_ERROR);
     2795        AssertMsgReturn(pVMCB, ("Invalid pVMCB\n"), VERR_HMSVM_INVALID_PVMCB);
    27962796
    27972797#if HC_ARCH_BITS == 32
  • trunk/src/VBox/VMM/VMMR0/HWVMXR0.cpp

    r39078 r39402  
    21382138        default:
    21392139            AssertFailed();
    2140             return VERR_INTERNAL_ERROR;
     2140            return VERR_HM_UNEXPECTED_LD_ST_MSR;
    21412141        }
    21422142    }
     
    48174817    RTHCUINTREG     uOldEFlags;
    48184818
    4819     AssertReturn(pVM->hwaccm.s.pfnHost32ToGuest64R0, VERR_INTERNAL_ERROR);
     4819    AssertReturn(pVM->hwaccm.s.pfnHost32ToGuest64R0, VERR_HM_NO_32_TO_64_SWITCHER);
    48204820    Assert(pfnHandler);
    48214821    Assert(pVCpu->hwaccm.s.vmx.VMCSCache.Write.cValidEntries <= RT_ELEMENTS(pVCpu->hwaccm.s.vmx.VMCSCache.Write.aField));
  • trunk/src/VBox/VMM/VMMR0/PGMR0.cpp

    r39078 r39402  
    8080     */
    8181    uint32_t iFirst = pVM->pgm.s.cHandyPages;
    82     AssertReturn(iFirst <= RT_ELEMENTS(pVM->pgm.s.aHandyPages), VERR_INTERNAL_ERROR);
     82    AssertReturn(iFirst <= RT_ELEMENTS(pVM->pgm.s.aHandyPages), VERR_PGM_HANDY_PAGE_IPE);
    8383    uint32_t cPages = RT_ELEMENTS(pVM->pgm.s.aHandyPages) - iFirst;
    8484    if (!cPages)
     
    589589#else
    590590    AssertLogRelFailed();
    591     return VERR_INTERNAL_ERROR_4;
    592 #endif
    593 }
    594 
     591    return VERR_PGM_NOT_USED_IN_MODE;
     592#endif
     593}
     594
  • trunk/src/VBox/VMM/VMMR0/VMMR0JmpA-amd64.asm

    r37227 r39402  
    2121%include "VBox/asmdefs.mac"
    2222%include "VMMInternal.mac"
    23 %include "iprt/err.mac"
     23%include "VBox/err.mac"
    2424%include "VBox/param.mac"
    2525
     
    173173
    174174.entry_error:
    175     mov     eax, VERR_INTERNAL_ERROR_2
     175    mov     eax, VERR_VMM_SET_JMP_ERROR
    176176    jmp     .proper_return
    177177
    178178.stack_overflow:
    179     mov     eax, VERR_INTERNAL_ERROR_5
     179    mov     eax, VERR_VMM_SET_JMP_STACK_OVERFLOW
    180180    jmp     .proper_return
    181181
     
    195195    mov     r14, [xDX + VMMR0JMPBUF.r14]
    196196    mov     r15, [xDX + VMMR0JMPBUF.r15]
    197     mov     eax, VERR_INTERNAL_ERROR_3    ; todo better return code!
     197    mov     eax, VERR_VMM_SET_JMP_ABORTED_RESUME
    198198    leave
    199199    ret
     
    413413.magic_ok:
    414414%endif
    415     mov     eax, VERR_INTERNAL_ERROR_4
     415    mov     eax, VERR_VMM_LONG_JMP_ERROR
    416416%ifdef RT_OS_WINDOWS
    417417    add     rsp, 0a0h                   ; skip XMM registers since they are unmodified.
  • trunk/src/VBox/VMM/VMMR0/VMMR0JmpA-x86.asm

    r35334 r39402  
    179179
    180180.entry_error:
    181     mov     eax, VERR_INTERNAL_ERROR_2
     181    mov     eax, VERR_VMM_SET_JMP_ERROR
    182182    jmp     .proper_return
    183183
    184184.stack_overflow:
    185     mov     eax, VERR_INTERNAL_ERROR_5
     185    mov     eax, VERR_VMM_SET_JMP_STACK_OVERFLOW
    186186    mov     edx, ebx
    187187    jmp     .proper_return
    188188
    189189.stack_overflow_almost:
    190     mov     eax, VERR_INTERNAL_ERROR
     190    mov     eax, VERR_VMM_SET_JMP_STACK_OVERFLOW
    191191    mov     edx, ebx
    192192    jmp     .proper_return
     
    200200    mov     esi, [xDX + VMMR0JMPBUF.esi]
    201201    mov     ebx, [xDX + VMMR0JMPBUF.ebx]
    202     mov     eax, VERR_INTERNAL_ERROR_3    ; todo better return code!
     202    mov     eax, VERR_VMM_SET_JMP_ABORTED_RESUME
    203203    ret
    204204
     
    373373    pop     esi
    374374    pop     edi
    375     mov     eax, VERR_INTERNAL_ERROR_4
     375    mov     eax, VERR_VMM_LONG_JMP_ERROR
    376376    leave
    377377    ret
Note: See TracChangeset for help on using the changeset viewer.

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