VirtualBox

Changeset 43163 in vbox for trunk/src/VBox/VMM/VMMR3


Ignore:
Timestamp:
Sep 4, 2012 2:12:53 PM (12 years ago)
Author:
vboxsync
Message:

VMM: A wee bit page pool paranoia related to #6349.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/VMM/VMMR3/PGMPool.cpp

    r41965 r43163  
    285285    /* The NIL entry. */
    286286    Assert(NIL_PGMPOOL_IDX == 0);
    287     pPool->aPages[NIL_PGMPOOL_IDX].enmKind = PGMPOOLKIND_INVALID;
     287    pPool->aPages[NIL_PGMPOOL_IDX].enmKind          = PGMPOOLKIND_INVALID;
     288    pPool->aPages[NIL_PGMPOOL_IDX].idx              = NIL_PGMPOOL_IDX;
    288289
    289290    /* The Shadow 32-bit PD. (32 bits guest paging) */
    290     pPool->aPages[PGMPOOL_IDX_PD].Core.Key  = NIL_RTHCPHYS;
    291     pPool->aPages[PGMPOOL_IDX_PD].GCPhys    = NIL_RTGCPHYS;
    292     pPool->aPages[PGMPOOL_IDX_PD].pvPageR3  = 0;
    293     pPool->aPages[PGMPOOL_IDX_PD].enmKind   = PGMPOOLKIND_32BIT_PD;
    294     pPool->aPages[PGMPOOL_IDX_PD].idx       = PGMPOOL_IDX_PD;
     291    pPool->aPages[PGMPOOL_IDX_PD].enmKind           = PGMPOOLKIND_32BIT_PD;
     292    pPool->aPages[PGMPOOL_IDX_PD].idx               = PGMPOOL_IDX_PD;
    295293
    296294    /* The Shadow PDPT. */
    297     pPool->aPages[PGMPOOL_IDX_PDPT].Core.Key  = NIL_RTHCPHYS;
    298     pPool->aPages[PGMPOOL_IDX_PDPT].GCPhys    = NIL_RTGCPHYS;
    299     pPool->aPages[PGMPOOL_IDX_PDPT].pvPageR3  = 0;
    300     pPool->aPages[PGMPOOL_IDX_PDPT].enmKind   = PGMPOOLKIND_PAE_PDPT;
    301     pPool->aPages[PGMPOOL_IDX_PDPT].idx       = PGMPOOL_IDX_PDPT;
     295    pPool->aPages[PGMPOOL_IDX_PDPT].enmKind         = PGMPOOLKIND_PAE_PDPT;
     296    pPool->aPages[PGMPOOL_IDX_PDPT].idx             = PGMPOOL_IDX_PDPT;
    302297
    303298    /* The Shadow AMD64 CR3. */
    304     pPool->aPages[PGMPOOL_IDX_AMD64_CR3].Core.Key  = NIL_RTHCPHYS;
    305     pPool->aPages[PGMPOOL_IDX_AMD64_CR3].GCPhys    = NIL_RTGCPHYS;
    306     pPool->aPages[PGMPOOL_IDX_AMD64_CR3].pvPageR3  = 0;
    307     pPool->aPages[PGMPOOL_IDX_AMD64_CR3].enmKind   = PGMPOOLKIND_64BIT_PML4;
    308     pPool->aPages[PGMPOOL_IDX_AMD64_CR3].idx       = PGMPOOL_IDX_AMD64_CR3;
     299    pPool->aPages[PGMPOOL_IDX_AMD64_CR3].enmKind    = PGMPOOLKIND_64BIT_PML4;
     300    pPool->aPages[PGMPOOL_IDX_AMD64_CR3].idx        = PGMPOOL_IDX_AMD64_CR3;
    309301
    310302    /* The Nested Paging CR3. */
    311     pPool->aPages[PGMPOOL_IDX_NESTED_ROOT].Core.Key  = NIL_RTHCPHYS;
    312     pPool->aPages[PGMPOOL_IDX_NESTED_ROOT].GCPhys    = NIL_RTGCPHYS;
    313     pPool->aPages[PGMPOOL_IDX_NESTED_ROOT].pvPageR3  = 0;
    314     pPool->aPages[PGMPOOL_IDX_NESTED_ROOT].enmKind   = PGMPOOLKIND_ROOT_NESTED;
    315     pPool->aPages[PGMPOOL_IDX_NESTED_ROOT].idx       = PGMPOOL_IDX_NESTED_ROOT;
     303    pPool->aPages[PGMPOOL_IDX_NESTED_ROOT].enmKind  = PGMPOOLKIND_ROOT_NESTED;
     304    pPool->aPages[PGMPOOL_IDX_NESTED_ROOT].idx      = PGMPOOL_IDX_NESTED_ROOT;
    316305
    317306    /*
    318307     * Set common stuff.
    319308     */
    320     for (unsigned iPage = 1; iPage < PGMPOOL_IDX_FIRST; iPage++)
    321     {
     309    for (unsigned iPage = 0; iPage < PGMPOOL_IDX_FIRST; iPage++)
     310    {
     311        pPool->aPages[iPage].Core.Key       = NIL_RTHCPHYS;
     312        pPool->aPages[iPage].GCPhys         = NIL_RTGCPHYS;
    322313        pPool->aPages[iPage].iNext          = NIL_PGMPOOL_IDX;
     314        /* pPool->aPages[iPage].cLocked        = INT32_MAX; - test this out... */
     315        pPool->aPages[iPage].pvPageR3       = 0;
    323316        pPool->aPages[iPage].iUserHead      = NIL_PGMPOOL_USER_INDEX;
    324317        pPool->aPages[iPage].iModifiedNext  = NIL_PGMPOOL_IDX;
     
    328321        pPool->aPages[iPage].iAgeNext       = NIL_PGMPOOL_IDX;
    329322        pPool->aPages[iPage].iAgePrev       = NIL_PGMPOOL_IDX;
     323
    330324        Assert(pPool->aPages[iPage].idx == iPage);
    331325        Assert(pPool->aPages[iPage].GCPhys == NIL_RTGCPHYS);
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