VirtualBox

Changeset 14519 in vbox for trunk/src/VBox


Ignore:
Timestamp:
Nov 24, 2008 2:07:29 PM (16 years ago)
Author:
vboxsync
Message:

PGMR0DynMap: fixes (InitVM+TermVM working).

File:
1 edited

Legend:

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

    r14517 r14519  
    285285        g_pPGMR0DynMap = NULL;
    286286
    287         AssertLogRelMsg(!pThis->cUsers && !pThis->paPages && !pThis->cPages,
    288                         ("cUsers=%d paPages=%p cPages=%#x\n",
    289                          pThis->cUsers, pThis->paPages, pThis->cPages));
     287        AssertLogRelMsg(!pThis->cUsers && !pThis->paPages && !pThis->pvSavedPTEs && !pThis->cPages,
     288                        ("cUsers=%d paPages=%p pvSavedPTEs=%p cPages=%#x\n",
     289                         pThis->cUsers, pThis->paPages, pThis->pvSavedPTEs, pThis->cPages));
    290290
    291291        /* Free the associated resources. */
     
    648648         * The next level.
    649649         */
    650         uint32_t iEntry = ((uintptr_t)pvPage >> pPgLvl->a[i].fPtrShift) & pPgLvl->a[i].fPtrMask;
     650        uint32_t iEntry = ((uint64_t)(uintptr_t)pvPage >> pPgLvl->a[i].fPtrShift) & pPgLvl->a[i].fPtrMask;
    651651        if (pThis->fLegacyMode)
    652652        {
     
    662662        if ((uEntry & pPgLvl->a[i].fAndMask) != pPgLvl->a[i].fResMask)
    663663        {
    664             LogRel(("PGMR0DynMap: internal error - iPgLvl=%u cLevels=%u uEntry=%#llx fAnd=%#llx fRes=%#llx got=%#llx\n",
    665                     i, pPgLvl->cLevels, uEntry, pPgLvl->a[i].fAndMask, pPgLvl->a[i].fResMask, uEntry & pPgLvl->a[i].fAndMask));
     664            LogRel(("PGMR0DynMap: internal error - iPgLvl=%u cLevels=%u uEntry=%#llx fAnd=%#llx fRes=%#llx got=%#llx\n"
     665                    "PGMR0DynMap: pv=%p pvPage=%p iEntry=%#x fLegacyMode=%RTbool\n",
     666                    i, pPgLvl->cLevels, uEntry, pPgLvl->a[i].fAndMask, pPgLvl->a[i].fResMask, uEntry & pPgLvl->a[i].fAndMask,
     667                    pPgLvl->a[i].u.pv, pvPage, iEntry, pThis->fLegacyMode));
    666668            return VERR_INTERNAL_ERROR;
    667669        }
     
    715717
    716718    /*
    717      * Allocate the segment structure and pages memory.
     719     * Allocate the segment structure and pages of memory, then touch all the pages (paranoia).
    718720     */
    719721    uint32_t cMaxPTs = cPages / (pThis->fLegacyMode ? X86_PG_ENTRIES : X86_PG_PAE_ENTRIES) + 2;
     
    730732        uint8_t            *pbPage = (uint8_t *)RTR0MemObjAddress(pSeg->hMemObj);
    731733        AssertMsg(VALID_PTR(pbPage) && !((uintptr_t)pbPage & PAGE_OFFSET_MASK), ("%p\n", pbPage));
     734        memset(pbPage, 0xfe, cPages << PAGE_SHIFT);
    732735
    733736        /*
     
    799802    RTMemFree(pSeg);
    800803
    801     /* Don't bother resizing the arrays, too layz. */
     804    /* Don't bother resizing the arrays, but free them if we're the only user. */
     805    if (!pThis->cPages)
     806    {
     807        RTMemFree(pThis->paPages);
     808        pThis->paPages = NULL;
     809        RTMemFree(pThis->pvSavedPTEs);
     810        pThis->pvSavedPTEs = NULL;
     811    }
    802812    return rc;
    803813}
     
    889899    Assert(!pvUser2);
    890900    PPGMR0DYNMAP        pThis   = (PPGMR0DYNMAP)pvUser1;
    891     AssertPtr(pThis == g_pPGMR0DynMap);
     901    Assert(pThis == g_pPGMR0DynMap);
    892902    PPGMR0DYNMAPENTRY   paPages = pThis->paPages;
    893903    uint32_t            iPage   = pThis->cPages;
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