VirtualBox

Changeset 32480 in vbox


Ignore:
Timestamp:
Sep 14, 2010 1:35:53 PM (14 years ago)
Author:
vboxsync
Message:

SyncPageWorkerTrackDeref: Use the hint we retrieved from the cached dirty guest PT.
Do not reset the modifications counter in InvalidatePage.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/VMM/VMMAll/PGMAllBth.h

    r32431 r32480  
    12701270            RTGCPHYS        GCPhys   = GST_GET_PDE_GCPHYS(PdeSrc);
    12711271
    1272 # ifdef PGMPOOL_WITH_OPTIMIZED_DIRTY_PT
    1273             /* Reset the modification counter (OpenSolaris trashes tlb entries very often) */
    1274             if (    !pShwPage->fDirty
    1275                 &&  pShwPage->cModifications)
    1276                 pShwPage->cModifications = 1;
    1277 # endif
    1278 
    12791272# if PGM_SHW_TYPE == PGM_TYPE_PAE && PGM_GST_TYPE == PGM_TYPE_32BIT
    12801273            /* Select the right PDE as we're emulating a 4kb page table with 2 shadow page tables. */
     
    13901383 * @param   HCPhys      The physical page we is being dereferenced.
    13911384 * @param   iPte        Shadow PTE index
     1385 * @param   GCPhysPage  Guest physical address (only valid if pShwPage->fDirty is set)
    13921386 */
    1393 DECLINLINE(void) PGM_BTH_NAME(SyncPageWorkerTrackDeref)(PVMCPU pVCpu, PPGMPOOLPAGE pShwPage, RTHCPHYS HCPhys, uint16_t iPte)
     1387DECLINLINE(void) PGM_BTH_NAME(SyncPageWorkerTrackDeref)(PVMCPU pVCpu, PPGMPOOLPAGE pShwPage, RTHCPHYS HCPhys, uint16_t iPte, RTGCPHYS GCPhysPage)
    13941388{
    13951389    PVM pVM = pVCpu->CTX_SUFF(pVM);
     
    13971391    STAM_PROFILE_START(&pVM->pgm.s.CTX_SUFF(pStats)->StatTrackDeref, a);
    13981392    LogFlow(("SyncPageWorkerTrackDeref: Damn HCPhys=%RHp pShwPage->idx=%#x!!!\n", HCPhys, pShwPage->idx));
     1393
     1394# if    defined(PGMPOOL_WITH_OPTIMIZED_DIRTY_PT) \
     1395     && PGM_WITH_PAGING(PGM_GST_TYPE, PGM_SHW_TYPE) \
     1396     && (PGM_GST_TYPE == PGM_TYPE_PAE || PGM_GST_TYPE == PGM_TYPE_AMD64 || PGM_SHW_TYPE == PGM_TYPE_PAE /* pae/32bit combo */)
     1397
     1398    /* Use the hint we retrieved from the cached guest PT. */
     1399    if (pShwPage->fDirty)
     1400    {
     1401        PPGMPOOL pPool = pVM->pgm.s.CTX_SUFF(pPool);
     1402
     1403        Assert(pShwPage->cPresent);
     1404        Assert(pPool->cPresent);
     1405        pShwPage->cPresent--;
     1406        pPool->cPresent--;
     1407
     1408        PPGMPAGE pPhysPage = pgmPhysGetPage(&pVM->pgm.s, GCPhysPage);
     1409        AssertRelease(pPhysPage);
     1410        pgmTrackDerefGCPhys(pPool, pShwPage, pPhysPage, iPte);
     1411        return;   
     1412    }
     1413# endif
    13991414
    14001415    /** @todo If this turns out to be a bottle neck (*very* likely) two things can be done:
     
    15631578                                              PPGMPOOLPAGE pShwPage, unsigned iPTDst)
    15641579{
    1565     PVM pVM = pVCpu->CTX_SUFF(pVM);
    1566 
    1567 # if    defined(PGMPOOL_WITH_OPTIMIZED_DIRTY_PT) \
     1580    PVM      pVM = pVCpu->CTX_SUFF(pVM);
     1581    RTGCPHYS GCPhysOldPage = NIL_RTGCPHYS;
     1582
     1583#if    defined(PGMPOOL_WITH_OPTIMIZED_DIRTY_PT) \
    15681584     && PGM_WITH_PAGING(PGM_GST_TYPE, PGM_SHW_TYPE) \
    15691585     && (PGM_GST_TYPE == PGM_TYPE_PAE || PGM_GST_TYPE == PGM_TYPE_AMD64 || PGM_SHW_TYPE == PGM_TYPE_PAE /* pae/32bit combo */)
     1586
    15701587    if (pShwPage->fDirty)
    15711588    {
     
    15741591
    15751592        pGstPT = (PGSTPT)&pPool->aDirtyPages[pShwPage->idxDirty].aPage[0];
     1593        GCPhysOldPage = GST_GET_PTE_GCPHYS(pGstPT->a[iPTDst]);
    15761594        pGstPT->a[iPTDst].u = PteSrc.u;
    15771595    }
    1578 # else
     1596#else
    15791597    Assert(!pShwPage->fDirty);
    1580 # endif
     1598#endif
    15811599
    15821600    if (   PteSrc.n.u1Present
     
    16921710                {
    16931711                    Log2(("SyncPageWorker: deref! *pPteDst=%RX64 PteDst=%RX64\n", SHW_PTE_LOG64(*pPteDst), SHW_PTE_LOG64(PteDst)));
    1694                     PGM_BTH_NAME(SyncPageWorkerTrackDeref)(pVCpu, pShwPage, SHW_PTE_GET_HCPHYS(*pPteDst), iPTDst);
     1712                    PGM_BTH_NAME(SyncPageWorkerTrackDeref)(pVCpu, pShwPage, SHW_PTE_GET_HCPHYS(*pPteDst), iPTDst, GCPhysOldPage);
    16951713                    PGM_BTH_NAME(SyncPageWorkerTrackAddref)(pVCpu, pShwPage, PGM_PAGE_GET_TRACKING(pPage), pPage, iPTDst);
    16961714                }
     
    16991717            {
    17001718                Log2(("SyncPageWorker: deref! *pPteDst=%RX64\n", SHW_PTE_LOG64(*pPteDst)));
    1701                 PGM_BTH_NAME(SyncPageWorkerTrackDeref)(pVCpu, pShwPage, SHW_PTE_GET_HCPHYS(*pPteDst), iPTDst);
     1719                PGM_BTH_NAME(SyncPageWorkerTrackDeref)(pVCpu, pShwPage, SHW_PTE_GET_HCPHYS(*pPteDst), iPTDst, GCPhysOldPage);
    17021720            }
    17031721
     
    17281746    {
    17291747        Log2(("SyncPageWorker: deref! *pPteDst=%RX64\n", SHW_PTE_LOG64(*pPteDst)));
    1730         PGM_BTH_NAME(SyncPageWorkerTrackDeref)(pVCpu, pShwPage, SHW_PTE_GET_HCPHYS(*pPteDst), iPTDst);
     1748        PGM_BTH_NAME(SyncPageWorkerTrackDeref)(pVCpu, pShwPage, SHW_PTE_GET_HCPHYS(*pPteDst), iPTDst, GCPhysOldPage);
    17311749    }
    17321750    SHW_PTE_ATOMIC_SET(*pPteDst, 0);
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