VirtualBox

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


Ignore:
Timestamp:
Sep 27, 2007 11:06:28 AM (17 years ago)
Author:
vboxsync
Message:

Limit the amount of resume loops

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

Legend:

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

    r4811 r5073  
    194194    STAM_REG(pVM, &pVM->hwaccm.s.StatExitIOStringRead,    STAMTYPE_COUNTER, "/HWACCM/Exit/IO/ReadString",           STAMUNIT_OCCURENCES,    "Nr of occurances");
    195195    STAM_REG(pVM, &pVM->hwaccm.s.StatExitIrqWindow, STAMTYPE_COUNTER, "/HWACCM/Exit/GuestIrq/Pending",  STAMUNIT_OCCURENCES,    "Nr of occurances");
     196    STAM_REG(pVM, &pVM->hwaccm.s.StatExitMaxResume, STAMTYPE_COUNTER, "/HWACCM/Exit/Safety/MaxResume",  STAMUNIT_OCCURENCES,    "Nr of occurances");
    196197
    197198    STAM_REG(pVM, &pVM->hwaccm.s.StatSwitchGuestIrq,STAMTYPE_COUNTER, "/HWACCM/Switch/IrqPending",      STAMUNIT_OCCURENCES,    "Nr of occurances");
  • trunk/src/VBox/VMM/HWACCMInternal.h

    r4071 r5073  
    106106/** @} */
    107107
     108
     109/** @name Maxium resume loops allowed in ring 0 (safety precaution) */
     110#define HWACCM_MAX_RESUME_LOOPS             1024
    108111
    109112/** @name HWACCM SSM version
     
    290293    STAMCOUNTER             StatExitIOStringRead;
    291294    STAMCOUNTER             StatExitIrqWindow;
     295    STAMCOUNTER             StatExitMaxResume;
    292296    STAMCOUNTER             StatIntReinject;
    293297    STAMCOUNTER             StatPendingHostIrq;
  • trunk/src/VBox/VMM/VMMR0/HWSVMR0.cpp

    r4789 r5073  
    509509    bool        fForceTLBFlush = false;
    510510    bool        fGuestStateSynced = false;
     511    unsigned    cResume = 0;
    511512
    512513    STAM_PROFILE_ADV_START(&pVM->hwaccm.s.StatEntry, x);
     
    518519     */
    519520ResumeExecution:
     521    /* Safety precaution; looping for too long here can have a very bad effect on the host */
     522    if (++cResume > HWACCM_MAX_RESUME_LOOPS)
     523    {
     524        STAM_COUNTER_INC(&pVM->hwaccm.s.StatExitMaxResume);
     525        rc = VINF_EM_RAW_INTERRUPT;
     526        goto end;
     527    }
    520528
    521529    /* Check for irq inhibition due to instruction fusing (sti, mov ss). */
  • trunk/src/VBox/VMM/VMMR0/HWVMXR0.cpp

    r4932 r5073  
    863863    RTGCUINTPTR errCode, instrInfo, uInterruptState;
    864864    bool        fGuestStateSynced = false;
     865    unsigned    cResume = 0;
    865866
    866867    Log2(("\nE"));
     
    946947     */
    947948ResumeExecution:
     949    /* Safety precaution; looping for too long here can have a very bad effect on the host */
     950    if (++cResume > HWACCM_MAX_RESUME_LOOPS)
     951    {
     952        STAM_COUNTER_INC(&pVM->hwaccm.s.StatExitMaxResume);
     953        rc = VINF_EM_RAW_INTERRUPT;
     954        goto end;
     955    }
    948956
    949957    /* Check for irq inhibition due to instruction fusing (sti, mov ss). */
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