VirtualBox

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


Ignore:
Timestamp:
Oct 22, 2019 9:10:18 PM (5 years ago)
Author:
vboxsync
Message:

IOM: Ring-3 commit optimization. bugref:9218

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

Legend:

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

    r81433 r81462  
    357357
    358358
     359#ifdef IN_RING3
     360/**
     361 * Helper for IOMR3ProcessForceFlag() that lives here to utilize iomMmioDoWrite et al.
     362 */
     363VBOXSTRICTRC iomR3MmioCommitWorker(PVM pVM, PVMCPU pVCpu, PIOMMMIOENTRYR3 pRegEntry, RTGCPHYS offRegion)
     364{
     365# ifdef VBOX_WITH_STATISTICS
     366    STAM_PROFILE_START(UnusedMacroArg, Prf);
     367    PIOMMMIOSTATSENTRY const pStats = iomMmioGetStats(pVM, pRegEntry);
     368# endif
     369    PPDMDEVINS const         pDevIns = pRegEntry->pDevIns;
     370    int rc = PDMCritSectEnter(pDevIns->CTX_SUFF(pCritSectRo), VERR_IGNORED);
     371    AssertRCReturn(rc, rc);
     372
     373    VBOXSTRICTRC rcStrict = iomMmioDoWrite(pVM, pVCpu, pRegEntry, pVCpu->iom.s.PendingMmioWrite.GCPhys, offRegion,
     374                                           pVCpu->iom.s.PendingMmioWrite.abValue, pVCpu->iom.s.PendingMmioWrite.cbValue
     375                                           IOM_MMIO_STATS_COMMA_ARG);
     376
     377    PDMCritSectLeave(pDevIns->CTX_SUFF(pCritSectRo));
     378    STAM_PROFILE_STOP(&pStats->ProfWriteR3, Prf);
     379    return rcStrict;
     380}
     381#endif /* IN_RING3 */
     382
     383
    359384/**
    360385 * Deals with complicated MMIO reads.
  • trunk/src/VBox/VMM/VMMR3/IOM.cpp

    r81437 r81462  
    19141914              pVCpu->iom.s.PendingMmioWrite.GCPhys, pVCpu->iom.s.PendingMmioWrite.cbValue));
    19151915
    1916 #if 0
    19171916        /* Use new MMIO handle hint and bypass PGM if it still looks right. */
    19181917        size_t idxMmioRegionHint = pVCpu->iom.s.PendingMmioWrite.idxMmioRegionHint;
     
    19241923            if (offRegion < pRegEntry->cbRegion && GCPhysMapping != NIL_RTGCPHYS)
    19251924            {
    1926                 rcStrict = iomMmioDoWrite(pVM, pVCpu, pRegEntry, GCPhysFault, offRegion, pvBuf, (uint32_t)cbBuf IOM_MMIO_STATS_COMMA_ARG);
    1927                 PDMCritSectLeave(pDevIns->CTX_SUFF(pCritSectRo));
    1928                 STAM_COUNTER_INC(&pStats->Writes);
    1929                 STAM_PROFILE_STOP(&pStats->CTX_SUFF_Z(ProfWrite), Prf);
     1925                VBOXSTRICTRC rcStrictCommit = iomR3MmioCommitWorker(pVM, pVCpu, pRegEntry, offRegion);
     1926                pVCpu->iom.s.PendingMmioWrite.cbValue = 0;
     1927                return iomR3MergeStatus(rcStrict, rcStrictCommit, VINF_IOM_R3_MMIO_COMMIT_WRITE, pVCpu);
    19301928            }
    19311929        }
    1932 #endif
    1933 
    1934         /** @todo Try optimize this some day?  Currently easier and more correct to
    1935          *        involve PGM here since we never know if the MMIO area is still mapped
    1936          *        to the same location as when we wrote to it in RC/R0 context. */
     1930
     1931        /* Fall back on PGM. */
    19371932        VBOXSTRICTRC rcStrictCommit = PGMPhysWrite(pVM, pVCpu->iom.s.PendingMmioWrite.GCPhys,
    19381933                                                   pVCpu->iom.s.PendingMmioWrite.abValue, pVCpu->iom.s.PendingMmioWrite.cbValue,
  • trunk/src/VBox/VMM/include/IOMInternal.h

    r81375 r81462  
    853853DECLCALLBACK(void)  iomR3MmioInfo(PVM pVM, PCDBGFINFOHLP pHlp, const char *pszArgs);
    854854void                iomR3MmioRegStats(PVM pVM, PIOMMMIOENTRYR3 pRegEntry);
     855VBOXSTRICTRC        iomR3MmioCommitWorker(PVM pVM, PVMCPU pVCpu, PIOMMMIOENTRYR3 pRegEntry, RTGCPHYS offRegion); /* IOMAllMmioNew.cpp */
    855856#endif /* IN_RING3 */
    856857#ifdef IN_RING0
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