VirtualBox

Changeset 18266 in vbox for trunk/src/VBox/VMM/VMMAll


Ignore:
Timestamp:
Mar 25, 2009 5:25:53 PM (16 years ago)
Author:
vboxsync
Message:

PGM: Made PGMR3PhysRomProtect use instead of doing a full pool flush for each call (expensive using reset), this fixes a reset assertion in pgmPoolMonitorFlush. Changed pgmPoolTrackFlushGCPhys to return VINF_PGM_SYNC_CR3 and set VM_FF_PGM_SYNCR3 and PGM_SYNC_CLEAR_PGM_POOL instead of leave this to the caller.

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

Legend:

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

    r18234 r18266  
    169169    {
    170170        rc = pgmHandlerPhysicalSetRamFlagsAndFlushShadowPTs(pVM, pNew, pRam);
    171         if (rc == VINF_PGM_GCPHYS_ALIASED)
    172         {
    173             pVM->pgm.s.fSyncFlags |= PGM_SYNC_CLEAR_PGM_POOL;
    174             VM_FF_SET(pVM, VM_FF_PGM_SYNC_CR3);
    175         }
     171        if (rc == VINF_PGM_SYNC_CR3)
     172            rc = VINF_PGM_GCPHYS_ALIASED;
    176173        pVM->pgm.s.fPhysCacheFlushPending = true;
    177174        HWACCMFlushTLB(pVM);
     
    203200 * @returns VBox status code.
    204201 * @retval  VINF_SUCCESS when shadow PTs was successfully updated.
    205  * @retval  VINF_PGM_GCPHYS_ALIASED when the shadow PTs could be updated because
    206  *          the guest page aliased or/and mapped by multiple PTs.
     202 * @retval  VINF_PGM_SYNC_CR3 when the shadow PTs could be updated because
     203 *          the guest page aliased or/and mapped by multiple PTs. FFs set.
    207204 * @param   pVM     The VM handle.
    208205 * @param   pCur    The physical handler.
     
    441438    int rc = pgmPoolTrackFlushGCPhys(pVM, pPage, &fFlushTLBs);
    442439    AssertLogRelRCReturnVoid(rc);
    443     if (rc == VINF_PGM_GCPHYS_ALIASED)
    444     {
    445         pVM->pgm.s.fSyncFlags |= PGM_SYNC_CLEAR_PGM_POOL;
    446         VM_FF_SET(pVM, VM_FF_PGM_SYNC_CR3);
    447         rc = VINF_PGM_SYNC_CR3;
    448     }
    449440# ifdef IN_RC
    450     else if (fFlushTLBs)
     441    if (fFlushTLBs && rc != VINF_PGM_SYNC_CR3)
    451442        PGM_INVL_GUEST_TLBS();
    452443# else
     
    580571                     */
    581572                    rc = pgmHandlerPhysicalSetRamFlagsAndFlushShadowPTs(pVM, pCur, pRam);
    582                     if (rc == VINF_PGM_GCPHYS_ALIASED)
    583                     {
    584                         pVM->pgm.s.fSyncFlags |= PGM_SYNC_CLEAR_PGM_POOL;
    585                         VM_FF_SET(pVM, VM_FF_PGM_SYNC_CR3);
    586                     }
    587573                    pVM->pgm.s.fPhysCacheFlushPending = true;
    588574
     
    891877                     */
    892878                    rc = pgmHandlerPhysicalSetRamFlagsAndFlushShadowPTs(pVM, pCur, pRam);
    893                     if (rc == VINF_PGM_GCPHYS_ALIASED)
    894                     {
    895                         pVM->pgm.s.fSyncFlags |= PGM_SYNC_CLEAR_PGM_POOL;
    896                         VM_FF_SET(pVM, VM_FF_PGM_SYNC_CR3);
    897                     }
    898879                    pVM->pgm.s.fPhysCacheFlushPending = true;
    899880                    HWACCMFlushTLB(pVM);
  • trunk/src/VBox/VMM/VMMAll/PGMAllPhys.cpp

    r18230 r18266  
    382382    bool fFlushTLBs = false;
    383383    int rc = pgmPoolTrackFlushGCPhys(pVM, pPage, &fFlushTLBs);
    384     if (rc == VINF_SUCCESS)
    385         /* nothing */;
    386     else if (rc == VINF_PGM_GCPHYS_ALIASED)
    387     {
    388         pVM->pgm.s.fSyncFlags |= PGM_SYNC_CLEAR_PGM_POOL;
    389         VM_FF_SET(pVM, VM_FF_PGM_SYNC_CR3);
    390         rc = VINF_PGM_SYNC_CR3;
    391     }
    392     else
    393     {
    394         AssertRCReturn(rc, rc);
    395         AssertMsgFailedReturn(("%Rrc\n", rc), VERR_INTERNAL_ERROR);
    396     }
     384    AssertMsgReturn(rc == VINF_SUCCESS || rc == VINF_PGM_GCPHYS_ALIASED, ("%Rrc\n", rc), RT_FAILURE(rc) ? rc : VERR_INTERNAL_ERROR);
    397385
    398386    /*
  • trunk/src/VBox/VMM/VMMAll/PGMAllPool.cpp

    r18215 r18266  
    26302630 * @returns VBox status code.
    26312631 * @retval  VINF_SUCCESS if all references has been successfully cleared.
    2632  * @retval  VINF_PGM_GCPHYS_ALIASED if we're better off with a CR3 sync and
    2633  *          a page pool cleaning.
     2632 * @retval  VINF_PGM_SYNC_CR3 if we're better off with a CR3 sync and a page
     2633 *          pool cleaning. FF and sync flags are set.
    26342634 *
    26352635 * @param   pVM         The VM handle.
     
    27062706    rc = VINF_PGM_GCPHYS_ALIASED;
    27072707#endif
     2708
     2709    if (rc == VINF_PGM_GCPHYS_ALIASED)
     2710    {
     2711        pVM->pgm.s.fSyncFlags |= PGM_SYNC_CLEAR_PGM_POOL;
     2712        VM_FF_SET(pVM, VM_FF_PGM_SYNC_CR3);
     2713        rc = VINF_PGM_SYNC_CR3;
     2714    }
    27082715
    27092716    return rc;
     
    39543961    }
    39553962
    3956     /* Force a shadow mode reinit (necessary for nested paging and ept). */
     3963    /*
     3964     * Force a shadow mode reinit (necessary for nested paging and ept).
     3965     * Reinit the current shadow paging mode as well; nested paging and
     3966     * EPT use a root CR3 which will get flushed here.
     3967     */
    39573968    pVM->pgm.s.enmShadowMode = PGMMODE_INVALID;
    3958 
    3959     /* Reinit the current shadow paging mode as well; nested paging and EPT use a root CR3 which will get flushed here. */
    39603969    rc = PGMR3ChangeMode(pVM, PGMGetGuestMode(pVM));
    39613970    AssertRC(rc);
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