VirtualBox

Changeset 17667 in vbox for trunk/src/VBox/VMM/VMMAll


Ignore:
Timestamp:
Mar 11, 2009 9:35:22 AM (16 years ago)
Author:
vboxsync
Message:

pgmPoolAlloc no longer fails with non-fatal errors.

Location:
trunk/src/VBox/VMM/VMMAll
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/VMM/VMMAll/PGMAll.cpp

    r17658 r17667  
    940940        /* Create a reference back to the PDPT by using the index in its shadow page. */
    941941        rc = pgmPoolAlloc(pVM, GCPdPt, enmKind, pVM->pgm.s.CTX_SUFF(pShwPageCR3)->idx, iPdPt, &pShwPage);
    942         if (rc == VERR_PGM_POOL_FLUSHED)
    943         {
    944             Log(("pgmShwSyncPaePDPtr: PGM pool flushed -> signal sync cr3\n"));
    945             Assert(pVM->pgm.s.fSyncFlags & PGM_SYNC_CLEAR_PGM_POOL);
    946             VM_FF_SET(pVM, VM_FF_PGM_SYNC_CR3);
    947 # if defined(IN_RC)
    948             PGMDynUnlockHCPage(pVM, (uint8_t *)pPdpe);
    949 # endif
    950             return VINF_PGM_SYNC_CR3;
    951         }
    952942        AssertRCReturn(rc, rc);
    953943
     
    10571047        /* Create a reference back to the PDPT by using the index in its shadow page. */
    10581048        rc = pgmPoolAlloc(pVM, GCPml4, enmKind, pVM->pgm.s.CTX_SUFF(pShwPageCR3)->idx, iPml4, &pShwPage);
    1059         if (rc == VERR_PGM_POOL_FLUSHED)
    1060         {
    1061             Log(("PGMShwSyncLongModePDPtr: PGM pool flushed (1) -> signal sync cr3\n"));
    1062             Assert(pVM->pgm.s.fSyncFlags & PGM_SYNC_CLEAR_PGM_POOL);
    1063             VM_FF_SET(pVM, VM_FF_PGM_SYNC_CR3);
    1064             return VINF_PGM_SYNC_CR3;
    1065         }
    10661049        AssertRCReturn(rc, rc);
    10671050    }
     
    11021085        /* Create a reference back to the PDPT by using the index in its shadow page. */
    11031086        rc = pgmPoolAlloc(pVM, GCPdPt, enmKind, pShwPage->idx, iPdPt, &pShwPage);
    1104         if (rc == VERR_PGM_POOL_FLUSHED)
    1105         {
    1106             Log(("PGMShwSyncLongModePDPtr: PGM pool flushed (2) -> signal sync cr3\n"));
    1107             Assert(pVM->pgm.s.fSyncFlags & PGM_SYNC_CLEAR_PGM_POOL);
    1108             VM_FF_SET(pVM, VM_FF_PGM_SYNC_CR3);
    1109             return VINF_PGM_SYNC_CR3;
    1110         }
    11111087        AssertRCReturn(rc, rc);
    11121088    }
     
    11961172
    11971173        rc = pgmPoolAlloc(pVM, GCPml4, PGMPOOLKIND_EPT_PDPT_FOR_PHYS, PGMPOOL_IDX_NESTED_ROOT, iPml4, &pShwPage);
    1198         if (rc == VERR_PGM_POOL_FLUSHED)
    1199         {
    1200             Log(("PGMShwSyncEPTPDPtr: PGM pool flushed (1) -> signal sync cr3\n"));
    1201             Assert(pVM->pgm.s.fSyncFlags & PGM_SYNC_CLEAR_PGM_POOL);
    1202             VM_FF_SET(pVM, VM_FF_PGM_SYNC_CR3);
    1203             return VINF_PGM_SYNC_CR3;
    1204         }
    12051174        AssertRCReturn(rc, rc);
    12061175    }
     
    12301199
    12311200        rc = pgmPoolAlloc(pVM, GCPdPt, PGMPOOLKIND_64BIT_PD_FOR_PHYS, pShwPage->idx, iPdPt, &pShwPage);
    1232         if (rc == VERR_PGM_POOL_FLUSHED)
    1233         {
    1234             Log(("PGMShwSyncEPTPDPtr: PGM pool flushed (2) -> signal sync cr3\n"));
    1235             Assert(pVM->pgm.s.fSyncFlags & PGM_SYNC_CLEAR_PGM_POOL);
    1236             VM_FF_SET(pVM, VM_FF_PGM_SYNC_CR3);
    1237             return VINF_PGM_SYNC_CR3;
    1238         }
    12391201        AssertRCReturn(rc, rc);
    12401202    }
  • trunk/src/VBox/VMM/VMMAll/PGMAllBth.h

    r17660 r17667  
    42734273    Assert(!(GCPhysCR3 >> (PAGE_SHIFT + 32)));
    42744274    rc = pgmPoolAlloc(pVM, GCPhysCR3 & GST_CR3_PAGE_MASK, BTH_PGMPOOLKIND_ROOT, SHW_POOL_ROOT_IDX, GCPhysCR3 >> PAGE_SHIFT, &pNewShwPageCR3);
    4275     if (rc == VERR_PGM_POOL_FLUSHED)
    4276     {
    4277         Log(("MapCR3: PGM pool flushed -> signal sync cr3\n"));
    4278         Assert(VM_FF_ISSET(pVM, VM_FF_PGM_SYNC_CR3));
    4279         return VINF_PGM_SYNC_CR3;
    4280     }
    4281     AssertRCReturn(rc, rc);
     4275    AssertFatalRC(rc);
    42824276    rc = VINF_SUCCESS;
    42834277
  • trunk/src/VBox/VMM/VMMAll/PGMAllMap.cpp

    r17639 r17667  
    299299                    int rc = pgmShwSyncPaePDPtr(pVM, (iPdPt << X86_PDPT_SHIFT), &GstPdpe, &pShwPaePd);
    300300                    AssertFatal(RT_SUCCESS(rc));
    301                     if (rc != VINF_SUCCESS)
    302                     {
    303                         rc = pgmShwSyncPaePDPtr(pVM, (iPdPt << X86_PDPT_SHIFT), &GstPdpe, &pShwPaePd);
    304                         AssertFatalMsg(rc == VINF_SUCCESS, ("rc = %Rrc\n", rc));
    305                     }
    306301                }
    307302                Assert(pShwPaePd);
  • trunk/src/VBox/VMM/VMMAll/PGMAllPool.cpp

    r17659 r17667  
    191191        {
    192192            int rc2 = pgmPoolFlushPage(pPool, pPage);
    193             if (rc2 == VERR_PGM_POOL_CLEARED && rc == VINF_SUCCESS)
    194                 rc = VINF_PGM_SYNC_CR3;
     193            AssertRC(rc2);
    195194        }
    196195        /* next */
     
    12331232 * @returns VBox status code.
    12341233 * @retval  VINF_SUCCESS on success.
    1235  * @retval  VERR_PGM_POOL_CLEARED if the deregistration of a physical handler will cause a light weight pool flush.
    12361234 * @param   pPool       The pool.
    12371235 * @param   iUser       The user index.
     
    14511449                {
    14521450                    STAM_COUNTER_INC(&pPool->StatCacheKindMismatches);
    1453                     pgmPoolFlushPage(pPool, pPage); /* ASSUMES that VERR_PGM_POOL_CLEARED will be returned by pgmPoolTracInsert. */
     1451                    pgmPoolFlushPage(pPool, pPage);
    14541452                    PGM_INVL_GUEST_TLBS(); /* see PT handler. */
    14551453                    break;
     
    16321630 * @returns VBox status code.
    16331631 * @retval  VINF_SUCCESS on success.
    1634  * @retval  VERR_PGM_POOL_CLEARED if the registration of the physical handler will cause a light weight pool flush.
    16351632 * @param   pPool       The pool.
    16361633 * @param   pPage       The cached page.
     
    17191716         * the heap size should suffice. */
    17201717        AssertFatalRC(rc);
    1721         if (pVM->pgm.s.fSyncFlags & PGM_SYNC_CLEAR_PGM_POOL)
    1722             rc = VERR_PGM_POOL_CLEARED;
     1718        Assert(!(pVM->pgm.s.fSyncFlags & PGM_SYNC_CLEAR_PGM_POOL) || VM_FF_ISSET(pVM, VM_FF_PGM_SYNC_CR3));   
    17231719    }
    17241720    pPage->fMonitored = true;
     
    17321728 * @returns VBox status code.
    17331729 * @retval  VINF_SUCCESS on success.
    1734  * @retval  VERR_PGM_POOL_CLEARED if the deregistration of the physical handler will cause a light weight pool flush.
    17351730 * @param   pPool       The pool.
    17361731 * @param   pPage       The cached page.
     
    18181813        rc = PGMHandlerPhysicalDeregister(pVM, pPage->GCPhys & ~(RTGCPHYS)(PAGE_SIZE - 1));
    18191814        AssertFatalRC(rc);
    1820         if (pVM->pgm.s.fSyncFlags & PGM_SYNC_CLEAR_PGM_POOL)
    1821             rc = VERR_PGM_POOL_CLEARED;
     1815        Assert(!(pVM->pgm.s.fSyncFlags & PGM_SYNC_CLEAR_PGM_POOL) || VM_FF_ISSET(pVM, VM_FF_PGM_SYNC_CR3));   
    18221816    }
    18231817    pPage->fMonitored = false;
     
    21172111     * Lazy approach.
    21182112     */
    2119     /* @todo incompatible with long mode paging (cr3 root will be flushed) */
     2113    /* @todo This path no longer works (CR3 root pages will be flushed)!! */
     2114    AssertCompileFailed();
    21202115    Assert(!CPUMIsGuestInLongMode(pVM));
    21212116    pgmPoolFlushAllInt(pPool);
     
    21342129 * @retval  VINF_SUCCESS if successfully added.
    21352130 * @retval  VERR_PGM_POOL_FLUSHED if the pool was flushed.
    2136  * @retval  VERR_PGM_POOL_CLEARED if the deregistration of the physical handler will cause a light weight pool flush.
    21372131 * @param   pPool       The pool.
    21382132 * @param   pPage       The cached page.
     
    22132207# ifdef PGMPOOL_WITH_MONITORING
    22142208        rc = pgmPoolMonitorInsert(pPool, pPage);
    2215         if (rc == VERR_PGM_POOL_CLEARED)
    2216         {
    2217             /* 'Failed' - free the usage, and keep it in the cache (if enabled). */
    2218 #  ifndef PGMPOOL_WITH_CACHE
    2219             pgmPoolMonitorFlush(pPool, pPage);
    2220             rc = VERR_PGM_POOL_FLUSHED;
    2221 #  endif
    2222             pPage->iUserHead = NIL_PGMPOOL_USER_INDEX;
    2223             paUsers[i].iNext = pPool->iUserFreeHead;
    2224             paUsers[i].iUser = NIL_PGMPOOL_IDX;
    2225             pPool->iUserFreeHead = i;
    2226         }
     2209        AssertRC(rc);
    22272210    }
    22282211# endif
     
    39953978 * @returns VBox status code.
    39963979 * @retval  VINF_SUCCESS on success.
    3997  * @retval  VERR_PGM_POOL_CLEARED if the deregistration of the physical handler will cause a light weight pool flush.
    39983980 * @param   pPool       The pool.
    39993981 * @param   HCPhys      The HC physical address of the shadow page.
     
    40113993    if (pPage->idx < PGMPOOL_IDX_FIRST)
    40123994    {
     3995        AssertFailed(); /* can no longer happen */
    40133996        Log(("pgmPoolFlushPage: special root page, rejected. enmKind=%s idx=%d\n", pgmPoolPoolKindToStr(pPage->enmKind), pPage->idx));
    40143997        return VINF_SUCCESS;
     
    41144097    if (!pPage->fCached)
    41154098#endif
    4116         pgmPoolFlushPage(pPool, pPage);  /* ASSUMES that VERR_PGM_POOL_CLEARED can be ignored here. */
     4099        pgmPoolFlushPage(pPool, pPage);
    41174100    STAM_PROFILE_STOP(&pPool->StatFree, a);
    41184101}
     
    41704153     * a cheap replacement strategy...
    41714154     */
    4172     /* @todo incompatible with long mode paging (cr3 root will be flushed) */
     4155    /* @todo This path no longer works (CR3 root pages will be flushed)!! */
     4156    AssertCompileFailed();
    41734157    Assert(!CPUMIsGuestInLongMode(pVM));
    41744158    pgmPoolFlushAllInt(pPool);
     
    42304214        if (RT_FAILURE(rc))
    42314215        {
    4232             if (rc != VERR_PGM_POOL_CLEARED)
    4233             {
    4234                 Log(("pgmPoolAlloc: returns %Rrc (Free)\n", rc));
    4235                 STAM_PROFILE_ADV_STOP(&pPool->StatAlloc, a);
    4236                 return rc;
    4237             }
    4238             Log(("pgmPoolMakeMoreFreePages failed with %Rrc -> return VERR_PGM_POOL_FLUSHED\n", rc));
    4239             rc = VERR_PGM_POOL_FLUSHED;
     4216            Log(("pgmPoolAlloc: returns %Rrc (Free)\n", rc));
     4217            STAM_PROFILE_ADV_STOP(&pPool->StatAlloc, a);
     4218            return rc;
    42404219        }
    42414220        iNew = pPool->iFreeHead;
     
    42754254    if (RT_FAILURE(rc3))
    42764255    {
    4277         if (rc3 != VERR_PGM_POOL_CLEARED)
    4278         {
    4279             pPool->cUsedPages--;
    4280             pPage->enmKind = PGMPOOLKIND_FREE;
    4281             pPage->GCPhys = NIL_RTGCPHYS;
    4282             pPage->iNext = pPool->iFreeHead;
    4283             pPool->iFreeHead = pPage->idx;
    4284             STAM_PROFILE_ADV_STOP(&pPool->StatAlloc, a);
    4285             Log(("pgmPoolAlloc: returns %Rrc (Insert)\n", rc3));
    4286             return rc3;
    4287         }
    4288         Log(("pgmPoolTrackInsert failed with %Rrc -> return VERR_PGM_POOL_FLUSHED\n", rc3));
    4289         rc = VERR_PGM_POOL_FLUSHED;
     4256        pPool->cUsedPages--;
     4257        pPage->enmKind = PGMPOOLKIND_FREE;
     4258        pPage->GCPhys = NIL_RTGCPHYS;
     4259        pPage->iNext = pPool->iFreeHead;
     4260        pPool->iFreeHead = pPage->idx;
     4261        STAM_PROFILE_ADV_STOP(&pPool->StatAlloc, a);
     4262        Log(("pgmPoolAlloc: returns %Rrc (Insert)\n", rc3));
     4263        return rc3;
    42904264    }
    42914265#endif /* PGMPOOL_WITH_USER_TRACKING */
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