VirtualBox

Changeset 72657 in vbox


Ignore:
Timestamp:
Jun 22, 2018 11:05:11 AM (6 years ago)
Author:
vboxsync
Message:

EM: Make the EMHistoryExec parameters adjustable. bugref:9198

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

Legend:

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

    r72655 r72657  
    472472            VBOXSTRICTRC rcStrict = IEMExecForExits(pVCpu, fWillExit,
    473473                                                    pExitRec->cMaxInstructionsWithoutExit /* cMinInstructions*/,
    474                                                     4096 /*cMaxInstructions*/,
     474                                                    pVCpu->em.s.cHistoryExecMaxInstructions,
    475475                                                    pExitRec->cMaxInstructionsWithoutExit,
    476476                                                    &ExecStats);
     
    494494            PEMEXITREC   pExitRecUnconst = (PEMEXITREC)pExitRec;
    495495            VBOXSTRICTRC rcStrict = IEMExecForExits(pVCpu, fWillExit,
    496                                                     64 /*cMinInstructions*/,
    497                                                     4096 /*cMaxInstructions*/,
    498                                                     32 /*cMaxInstructionsWithoutExit*/,
     496                                                    pVCpu->em.s.cHistoryProbeMinInstructions,
     497                                                    pVCpu->em.s.cHistoryExecMaxInstructions,
     498                                                    pVCpu->em.s.cHistoryProbeMaxInstructionsWithoutExit,
    499499                                                    &ExecStats);
    500500            LogFlow(("EMHistoryExec/EXEC_PROBE: %Rrc cExits=%u cMaxExitDistance=%u cInstructions=%u\n",
  • trunk/src/VBox/VMM/VMMR3/EM.cpp

    r72643 r72657  
    183183        pVM->aCpus[i].em.s.fExitOptimizationEnabledR0                = fExitOptimizationEnabledR0;
    184184        pVM->aCpus[i].em.s.fExitOptimizationEnabledR0PreemptDisabled = fExitOptimizationEnabledR0PreemptDisabled;
     185
     186        pVM->aCpus[i].em.s.cHistoryExecMaxInstructions               = 8192;
     187        pVM->aCpus[i].em.s.cHistoryProbeMinInstructions              = 48;
     188        pVM->aCpus[i].em.s.cHistoryProbeMaxInstructionsWithoutExit   = 24;
     189#ifdef RT_OS_WINDOWS
     190        if (VM_IS_NEM_ENABLED(pVM))
     191        {
     192            pVM->aCpus[i].em.s.cHistoryProbeMaxInstructionsWithoutExit = 32;
     193            pVM->aCpus[i].em.s.cHistoryProbeMinInstructions            = 64;
     194        }
     195#endif
    185196    }
    186197
  • trunk/src/VBox/VMM/include/EMInternal.h

    r72642 r72657  
    503503     * wrapped around or not.  */
    504504    uint64_t                iNextExit;
     505
     506    /** Index into aExitRecords set by EMHistoryExec when returning to ring-3.
     507     * This is UINT16_MAX if not armed.  */
     508    uint16_t volatile       idxContinueExitRec;
    505509    /** Whether exit optimizations are enabled or not (in general). */
    506510    bool                    fExitOptimizationEnabled : 1;
     
    510514    bool                    fExitOptimizationEnabledR0PreemptDisabled : 1;
    511515    /** Explicit padding. */
    512     bool                    afPadding2[1];
    513     /** Index into aExitRecords set by EMHistoryExec when returning to ring-3.
    514      * This is UINT16_MAX if not armed.  */
    515     uint16_t volatile       idxContinueExitRec;
     516    bool                    fPadding2;
     517    /** Max number of instructions to execute. */
     518    uint16_t                cHistoryExecMaxInstructions;
     519    /** Min number of instructions to execute while probing. */
     520    uint16_t                cHistoryProbeMinInstructions;
     521    /** Max number of instructions to execute without an exit before giving up probe. */
     522    uint16_t                cHistoryProbeMaxInstructionsWithoutExit;
     523    uint16_t                uPadding3;
    516524    /** Number of exit records in use. */
    517525    uint32_t                cExitRecordUsed;
     
    522530    /** Number of instructions executed by EMHistoryExec. */
    523531    STAMCOUNTER             StatHistoryExecInstructions;
    524     uint64_t                aPadding3[2];
     532    uint64_t                uPadding4;
    525533    /** Number of instructions executed by EMHistoryExec when probing. */
    526534    STAMCOUNTER             StatHistoryProbeInstructions;
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