VirtualBox

Changeset 13833 in vbox for trunk/src/VBox/VMM/PATM


Ignore:
Timestamp:
Nov 5, 2008 2:15:04 AM (16 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
38824
Message:

VMM,DIS: some left over VBOX_SUCCESS/FAILURE conversions.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/VMM/PATM/PATM.cpp

    r13830 r13833  
    120120    /** @todo bad safety precaution */
    121121    rc = MMR3HyperAllocOnceNoRel(pVM, PATCH_MEMORY_SIZE + PAGE_SIZE + PATM_STACK_TOTAL_SIZE + PAGE_SIZE + PATM_STAT_MEMSIZE, PAGE_SIZE, MM_TAG_PATM, (void **)&pVM->patm.s.pPatchMemHC);
    122     if (VBOX_FAILURE(rc))
     122    if (RT_FAILURE(rc))
    123123    {
    124124        Log(("MMR3HyperAlloc failed with %Vrc\n", rc));
     
    154154    /* Check CFGM option. */
    155155    rc = CFGMR3QueryBool(CFGMR3GetRoot(pVM), "PATMEnabled", &pVM->fPATMEnabled);
    156     if (VBOX_FAILURE(rc))
     156    if (RT_FAILURE(rc))
    157157# ifdef PATM_DISABLE_ALL
    158158        pVM->fPATMEnabled = false;
     
    164164    rc = patmReinit(pVM);
    165165    AssertRC(rc);
    166     if (VBOX_FAILURE(rc))
     166    if (RT_FAILURE(rc))
    167167        return rc;
    168168
     
    173173                               NULL, patmr3Save, NULL,
    174174                               NULL, patmr3Load, NULL);
    175     if (VBOX_FAILURE(rc))
     175    if (RT_FAILURE(rc))
    176176    {
    177177        AssertRC(rc);
     
    187187    {
    188188        int rc = DBGCRegisterCommands(&g_aCmds[0], RT_ELEMENTS(g_aCmds));
    189         if (VBOX_SUCCESS(rc))
     189        if (RT_SUCCESS(rc))
    190190            fRegisteredCmds = true;
    191191    }
     
    283283    /* The GC state, stack and statistics must be read/write for the guest (supervisor only of course). */
    284284    int rc = PGMMapSetPage(pVM, pVM->patm.s.pGCStateGC, PAGE_SIZE, X86_PTE_P | X86_PTE_A | X86_PTE_D | X86_PTE_RW);
    285     if (VBOX_FAILURE(rc))
     285    if (RT_FAILURE(rc))
    286286        Log(("PATMR3InitFinalize: PGMMapSetPage failed with %Vrc!!\n", rc));
    287287
    288288    rc = PGMMapSetPage(pVM, pVM->patm.s.pGCStackGC, PATM_STACK_TOTAL_SIZE, X86_PTE_P | X86_PTE_A | X86_PTE_D | X86_PTE_RW);
    289     if (VBOX_FAILURE(rc))
     289    if (RT_FAILURE(rc))
    290290        Log(("PATMR3InitFinalize: PGMMapSetPage failed with %Vrc!!\n", rc));
    291291
    292292    rc = PGMMapSetPage(pVM, pVM->patm.s.pStatsGC, PATM_STAT_MEMSIZE, X86_PTE_P | X86_PTE_A | X86_PTE_D | X86_PTE_RW);
    293     if (VBOX_FAILURE(rc))
     293    if (RT_FAILURE(rc))
    294294        Log(("PATMR3InitFinalize: PGMMapSetPage failed with %Vrc!!\n", rc));
    295295
     
    381381    /* We generate a fake patch in order to use the existing code for relocation. */
    382382    rc = MMHyperAlloc(pVM, sizeof(PATMPATCHREC), 0, MM_TAG_PATM_PATCH, (void **)&pVM->patm.s.pGlobalPatchRec);
    383     if (VBOX_FAILURE(rc))
     383    if (RT_FAILURE(rc))
    384384    {
    385385        Log(("Out of memory!!!!\n"));
     
    499499
    500500    int rc = patmReinit(pVM);
    501     if (VBOX_SUCCESS(rc))
     501    if (RT_SUCCESS(rc))
    502502        rc = PATMR3InitFinalize(pVM); /* paranoia */
    503503
     
    535535        {
    536536            int rc = PATMR3QueryOpcode(pDisInfo->pVM, (RTRCPTR)pSrc, pDest);
    537             if (VBOX_SUCCESS(rc))
     537            if (RT_SUCCESS(rc))
    538538            {
    539539                pSrc++;
     
    653653
    654654                rc = PGMPhysSimpleReadGCPtr(pVM, curInstr, pPatch->patch.pPrivInstrGC, pPatch->patch.cbPrivInstr);
    655                 Assert(VBOX_SUCCESS(rc) || rc == VERR_PAGE_NOT_PRESENT || rc == VERR_PAGE_TABLE_NOT_PRESENT);
     655                Assert(RT_SUCCESS(rc) || rc == VERR_PAGE_NOT_PRESENT || rc == VERR_PAGE_TABLE_NOT_PRESENT);
    656656
    657657                pRec->pDest = (RTRCPTR)((RTRCUINTPTR)pRec->pDest + delta);
     
    663663                    Log(("PATM: Patch page not present -> check later!\n"));
    664664                    rc = PGMR3HandlerVirtualRegister(pVM, PGMVIRTHANDLERTYPE_ALL, pPage, pPage + (PAGE_SIZE - 1) /* inclusive! */, 0, patmVirtPageHandler, "PATMGCMonitorPage", 0, "PATMMonitorPatchJump");
    665                     Assert(VBOX_SUCCESS(rc) || rc == VERR_PGM_HANDLER_VIRTUAL_CONFLICT);
     665                    Assert(RT_SUCCESS(rc) || rc == VERR_PGM_HANDLER_VIRTUAL_CONFLICT);
    666666                }
    667667                else
     
    676676                }
    677677                else
    678                 if (VBOX_SUCCESS(rc))
     678                if (RT_SUCCESS(rc))
    679679                {
    680680                    *(RTRCPTR *)&curInstr[pPatch->patch.cbPrivInstr - sizeof(RTRCPTR)] = pRec->pDest;
     
    730730                 */
    731731                rc = PGMPhysSimpleReadGCPtr(pVM, temp, pPatch->patch.pPrivInstrGC, pPatch->patch.cbPatchJump);
    732                 Assert(VBOX_SUCCESS(rc) || rc == VERR_PAGE_NOT_PRESENT || rc == VERR_PAGE_TABLE_NOT_PRESENT);
     732                Assert(RT_SUCCESS(rc) || rc == VERR_PAGE_NOT_PRESENT || rc == VERR_PAGE_TABLE_NOT_PRESENT);
    733733
    734734                if (rc == VERR_PAGE_NOT_PRESENT || rc == VERR_PAGE_TABLE_NOT_PRESENT)
     
    737737
    738738                    rc = PGMR3HandlerVirtualRegister(pVM, PGMVIRTHANDLERTYPE_ALL, pPage, pPage + (PAGE_SIZE - 1) /* inclusive! */, 0, patmVirtPageHandler, "PATMGCMonitorPage", 0, "PATMMonitorPatchJump");
    739                     Assert(VBOX_SUCCESS(rc) || rc == VERR_PGM_HANDLER_VIRTUAL_CONFLICT);
     739                    Assert(RT_SUCCESS(rc) || rc == VERR_PGM_HANDLER_VIRTUAL_CONFLICT);
    740740                }
    741741                else
     
    750750                }
    751751                else
    752                 if (VBOX_SUCCESS(rc))
     752                if (RT_SUCCESS(rc))
    753753                {
    754754                    rc = PGMPhysSimpleDirtyWriteGCPtr(pVM, pJumpOffGC, &displ, sizeof(displ));
     
    10561056                    rc = VERR_PATCHING_REFUSED;    /* exists as a normal patch; can't use it */
    10571057
    1058                 if (VBOX_FAILURE(rc))
     1058                if (RT_FAILURE(rc))
    10591059                {
    10601060                    uint8_t *pPatchHC;
     
    15801580        rc = patmAnalyseBlockCallback(pVM, pCpu, pInstrGC, pCurInstrGC, pUserData);
    15811581
    1582     if (VBOX_FAILURE(rc))
     1582    if (RT_FAILURE(rc))
    15831583        return rc;
    15841584
     
    16251625            Assert(!PATMIsPatchGCAddr(pVM, pTargetGC));
    16261626            rc = patmPatchGenCall(pVM, pPatch, pCpu, pCurInstrGC, pTargetGC, false);
    1627             if (VBOX_FAILURE(rc))
     1627            if (RT_FAILURE(rc))
    16281628                goto end;
    16291629        }
     
    16311631            rc = patmPatchGenRelJump(pVM, pPatch, pTargetGC, pCpu->pCurInstr->opcode, !!(pCpu->prefix & PREFIX_OPSIZE));
    16321632
    1633         if (VBOX_SUCCESS(rc))
     1633        if (RT_SUCCESS(rc))
    16341634            rc = VWRN_CONTINUE_RECOMPILE;
    16351635
     
    16551655
    16561656        rc = patmPatchGenCli(pVM, pPatch);
    1657         if (VBOX_SUCCESS(rc))
     1657        if (RT_SUCCESS(rc))
    16581658            rc = VWRN_CONTINUE_RECOMPILE;
    16591659        break;
     
    16791679                /* mov GPR, ss */
    16801680                rc = patmPatchGenMovFromSS(pVM, pPatch, pCpu, pCurInstrGC);
    1681                 if (VBOX_SUCCESS(rc))
     1681                if (RT_SUCCESS(rc))
    16821682                    rc = VWRN_CONTINUE_RECOMPILE;
    16831683                break;
     
    17111711        rc = patmPatchGenSti(pVM, pPatch, pCurInstrGC, pNextInstrGC);
    17121712
    1713         if (VBOX_SUCCESS(rc))
     1713        if (RT_SUCCESS(rc))
    17141714        {
    17151715            DISCPUSTATE cpu = *pCpu;
     
    17451745                /* Not an exit point for function duplication patches */
    17461746                if (    (pPatch->flags & PATMFL_DUPLICATE_FUNCTION)
    1747                     &&  VBOX_SUCCESS(rc))
     1747                    &&  RT_SUCCESS(rc))
    17481748                {
    17491749                    pPatch->flags &= ~PATMFL_GENERATE_JUMPTOGUEST;  /* Don't generate a jump back */
     
    17711771
    17721772        rc = patmPatchGenPopf(pVM, pPatch, pCurInstrGC + pCpu->opsize, !!(pCpu->prefix & PREFIX_OPSIZE), fGenerateJmpBack);
    1773         if (VBOX_SUCCESS(rc))
     1773        if (RT_SUCCESS(rc))
    17741774        {
    17751775            if (fGenerateJmpBack == false)
     
    17891789    case OP_PUSHF:
    17901790        rc = patmPatchGenPushf(pVM, pPatch, !!(pCpu->prefix & PREFIX_OPSIZE));
    1791         if (VBOX_SUCCESS(rc))
     1791        if (RT_SUCCESS(rc))
    17921792            rc = VWRN_CONTINUE_RECOMPILE;
    17931793        break;
     
    17971797        {
    17981798            rc = patmPatchGenPushCS(pVM, pPatch);
    1799             if (VBOX_SUCCESS(rc))
     1799            if (RT_SUCCESS(rc))
    18001800                rc = VWRN_CONTINUE_RECOMPILE;
    18011801            break;
     
    18061806        Log(("IRET at %VRv\n", pCurInstrGC));
    18071807        rc = patmPatchGenIret(pVM, pPatch, pCurInstrGC, !!(pCpu->prefix & PREFIX_OPSIZE));
    1808         if (VBOX_SUCCESS(rc))
     1808        if (RT_SUCCESS(rc))
    18091809        {
    18101810            pPatch->flags |= PATMFL_FOUND_PATCHEND;
     
    18161816        /* This appears to be some kind of kernel panic in Linux 2.4; no point to continue */
    18171817        rc = patmPatchGenIllegalInstr(pVM, pPatch);
    1818         if (VBOX_SUCCESS(rc))
     1818        if (RT_SUCCESS(rc))
    18191819            rc = VINF_SUCCESS;  /* exit point by definition */
    18201820        Log(("Illegal opcode (0xf 0xb)\n"));
     
    18231823    case OP_CPUID:
    18241824        rc = patmPatchGenCpuid(pVM, pPatch, pCurInstrGC);
    1825         if (VBOX_SUCCESS(rc))
     1825        if (RT_SUCCESS(rc))
    18261826            rc = VWRN_CONTINUE_RECOMPILE;
    18271827        break;
     
    18301830    case OP_SLDT:
    18311831        rc = patmPatchGenSldtStr(pVM, pPatch, pCpu, pCurInstrGC);
    1832         if (VBOX_SUCCESS(rc))
     1832        if (RT_SUCCESS(rc))
    18331833            rc = VWRN_CONTINUE_RECOMPILE;
    18341834        break;
     
    18371837    case OP_SIDT:
    18381838        rc = patmPatchGenSxDT(pVM, pPatch, pCpu, pCurInstrGC);
    1839         if (VBOX_SUCCESS(rc))
     1839        if (RT_SUCCESS(rc))
    18401840            rc = VWRN_CONTINUE_RECOMPILE;
    18411841        break;
     
    18441844        /* retn is an exit point for function patches */
    18451845        rc = patmPatchGenRet(pVM, pPatch, pCpu, pCurInstrGC);
    1846         if (VBOX_SUCCESS(rc))
     1846        if (RT_SUCCESS(rc))
    18471847            rc = VINF_SUCCESS;  /* exit point by definition */
    18481848        break;
     
    18511851        /* Duplicate it, so it can be emulated in GC (or fault). */
    18521852        rc = patmPatchGenDuplicate(pVM, pPatch, pCpu, pCurInstrGC);
    1853         if (VBOX_SUCCESS(rc))
     1853        if (RT_SUCCESS(rc))
    18541854            rc = VINF_SUCCESS;  /* exit point by definition */
    18551855        break;
     
    18641864        {
    18651865            rc = patmPatchGenCall(pVM, pPatch, pCpu, pCurInstrGC, (RTRCPTR)0xDEADBEEF, true);
    1866             if (VBOX_SUCCESS(rc))
     1866            if (RT_SUCCESS(rc))
    18671867            {
    18681868                rc = VWRN_CONTINUE_RECOMPILE;
     
    18811881        {
    18821882            rc = patmPatchGenJump(pVM, pPatch, pCpu, pCurInstrGC);
    1883             if (VBOX_SUCCESS(rc))
     1883            if (RT_SUCCESS(rc))
    18841884                rc = VINF_SUCCESS;  /* end of branch */
    18851885            break;
     
    18971897        {
    18981898            rc = patmPatchGenMovDebug(pVM, pPatch, pCpu);
    1899             if (VBOX_SUCCESS(rc))
     1899            if (RT_SUCCESS(rc))
    19001900                rc = VWRN_CONTINUE_RECOMPILE;
    19011901            break;
     
    19081908        {
    19091909            rc = patmPatchGenMovControl(pVM, pPatch, pCpu);
    1910             if (VBOX_SUCCESS(rc))
     1910            if (RT_SUCCESS(rc))
    19111911                rc = VWRN_CONTINUE_RECOMPILE;
    19121912            break;
     
    19191919gen_illegal_instr:
    19201920            rc = patmPatchGenIllegalInstr(pVM, pPatch);
    1921             if (VBOX_SUCCESS(rc))
     1921            if (RT_SUCCESS(rc))
    19221922                rc = VINF_SUCCESS;  /* exit point by definition */
    19231923        }
     
    19271927            Log(("patmPatchGenDuplicate\n"));
    19281928            rc = patmPatchGenDuplicate(pVM, pPatch, pCpu, pCurInstrGC);
    1929             if (VBOX_SUCCESS(rc))
     1929            if (RT_SUCCESS(rc))
    19301930                rc = VWRN_CONTINUE_RECOMPILE;
    19311931        }
     
    19551955            rc2 = patmPatchGenClearInhibitIRQ(pVM, pPatch, pNextInstrGC);
    19561956        }
    1957         if (VBOX_FAILURE(rc2))
     1957        if (RT_FAILURE(rc2))
    19581958            rc = rc2;
    19591959    }
    19601960
    1961     if (VBOX_SUCCESS(rc))
     1961    if (RT_SUCCESS(rc))
    19621962    {
    19631963        // If single instruction patch, we've copied enough instructions *and* the current instruction is not a relative jump
     
    23552355                {
    23562356                    rc = pfnPATMR3Recompile(pVM, &cpunext, pInstrGC, pNextInstrGC, pUserData);
    2357                     if (VBOX_SUCCESS(rc))
     2357                    if (RT_SUCCESS(rc))
    23582358                    {
    23592359                        rc = VINF_SUCCESS;
     
    23942394                /* First we need to finish this linear code stream until the next exit point. */
    23952395                rc = patmRecompileCodeStream(pVM, pInstrGC, pCurInstrGC+opsize, pfnPATMR3Recompile, pUserData);
    2396                 if (VBOX_FAILURE(rc))
     2396                if (RT_FAILURE(rc))
    23972397                {
    23982398                    Log(("patmRecompileCodeStream fatal error %d\n", rc));
     
    24282428                }
    24292429
    2430                 if (VBOX_FAILURE(rc))
     2430                if (RT_FAILURE(rc))
    24312431                {
    24322432                    Log(("patmRecompileCodeStream fatal error %d\n", rc));
     
    27212721        /* Install fake cli patch (to clear the virtual IF and check int xx parameters) */
    27222722        rc = patmPatchGenIntEntry(pVM, pPatch, pInstrGC);
    2723         if (VBOX_FAILURE(rc))
     2723        if (RT_FAILURE(rc))
    27242724            goto failure;
    27252725    }
     
    27322732    {
    27332733        rc = patmPatchGenStats(pVM, pPatch, pInstrGC);
    2734         if (VBOX_FAILURE(rc))
     2734        if (RT_FAILURE(rc))
    27352735            goto failure;
    27362736    }
     
    28032803        /* Replace first opcode byte with 'int 3'. */
    28042804        rc = patmActivateInt3Patch(pVM, pPatch);
    2805         if (VBOX_FAILURE(rc))
     2805        if (RT_FAILURE(rc))
    28062806            goto failure;
    28072807
     
    28192819        rc = patmGenJumpToPatch(pVM, pPatch, true);
    28202820        AssertRC(rc);
    2821         if (VBOX_FAILURE(rc))
     2821        if (RT_FAILURE(rc))
    28222822            goto failure;
    28232823
     
    29312931#ifdef VBOX_WITH_STATISTICS
    29322932            rc = patmPatchGenStats(pVM, pPatch, pInstrGC);
    2933             if (VBOX_FAILURE(rc))
     2933            if (RT_FAILURE(rc))
    29342934                goto failure;
    29352935#endif
     
    29372937            /* Install fake cli patch (to clear the virtual IF) */
    29382938            rc = patmPatchGenIntEntry(pVM, pPatch, pInstrGC);
    2939             if (VBOX_FAILURE(rc))
     2939            if (RT_FAILURE(rc))
    29402940                goto failure;
    29412941
     
    29452945            /* Duplicate push. */
    29462946            rc = patmPatchGenDuplicate(pVM, pPatch, &cpuPush, pInstrGC);
    2947             if (VBOX_FAILURE(rc))
     2947            if (RT_FAILURE(rc))
    29482948                goto failure;
    29492949
    29502950            /* Generate jump to common entrypoint. */
    29512951            rc = patmPatchGenPatchJump(pVM, pPatch, pCurInstrGC, PATCHCODE_PTR_GC(&pJmpPatch->patch));
    2952             if (VBOX_FAILURE(rc))
     2952            if (RT_FAILURE(rc))
    29532953                goto failure;
    29542954
     
    30233023#ifdef VBOX_WITH_STATISTICS
    30243024    rc = patmPatchGenStats(pVM, pPatch, pInstrGC);
    3025     if (VBOX_FAILURE(rc))
     3025    if (RT_FAILURE(rc))
    30263026        goto failure;
    30273027#endif
    30283028
    30293029    rc = patmPatchGenTrapEntry(pVM, pPatch, pInstrGC);
    3030     if (VBOX_FAILURE(rc))
     3030    if (RT_FAILURE(rc))
    30313031        goto failure;
    30323032
     
    31453145    /** @note Set the PATM interrupt flag here; it was cleared before the patched call. (!!!) */
    31463146    rc = patmPatchGenSetPIF(pVM, pPatch, pInstrGC);
    3147     if (VBOX_FAILURE(rc))
     3147    if (RT_FAILURE(rc))
    31483148        goto failure;
    31493149
    31503150#ifdef VBOX_WITH_STATISTICS
    31513151    rc = patmPatchGenStats(pVM, pPatch, pInstrGC);
    3152     if (VBOX_FAILURE(rc))
     3152    if (RT_FAILURE(rc))
    31533153        goto failure;
    31543154#endif
     
    32953295    /** @note Set the PATM interrupt flag here; it was cleared before the patched call. (!!!) */
    32963296    rc = patmPatchGenSetPIF(pVM, pPatch, pInstrGC);
    3297     if (VBOX_FAILURE(rc))
     3297    if (RT_FAILURE(rc))
    32983298        goto failure;
    32993299
    33003300#ifdef VBOX_WITH_STATISTICS
    33013301    rc = patmPatchGenStats(pVM, pPatch, pInstrGC);
    3302     if (VBOX_FAILURE(rc))
     3302    if (RT_FAILURE(rc))
    33033303        goto failure;
    33043304#endif
    33053305
    33063306    rc = patmPatchGenPatchJump(pVM, pPatch, pInstrGC, pPatchTargetGC);
    3307     if (VBOX_FAILURE(rc))
     3307    if (RT_FAILURE(rc))
    33083308        goto failure;
    33093309
     
    35313531    rc = patmGenCallToPatch(pVM, pPatch, PATCHCODE_PTR_GC(&pPatchFunction->patch), true);
    35323532    AssertRC(rc);
    3533     if (VBOX_FAILURE(rc))
     3533    if (RT_FAILURE(rc))
    35343534        goto failure;
    35353535
     
    36093609    rc = PGMPhysSimpleDirtyWriteGCPtr(pVM, pInstrGC + pCpu->opsize - sizeof(RTRCPTR), &pVM->patm.s.mmio.pCachedData, sizeof(RTRCPTR));
    36103610    AssertRC(rc);
    3611     if (VBOX_FAILURE(rc))
     3611    if (RT_FAILURE(rc))
    36123612    {
    36133613        goto failure;
     
    37823782    /* Replace first opcode byte with 'int 3'. */
    37833783    rc = patmActivateInt3Patch(pVM, pPatch);
    3784     if (VBOX_FAILURE(rc))
     3784    if (RT_FAILURE(rc))
    37853785        goto failure;
    37863786
     
    38933893    rc = patmGenJumpToPatch(pVM, pPatch, true);
    38943894    AssertRC(rc);
    3895     if (VBOX_FAILURE(rc))
     3895    if (RT_FAILURE(rc))
    38963896        goto failure;
    38973897
     
    40604060            /** @todo we shouldn't disable and enable patches too often (it's relatively cheap, but pointless if it always happens) */
    40614061            rc = PATMR3EnablePatch(pVM, pInstrGC);
    4062             if (VBOX_SUCCESS(rc))
     4062            if (RT_SUCCESS(rc))
    40634063                return VWRN_PATCH_ENABLED;
    40644064
     
    40854085            }
    40864086            rc = PATMR3RemovePatch(pVM, pInstrGC);
    4087             if (VBOX_FAILURE(rc))
     4087            if (RT_FAILURE(rc))
    40884088                return VERR_PATCHING_REFUSED;
    40894089        }
     
    40974097
    40984098    rc = MMHyperAlloc(pVM, sizeof(PATMPATCHREC), 0, MM_TAG_PATM_PATCH, (void **)&pPatchRec);
    4099     if (VBOX_FAILURE(rc))
     4099    if (RT_FAILURE(rc))
    41004100    {
    41014101        Log(("Out of memory!!!!\n"));
     
    44444444            pPatchPage->cMaxPatches += PATMPATCHPAGE_PREALLOC_INCREMENT;
    44454445            rc = MMHyperAlloc(pVM, sizeof(PPATCHINFO)*pPatchPage->cMaxPatches, 0, MM_TAG_PATM_PATCH, (void **)&pPatchPage->aPatch);
    4446             if (VBOX_FAILURE(rc))
     4446            if (RT_FAILURE(rc))
    44474447            {
    44484448                Log(("Out of memory!!!!\n"));
     
    44584458    {
    44594459        rc = MMHyperAlloc(pVM, sizeof(PATMPATCHPAGE), 0, MM_TAG_PATM_PATCH, (void **)&pPatchPage);
    4460         if (VBOX_FAILURE(rc))
     4460        if (RT_FAILURE(rc))
    44614461        {
    44624462            Log(("Out of memory!!!!\n"));
     
    44684468
    44694469        rc = MMHyperAlloc(pVM, sizeof(PPATCHINFO)*PATMPATCHPAGE_PREALLOC_INCREMENT, 0, MM_TAG_PATM_PATCH, (void **)&pPatchPage->aPatch);
    4470         if (VBOX_FAILURE(rc))
     4470        if (RT_FAILURE(rc))
    44714471        {
    44724472            Log(("Out of memory!!!!\n"));
     
    51385138
    51395139        rc = PATMR3InstallPatch(pVM, pInstrGC, PATMFL_CODE32 | PATMFL_JUMP_CONFLICT);
    5140         if (VBOX_SUCCESS(rc))
     5140        if (RT_SUCCESS(rc))
    51415141        {
    51425142            Log(("PATM -> CONFLICT: Installed JMP patch for patch conflict at %VRv\n", pInstrGC));
     
    51545154        if (rc == VWRN_PATCH_REMOVED)
    51555155            return VINF_SUCCESS;
    5156         if (VBOX_SUCCESS(rc))
     5156        if (RT_SUCCESS(rc))
    51575157        {
    51585158            pConflictPatch->flags &= ~(PATMFL_MUST_INSTALL_PATCHJMP|PATMFL_INSTR_HINT);
     
    51635163
    51645164            AssertRC(rc);
    5165             if (VBOX_SUCCESS(rc))
     5165            if (RT_SUCCESS(rc))
    51665166            {
    51675167                STAM_COUNTER_INC(&pVM->patm.s.StatInt3Callable);
     
    52475247                    rc = patmGenJumpToPatch(pVM, pPatch, false);
    52485248                    AssertRC(rc);
    5249                     if (VBOX_FAILURE(rc))
     5249                    if (RT_FAILURE(rc))
    52505250                        return rc;
    52515251
     
    52845284
    52855285                rc = patmActivateInt3Patch(pVM, pPatch);
    5286                 if (VBOX_FAILURE(rc))
     5286                if (RT_FAILURE(rc))
    52875287                    return rc;
    52885288            }
     
    54455445    /* Attempt to install a new patch. */
    54465446    rc = PATMR3InstallPatch(pVM, pInstrGC, pPatch->flags & (PATMFL_CODE32|PATMFL_IDTHANDLER|PATMFL_INTHANDLER|PATMFL_TRAPHANDLER|PATMFL_DUPLICATE_FUNCTION|PATMFL_TRAPHANDLER_WITH_ERRORCODE|PATMFL_IDTHANDLER_WITHOUT_ENTRYPOINT));
    5447     if (VBOX_SUCCESS(rc))
     5447    if (RT_SUCCESS(rc))
    54485448    {
    54495449        RTRCPTR         pPatchTargetGC;
     
    54645464        /* insert jump to new patch in old patch block */
    54655465        rc = patmPatchGenPatchJump(pVM, pPatch, pInstrGC, pPatchTargetGC, false /* no lookup record */);
    5466         if (VBOX_FAILURE(rc))
     5466        if (RT_FAILURE(rc))
    54675467            goto failure;
    54685468
     
    54855485
    54865486failure:
    5487     if (VBOX_FAILURE(rc))
     5487    if (RT_FAILURE(rc))
    54885488    {
    54895489        LogRel(("PATM: patmR3RefreshPatch: failed to refresh patch at %VRv. Reactiving old one. \n", pInstrGC));
     
    58435843        /* Only harmless instructions are acceptable. */
    58445844        rc = CPUMR3DisasmInstrCPU(pVM, pCtx, pCurPatchInstrGC, &CpuOld, 0);
    5845         if (    VBOX_FAILURE(rc)
     5845        if (    RT_FAILURE(rc)
    58465846            ||  !(CpuOld.pCurInstr->optype & OPTYPE_HARMLESS))
    58475847            break;
     
    58715871    }
    58725872
    5873     if (    VBOX_SUCCESS(rc)
     5873    if (    RT_SUCCESS(rc)
    58745874        &&  (CpuOld.pCurInstr->optype & OPTYPE_HARMLESS)
    58755875       )
     
    58815881        cbLeft           = cbDirty;
    58825882
    5883         while (cbLeft && VBOX_SUCCESS(rc))
     5883        while (cbLeft && RT_SUCCESS(rc))
    58845884        {
    58855885            bool fValidInstr;
     
    59475947        rc = VERR_PATCHING_REFUSED;
    59485948
    5949     if (VBOX_SUCCESS(rc))
     5949    if (RT_SUCCESS(rc))
    59505950    {
    59515951        STAM_COUNTER_INC(&pVM->patm.s.StatInstrDirtyGood);
     
    59615961        {
    59625962            rc = patmR3RefreshPatch(pVM, pPatch);
    5963             if (VBOX_FAILURE(rc))
     5963            if (RT_FAILURE(rc))
    59645964            {
    59655965                LogRel(("PATM: Failed to refresh dirty patch at %VRv. Disabling it.\n", pPatch->patch.pPrivInstrGC));
     
    61496149
    61506150        rc = patmR3HandleDirtyInstr(pVM, pCtx, pPatch, pPatchToGuestRec, pEip);
    6151         if (VBOX_SUCCESS(rc))
     6151        if (RT_SUCCESS(rc))
    61526152        {
    61536153            /* Retry the current instruction. */
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