VirtualBox

Changeset 20058 in vbox for trunk/src/VBox/VMM


Ignore:
Timestamp:
May 27, 2009 8:29:57 AM (16 years ago)
Author:
vboxsync
Message:

Deal with pool pages being modified while we wait for the pgm lock in access handlers.

Location:
trunk/src/VBox/VMM
Files:
2 edited

Legend:

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

    r19872 r20058  
    493493 * to certain pages.
    494494 *
    495  * @returns VINF_SUCCESS if the handler have carried out the operation.
     495 * @returns VINF_SUCCESS if the handler has carried out the operation.
    496496 * @returns VINF_PGM_HANDLER_DO_DEFAULT if the caller should carry out the access operation.
    497497 * @param   pVM             VM Handle.
     
    521521     */
    522522    pgmLock(pVM);
    523     if (!pVCpu) /** @todo This shouldn't happen any longer, all access handlers will be called on an EMT. All ring-3 handlers, except MMIO, already owns the PGM lock. @bugref{3170} */
     523    if (PHYS_PAGE_ADDRESS(GCPhys) != PHYS_PAGE_ADDRESS(pPage->GCPhys))
     524    {
     525        /* Pool page changed while we were waiting for the lock; ignore. */
     526        Log(("CPU%d: pgmR3PoolAccessHandler pgm pool page for %RGp changed (to %RGp) while waiting!\n", pVCpu->idCpu, PHYS_PAGE_ADDRESS(GCPhys), PHYS_PAGE_ADDRESS(pPage->GCPhys)));
     527        pgmUnlock(pVM);
     528        return VINF_PGM_HANDLER_DO_DEFAULT;
     529    }
     530
     531    if (!pVCpu) /** @todo This shouldn't happen any longer, all access handlers will be called on an EMT. All ring-3 handlers, except MMIO, already own the PGM lock. @bugref{3170} */
    524532    {
    525533        Log(("pgmR3PoolAccessHandler: async thread, requesting EMT to flush the page: %p:{.Core=%RHp, .idx=%d, .GCPhys=%RGp, .enmType=%d}\n",
  • trunk/src/VBox/VMM/VMMAll/PGMAllPool.cpp

    r19903 r20058  
    11161116
    11171117    pgmLock(pVM);
    1118     AssertMsg(PHYS_PAGE_ADDRESS(GCPhysFault) == PHYS_PAGE_ADDRESS(pPage->GCPhys), ("%RGp vs %RGp\n", PHYS_PAGE_ADDRESS(GCPhysFault), pPage->GCPhys));
     1118    if (PHYS_PAGE_ADDRESS(GCPhysFault) != PHYS_PAGE_ADDRESS(pPage->GCPhys))
     1119    {
     1120        /* Pool page changed while we were waiting for the lock; ignore. */
     1121        Log(("CPU%d: pgmPoolAccessHandler pgm pool page for %RGp changed (to %RGp) while waiting!\n", pVCpu->idCpu, PHYS_PAGE_ADDRESS(GCPhysFault), PHYS_PAGE_ADDRESS(pPage->GCPhys)));
     1122        STAM_PROFILE_STOP_EX(&pVM->pgm.s.CTX_SUFF(pPool)->CTX_SUFF_Z(StatMonitor), &pPool->CTX_MID_Z(StatMonitor,Handled), a);
     1123        pgmUnlock(pVM);
     1124        return VINF_SUCCESS;
     1125    }
    11191126
    11201127    /*
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