VirtualBox

Changeset 20762 in vbox


Ignore:
Timestamp:
Jun 22, 2009 11:06:56 AM (16 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
48882
Message:

More PGM locking

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

Legend:

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

    r20671 r20762  
    873873    int            rc;
    874874
     875    Assert(PGMIsLockOwner(pVM));
     876
    875877    /* Allocate page directory if not present. */
    876878    if (    !pPdpe->n.u1Present
     
    964966    const unsigned  iPdPt = (GCPtr >> X86_PDPT_SHIFT) & X86_PDPT_MASK_PAE;
    965967    PX86PDPT        pPdpt = pgmShwGetPaePDPTPtr(pPGM);
     968
     969    Assert(PGMIsLockOwner(PGMCPU2VM(pPGM)));
     970
    966971    AssertReturn(pPdpt, VERR_PAGE_DIRECTORY_PTR_NOT_PRESENT);    /* can't happen */
    967972    if (!pPdpt->a[iPdPt].n.u1Present)
     
    10091014    int            rc;
    10101015
     1016    Assert(PGMIsLockOwner(pVM));
     1017
    10111018    /* Allocate page directory pointer table if not present. */
    10121019    if (    !pPml4e->n.u1Present
     
    11061113    const unsigned  iPml4 = (GCPtr >> X86_PML4_SHIFT) & X86_PML4_MASK;
    11071114    PCX86PML4E      pPml4e = pgmShwGetLongModePML4EPtr(pPGM, iPml4);
     1115
     1116    Assert(PGMIsLockOwner(PGMCPU2VM(pPGM)));
     1117
    11081118    AssertReturn(pPml4e, VERR_INTERNAL_ERROR);
    11091119    if (ppPml4e)
     
    11551165
    11561166    Assert(HWACCMIsNestedPagingActive(pVM));
     1167    Assert(PGMIsLockOwner(pVM));
    11571168
    11581169    pPml4 = (PEPTPML4)PGMPOOL_PAGE_2_PTR_BY_PGMCPU(pPGM, pPGM->CTX_SUFF(pShwPageCR3));
  • TabularUnified trunk/src/VBox/VMM/VMMAll/PGMAllBth.h

    r20684 r20762  
    43434343    PPGMPOOLPAGE pNewShwPageCR3;
    43444344
     4345    pgmLock(pVM);
     4346
    43454347    Assert(!(GCPhysCR3 >> (PAGE_SHIFT + 32)));
    4346     rc = pgmPoolAlloc(pVM, GCPhysCR3 & GST_CR3_PAGE_MASK, BTH_PGMPOOLKIND_ROOT, SHW_POOL_ROOT_IDX, GCPhysCR3 >> PAGE_SHIFT, &pNewShwPageCR3);
     4348    rc = pgmPoolAlloc(pVM, GCPhysCR3 & GST_CR3_PAGE_MASK, BTH_PGMPOOLKIND_ROOT, SHW_POOL_ROOT_IDX, GCPhysCR3 >> PAGE_SHIFT, &pNewShwPageCR3, true /* lock page */);
    43474349    AssertFatalRC(rc);
    43484350    rc = VINF_SUCCESS;
    4349 
    4350     /* Mark the page as locked; disallow flushing. */
    4351     pgmPoolLockPage(pPool, pNewShwPageCR3);
    43524351
    43534352#  ifdef IN_RC
    43544353    /* NOTE: We can't deal with jumps to ring 3 here as we're now in an inconsistent state! */
    43554354    bool fLog = VMMGCLogDisable(pVM);
    4356     pgmLock(pVM);
    43574355#  endif
    43584356
     
    43894387
    43904388#  ifdef IN_RC
    4391     pgmUnlock(pVM);
    43924389    VMMGCLogRestore(pVM, fLog);
    43934390#  endif
     
    44064403        pgmPoolFreeByPage(pPool, pOldShwPageCR3, iOldShwUser, iOldShwUserTable);
    44074404    }
    4408 
     4405    pgmUnlock(pVM);
    44094406# endif
    44104407
     
    44734470#  endif
    44744471
     4472    pgmLock(pVM);
     4473
    44754474# ifndef PGM_WITHOUT_MAPPINGS
    44764475    if (pVCpu->pgm.s.CTX_SUFF(pShwPageCR3))
     
    44954494        pVCpu->pgm.s.iShwUserTable = 0;
    44964495    }
     4496    pgmUnlock(pVM);
    44974497# endif
    44984498#endif /* !IN_RC*/
  • TabularUnified trunk/src/VBox/VMM/VMMAll/PGMAllPool.cpp

    r20758 r20762  
    40554055 * @param   iUserTable  The index into the user table (shadowed).
    40564056 * @param   ppPage      Where to store the pointer to the page. NULL is stored here on failure.
    4057  */
    4058 int pgmPoolAllocEx(PVM pVM, RTGCPHYS GCPhys, PGMPOOLKIND enmKind, PGMPOOLACCESS enmAccess, uint16_t iUser, uint32_t iUserTable, PPPGMPOOLPAGE ppPage)
     4057 * @param   fLockPage   Lock the page
     4058 */
     4059int pgmPoolAllocEx(PVM pVM, RTGCPHYS GCPhys, PGMPOOLKIND enmKind, PGMPOOLACCESS enmAccess, uint16_t iUser, uint32_t iUserTable, PPPGMPOOLPAGE ppPage, bool fLockPage)
    40594060{
    40604061    PPGMPOOL pPool = pVM->pgm.s.CTX_SUFF(pPool);
     
    40744075        if (RT_SUCCESS(rc2))
    40754076        {
     4077            if (fLockPage)
     4078                pgmPoolLockPage(pPool, *ppPage);
    40764079            pgmUnlock(pVM);
    40774080            STAM_PROFILE_ADV_STOP(&pPool->StatAlloc, a);
     
    41644167
    41654168    *ppPage = pPage;
     4169    if (fLockPage)
     4170        pgmPoolLockPage(pPool, pPage);
    41664171    pgmUnlock(pVM);
    41674172    LogFlow(("pgmPoolAlloc: returns %Rrc *ppPage=%p:{.Key=%RHp, .idx=%d, .fCached=%RTbool, .fMonitored=%RTbool}\n",
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