VirtualBox

Changeset 19440 in vbox


Ignore:
Timestamp:
May 6, 2009 3:19:56 PM (16 years ago)
Author:
vboxsync
Message:

Deal with pause/resume for pause & wait for sipi states.

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

Legend:

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

    r19426 r19440  
    163163
    164164        pVCpu->em.s.enmState     = (i == 0) ? EMSTATE_NONE : EMSTATE_WAIT_SIPI;
     165        pVCpu->em.s.enmPrevState = EMSTATE_NONE;
    165166        pVCpu->em.s.fForceRAW    = false;
    166167
     
    36153616        /* Reschedule right away to start in the right state. */
    36163617        rc = VINF_SUCCESS;
    3617         pVCpu->em.s.enmState = emR3Reschedule(pVM, pVCpu, pVCpu->em.s.pCtx);
     3618
     3619        /** @todo doesn't work for the save/restore case */
     3620        if (    pVCpu->em.s.enmState == EMSTATE_SUSPENDED
     3621            &&  (   pVCpu->em.s.enmPrevState == EMSTATE_WAIT_SIPI
     3622                 || pVCpu->em.s.enmPrevState == EMSTATE_HALTED))
     3623        {
     3624            /* Pause->Resume: Restore the old wait state or else we'll start executing code. */
     3625            pVCpu->em.s.enmState = pVCpu->em.s.enmPrevState;
     3626        }
     3627        else
     3628            pVCpu->em.s.enmState = emR3Reschedule(pVM, pVCpu, pVCpu->em.s.pCtx);
    36183629
    36193630        STAM_REL_PROFILE_ADV_START(&pVCpu->em.s.StatTotal, x);
     
    37213732                case VINF_EM_SUSPEND:
    37223733                    Log2(("EMR3ExecuteVM: VINF_EM_SUSPEND: %d -> %d\n", pVCpu->em.s.enmState, EMSTATE_SUSPENDED));
    3723                     pVCpu->em.s.enmState = EMSTATE_SUSPENDED;
     3734                    pVCpu->em.s.enmPrevState = pVCpu->em.s.enmState;
     3735                    pVCpu->em.s.enmState     = EMSTATE_SUSPENDED;
    37243736                    break;
    37253737
  • trunk/src/VBox/VMM/EMInternal.h

    r19278 r19440  
    4444/** The saved state version. */
    4545#define EM_SAVED_STATE_VERSION                      2
    46 
    47 /** Enable for tracing in raw mode.
    48  * @remark SvL: debugging help primarily for myself. */
    49 #define DEBUG_TRACING_ENABLED
    5046
    5147/**
     
    314310    /** Execution Manager State. */
    315311    EMSTATE volatile        enmState;
     312
     313    /** Previous Execution Manager State. */
     314    EMSTATE                 enmPrevState;
     315
    316316    /** Force raw-mode execution.
    317317     * This is used to prevent REM from trying to execute patch code.
     
    319319    bool                    fForceRAW;
    320320
    321 #ifdef DEBUG_TRACING_ENABLED
    322     /** @see DEBUG_TRACING_ENABLED */
    323     bool                    fTracing;
    324 #endif
    325 
    326     uint8_t                 u8Padding[GC_ARCH_BITS == 64 ? 6 : 2];
     321    uint8_t                 u8Padding[3];
    327322
    328323    /** Inhibit interrupts for this instruction. Valid only when VM_FF_INHIBIT_INTERRUPTS is set. */
    329324    RTGCUINTPTR             GCPtrInhibitInterrupts;
    330 
    331325
    332326    /** Pointer to the PATM status structure. (R3 Ptr) */
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