VirtualBox

Changeset 19141 in vbox for trunk/include/VBox


Ignore:
Timestamp:
Apr 23, 2009 1:52:18 PM (16 years ago)
Author:
vboxsync
Message:

Action flags breakup.
Fixed PGM saved state loading of 2.2.2 images.
Reduced hacks in PATM state loading (fixups).

Location:
trunk/include/VBox
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/VBox/csam.h

    r12989 r19141  
    259259 * @returns VBox status code.
    260260 * @param   pVM         The VM to operate on.
    261  */
    262 VMMR3DECL(int) CSAMR3DoPendingAction(PVM pVM);
     261 * @param   pVCpu       The VMCPU to operate on.
     262 */
     263VMMR3DECL(int) CSAMR3DoPendingAction(PVM pVM, PVMCPU pVCpu);
    263264
    264265/**
  • trunk/include/VBox/em.h

    r18927 r19141  
    117117#define EMIsRawRing0Enabled(pVM) ((pVM)->fRawR0Enabled)
    118118
    119 VMMDECL(void)       EMSetInhibitInterruptsPC(PVM pVM, PVMCPU pVCpu, RTGCUINTPTR PC);
    120 VMMDECL(RTGCUINTPTR) EMGetInhibitInterruptsPC(PVM pVM, PVMCPU pVCpu);
     119VMMDECL(void)       EMSetInhibitInterruptsPC(PVMCPU pVCpu, RTGCUINTPTR PC);
     120VMMDECL(RTGCUINTPTR) EMGetInhibitInterruptsPC(PVMCPU pVCpu);
    121121VMMDECL(int)        EMInterpretDisasOne(PVM pVM, PVMCPU pVCpu, PCCPUMCTXCORE pCtxCore, PDISCPUSTATE pCpu, unsigned *pcbInstr);
    122122VMMDECL(int)        EMInterpretDisasOneEx(PVM pVM, PVMCPU pVCpu, RTGCUINTPTR GCPtrInstr, PCCPUMCTXCORE pCtxCore,
  • trunk/include/VBox/pdmapi.h

    r18618 r19141  
    4343 */
    4444
    45 VMMDECL(int)    PDMGetInterrupt(PVM pVM, uint8_t *pu8Interrupt);
     45VMMDECL(int)    PDMGetInterrupt(PVMCPU pVCpu, uint8_t *pu8Interrupt);
    4646VMMDECL(int)    PDMIsaSetIrq(PVM pVM, uint8_t u8Irq, uint8_t u8Level);
    4747VMMDECL(int)    PDMIoApicSetIrq(PVM pVM, uint8_t u8Irq, uint8_t u8Level);
  • trunk/include/VBox/vm.h

    r19015 r19141  
    8282    /** Per CPU forced action.
    8383     * See the VMCPU_FF_* \#defines. Updated atomically. */
    84     uint32_t volatile       fForcedActions;
     84    uint32_t volatile       fLocalForcedActions;
    8585    /** The CPU state. */
    8686    VMCPUSTATE volatile     enmState;
     
    187187 * @{
    188188 */
    189 /** This action forces the VM to service check and pending interrups on the APIC. */
    190 #define VM_FF_INTERRUPT_APIC            RT_BIT_32(0)
    191 /** This action forces the VM to service check and pending interrups on the PIC. */
    192 #define VM_FF_INTERRUPT_PIC             RT_BIT_32(1)
    193189/** This action forces the VM to schedule and run pending timer (TM). */
    194 #define VM_FF_TIMER                     RT_BIT_32(2)
     190#define VM_FF_TIMER                         RT_BIT_32(2)
    195191/** PDM Queues are pending. */
    196 #define VM_FF_PDM_QUEUES                RT_BIT_32(3)
     192#define VM_FF_PDM_QUEUES                    RT_BIT_32(3)
    197193/** PDM DMA transfers are pending. */
    198 #define VM_FF_PDM_DMA                   RT_BIT_32(4)
     194#define VM_FF_PDM_DMA                       RT_BIT_32(4)
    199195/** PDM critical section unlocking is pending, process promptly upon return to R3. */
    200 #define VM_FF_PDM_CRITSECT              RT_BIT_32(5)
    201 
     196#define VM_FF_PDM_CRITSECT                  RT_BIT_32(5)
    202197/** This action forces the VM to call DBGF so DBGF can service debugger
    203198 * requests in the emulation thread.
    204199 * This action flag stays asserted till DBGF clears it.*/
    205 #define VM_FF_DBGF                      RT_BIT_32(8)
     200#define VM_FF_DBGF                          RT_BIT_32(8)
    206201/** This action forces the VM to service pending requests from other
    207202 * thread or requests which must be executed in another context. */
    208 #define VM_FF_REQUEST                   RT_BIT_32(9)
     203#define VM_FF_REQUEST                       RT_BIT_32(9)
    209204/** Terminate the VM immediately. */
    210 #define VM_FF_TERMINATE                 RT_BIT_32(10)
     205#define VM_FF_TERMINATE                     RT_BIT_32(10)
    211206/** Reset the VM. (postponed) */
    212 #define VM_FF_RESET                     RT_BIT_32(11)
    213 
    214 /** This action forces the VM to resync the page tables before going
    215  * back to execute guest code. (GLOBAL FLUSH) */
    216 #define VM_FF_PGM_SYNC_CR3              RT_BIT_32(16)
    217 /** Same as VM_FF_PGM_SYNC_CR3 except that global pages can be skipped.
    218  * (NON-GLOBAL FLUSH) */
    219 #define VM_FF_PGM_SYNC_CR3_NON_GLOBAL   RT_BIT_32(17)
     207#define VM_FF_RESET                         RT_BIT_32(11)
    220208/** PGM needs to allocate handy pages. */
    221 #define VM_FF_PGM_NEED_HANDY_PAGES      RT_BIT_32(18)
     209#define VM_FF_PGM_NEED_HANDY_PAGES          RT_BIT_32(18)
    222210/** PGM is out of memory.
    223211 * Abandon all loops and code paths which can be resumed and get up to the EM
    224212 * loops. */
    225 #define VM_FF_PGM_NO_MEMORY             RT_BIT_32(19)
     213#define VM_FF_PGM_NO_MEMORY                 RT_BIT_32(19)
     214/** REM needs to be informed about handler changes. */
     215#define VM_FF_REM_HANDLER_NOTIFY            RT_BIT_32(29)
     216/** Suspend the VM - debug only. */
     217#define VM_FF_DEBUG_SUSPEND                 RT_BIT_32(31)
     218
     219
     220/** This action forces the VM to service check and pending interrups on the APIC. */
     221#define VMCPU_FF_INTERRUPT_APIC             RT_BIT_32(0)
     222/** This action forces the VM to service check and pending interrups on the PIC. */
     223#define VMCPU_FF_INTERRUPT_PIC              RT_BIT_32(1)
     224/** This action forces the VM to schedule and run pending timer (TM). (bogus for now; needed for PATM backwards compatibility) */
     225#define VMCPU_FF_TIMER                      RT_BIT_32(2)
     226/** This action forces the VM to service pending requests from other
     227 * thread or requests which must be executed in another context. */
     228#define VMCPU_FF_REQUEST                    RT_BIT_32(9)
     229/** This action forces the VM to resync the page tables before going
     230 * back to execute guest code. (GLOBAL FLUSH) */
     231#define VMCPU_FF_PGM_SYNC_CR3               RT_BIT_32(16)
     232/** Same as VM_FF_PGM_SYNC_CR3 except that global pages can be skipped.
     233 * (NON-GLOBAL FLUSH) */
     234#define VMCPU_FF_PGM_SYNC_CR3_NON_GLOBAL    RT_BIT_32(17)
    226235/** Check the interupt and trap gates */
    227 #define VM_FF_TRPM_SYNC_IDT             RT_BIT_32(20)
     236#define VMCPU_FF_TRPM_SYNC_IDT              RT_BIT_32(20)
    228237/** Check Guest's TSS ring 0 stack */
    229 #define VM_FF_SELM_SYNC_TSS             RT_BIT_32(21)
     238#define VMCPU_FF_SELM_SYNC_TSS              RT_BIT_32(21)
    230239/** Check Guest's GDT table */
    231 #define VM_FF_SELM_SYNC_GDT             RT_BIT_32(22)
     240#define VMCPU_FF_SELM_SYNC_GDT              RT_BIT_32(22)
    232241/** Check Guest's LDT table */
    233 #define VM_FF_SELM_SYNC_LDT             RT_BIT_32(23)
     242#define VMCPU_FF_SELM_SYNC_LDT              RT_BIT_32(23)
    234243/** Inhibit interrupts pending. See EMGetInhibitInterruptsPC(). */
    235 #define VM_FF_INHIBIT_INTERRUPTS        RT_BIT_32(24)
    236 
     244#define VMCPU_FF_INHIBIT_INTERRUPTS         RT_BIT_32(24)
    237245/** CSAM needs to scan the page that's being executed */
    238 #define VM_FF_CSAM_SCAN_PAGE            RT_BIT_32(26)
     246#define VMCPU_FF_CSAM_SCAN_PAGE             RT_BIT_32(26)
    239247/** CSAM needs to do some homework. */
    240 #define VM_FF_CSAM_PENDING_ACTION       RT_BIT_32(27)
    241 
     248#define VMCPU_FF_CSAM_PENDING_ACTION        RT_BIT_32(27)
    242249/** Force return to Ring-3. */
    243 #define VM_FF_TO_R3                     RT_BIT_32(28)
    244 
    245 /** REM needs to be informed about handler changes. */
    246 #define VM_FF_REM_HANDLER_NOTIFY        RT_BIT_32(29)
    247 
    248 /** Suspend the VM - debug only. */
    249 #define VM_FF_DEBUG_SUSPEND             RT_BIT_32(31)
    250 
    251 /** Externally forced actions. Used to quit the idle/wait loop. */
    252 #define VM_FF_EXTERNAL_SUSPENDED_MASK   (VM_FF_TERMINATE | VM_FF_DBGF | VM_FF_REQUEST)
    253 /** Externally forced actions. Used to quit the idle/wait loop. */
    254 #define VM_FF_EXTERNAL_HALTED_MASK      (VM_FF_TERMINATE | VM_FF_DBGF | VM_FF_TIMER | VM_FF_INTERRUPT_APIC | VM_FF_INTERRUPT_PIC | VM_FF_REQUEST | VM_FF_PDM_QUEUES | VM_FF_PDM_DMA)
    255 /** High priority pre-execution actions. */
    256 #define VM_FF_HIGH_PRIORITY_PRE_MASK    (VM_FF_TERMINATE | VM_FF_DBGF | VM_FF_INTERRUPT_APIC | VM_FF_INTERRUPT_PIC | VM_FF_TIMER | VM_FF_DEBUG_SUSPEND \
    257                                         | VM_FF_PGM_SYNC_CR3 | VM_FF_PGM_SYNC_CR3_NON_GLOBAL | VM_FF_SELM_SYNC_TSS | VM_FF_TRPM_SYNC_IDT | VM_FF_SELM_SYNC_GDT | VM_FF_SELM_SYNC_LDT | VM_FF_PGM_NEED_HANDY_PAGES | VM_FF_PGM_NO_MEMORY)
    258 /** High priority pre raw-mode execution mask. */
    259 #define VM_FF_HIGH_PRIORITY_PRE_RAW_MASK (VM_FF_PGM_SYNC_CR3 | VM_FF_PGM_SYNC_CR3_NON_GLOBAL | VM_FF_SELM_SYNC_TSS | VM_FF_TRPM_SYNC_IDT | VM_FF_SELM_SYNC_GDT | VM_FF_SELM_SYNC_LDT \
    260                                          | VM_FF_PGM_NEED_HANDY_PAGES | VM_FF_INHIBIT_INTERRUPTS | VM_FF_PGM_NO_MEMORY)
     250#define VMCPU_FF_TO_R3                      RT_BIT_32(28)
     251
     252/** Externally VM forced actions. Used to quit the idle/wait loop. */
     253#define VM_FF_EXTERNAL_SUSPENDED_MASK           (VM_FF_TERMINATE | VM_FF_DBGF | VM_FF_REQUEST)
     254/** Externally VMCPU forced actions. Used to quit the idle/wait loop. */
     255#define VMCPU_FF_EXTERNAL_SUSPENDED_MASK        (VMCPU_FF_REQUEST)
     256
     257/** Externally forced VM actions. Used to quit the idle/wait loop. */
     258#define VM_FF_EXTERNAL_HALTED_MASK              (VM_FF_TERMINATE | VM_FF_DBGF | VM_FF_TIMER | VM_FF_REQUEST | VM_FF_PDM_QUEUES | VM_FF_PDM_DMA)
     259/** Externally forced VMCPU actions. Used to quit the idle/wait loop. */
     260#define VMCPU_FF_EXTERNAL_HALTED_MASK           (VMCPU_FF_INTERRUPT_APIC | VMCPU_FF_INTERRUPT_PIC | VMCPU_FF_REQUEST)
     261
     262/** High priority VM pre-execution actions. */
     263#define VM_FF_HIGH_PRIORITY_PRE_MASK            (   VM_FF_TERMINATE | VM_FF_DBGF | VM_FF_TIMER | VM_FF_DEBUG_SUSPEND \
     264                                                 |  VM_FF_PGM_NEED_HANDY_PAGES | VM_FF_PGM_NO_MEMORY)
     265/** High priority VMCPU pre-execution actions. */
     266#define VMCPU_FF_HIGH_PRIORITY_PRE_MASK         (   VMCPU_FF_INTERRUPT_APIC | VMCPU_FF_INTERRUPT_PIC  \
     267                                                 |  VMCPU_FF_PGM_SYNC_CR3 | VMCPU_FF_PGM_SYNC_CR3_NON_GLOBAL | VMCPU_FF_SELM_SYNC_TSS | VMCPU_FF_TRPM_SYNC_IDT | VMCPU_FF_SELM_SYNC_GDT | VMCPU_FF_SELM_SYNC_LDT)
     268
     269/** High priority VM pre raw-mode execution mask. */
     270#define VM_FF_HIGH_PRIORITY_PRE_RAW_MASK        (VM_FF_PGM_NEED_HANDY_PAGES | VM_FF_PGM_NO_MEMORY)
     271/** High priority VMCPU pre raw-mode execution mask. */
     272#define VMCPU_FF_HIGH_PRIORITY_PRE_RAW_MASK     (  VMCPU_FF_PGM_SYNC_CR3 | VMCPU_FF_PGM_SYNC_CR3_NON_GLOBAL | VMCPU_FF_SELM_SYNC_TSS | VMCPU_FF_TRPM_SYNC_IDT | VMCPU_FF_SELM_SYNC_GDT | VMCPU_FF_SELM_SYNC_LDT \
     273                                                 | VMCPU_FF_INHIBIT_INTERRUPTS)
     274
    261275/** High priority post-execution actions. */
    262 #define VM_FF_HIGH_PRIORITY_POST_MASK   (VM_FF_PDM_CRITSECT | VM_FF_CSAM_PENDING_ACTION | VM_FF_PGM_NO_MEMORY)
    263 /** Normal priority post-execution actions. */
    264 #define VM_FF_NORMAL_PRIORITY_POST_MASK (VM_FF_TERMINATE | VM_FF_DBGF | VM_FF_RESET | VM_FF_CSAM_SCAN_PAGE | VM_FF_PGM_NO_MEMORY)
     276#define VM_FF_HIGH_PRIORITY_POST_MASK           (VM_FF_PDM_CRITSECT | VM_FF_PGM_NO_MEMORY)
     277/** High priority post-execution actions. */
     278#define VMCPU_FF_HIGH_PRIORITY_POST_MASK        (VMCPU_FF_CSAM_PENDING_ACTION)
     279
     280/** Normal priority VM post-execution actions. */
     281#define VM_FF_NORMAL_PRIORITY_POST_MASK         (VM_FF_TERMINATE | VM_FF_DBGF | VM_FF_RESET | VM_FF_PGM_NO_MEMORY)
     282/** Normal priority VMCPU post-execution actions. */
     283#define VMCPU_FF_NORMAL_PRIORITY_POST_MASK      (VMCPU_FF_CSAM_SCAN_PAGE)
     284
    265285/** Normal priority actions. */
    266 #define VM_FF_NORMAL_PRIORITY_MASK      (VM_FF_REQUEST | VM_FF_PDM_QUEUES | VM_FF_PDM_DMA | VM_FF_REM_HANDLER_NOTIFY)
     286#define VM_FF_NORMAL_PRIORITY_MASK              (VM_FF_REQUEST | VM_FF_PDM_QUEUES | VM_FF_PDM_DMA | VM_FF_REM_HANDLER_NOTIFY)
     287
    267288/** Flags to clear before resuming guest execution. */
    268 #define VM_FF_RESUME_GUEST_MASK         (VM_FF_TO_R3)
    269 /** Flags that causes the HWACCM loops to go back to ring-3. */
    270 #define VM_FF_HWACCM_TO_R3_MASK         (VM_FF_TO_R3 | VM_FF_TIMER | VM_FF_PGM_NEED_HANDY_PAGES | VM_FF_PGM_NO_MEMORY)
     289#define VMCPU_FF_RESUME_GUEST_MASK              (VMCPU_FF_TO_R3)
     290
     291/** VM Flags that cause the HWACCM loops to go back to ring-3. */
     292#define VM_FF_HWACCM_TO_R3_MASK                 (VM_FF_TIMER | VM_FF_PGM_NEED_HANDY_PAGES | VM_FF_PGM_NO_MEMORY)
     293/** VMCPU Flags that cause the HWACCM loops to go back to ring-3. */
     294#define VMCPU_FF_HWACCM_TO_R3_MASK               (VMCPU_FF_TO_R3)
     295
    271296/** All the forced flags. */
    272 #define VM_FF_ALL_MASK                  (~0U)
    273 /** All the forced flags. */
    274 #define VM_FF_ALL_BUT_RAW_MASK          (~(VM_FF_HIGH_PRIORITY_PRE_RAW_MASK | VM_FF_CSAM_PENDING_ACTION | VM_FF_PDM_CRITSECT) | VM_FF_PGM_NO_MEMORY)
     297#define VM_FF_ALL_MASK                          (~0U)
     298/** All the forced VM flags. */
     299#define VM_FF_ALL_BUT_RAW_MASK                  (~(VM_FF_HIGH_PRIORITY_PRE_RAW_MASK | VM_FF_PDM_CRITSECT) | VM_FF_PGM_NO_MEMORY)
     300/** All the forced VMCPU flags. */
     301#define VMCPU_FF_ALL_BUT_RAW_MASK               (~(VMCPU_FF_HIGH_PRIORITY_PRE_RAW_MASK | VMCPU_FF_CSAM_PENDING_ACTION))
    275302
    276303/** @} */
     
    283310 */
    284311#if 1
    285 # define VM_FF_SET(pVM, fFlag)              ASMAtomicOrU32(&(pVM)->fForcedActions, (fFlag))
     312# define VM_FF_SET(pVM, fFlag)              ASMAtomicOrU32(&(pVM)->fGlobalForcedActions, (fFlag))
    286313#else
    287314# define VM_FF_SET(pVM, fFlag) \
    288     do { ASMAtomicOrU32(&(pVM)->fForcedActions, (fFlag)); \
    289          RTLogPrintf("VM_FF_SET  : %08x %s - %s(%d) %s\n", (pVM)->fForcedActions, #fFlag, __FILE__, __LINE__, __FUNCTION__); \
     315    do { ASMAtomicOrU32(&(pVM)->fGlobalForcedActions, (fFlag)); \
     316         RTLogPrintf("VM_FF_SET  : %08x %s - %s(%d) %s\n", (pVM)->fGlobalForcedActions, #fFlag, __FILE__, __LINE__, __FUNCTION__); \
    290317    } while (0)
    291318#endif
    292319
    293320/** @def VMCPU_FF_SET
    294  * Sets a force action flag for given VCPU.
    295  *
    296  * @param   pVM     VM Handle.
    297  * @param   idCpu   Virtual CPU ID.
     321 * Sets a force action flag for the given VCPU.
     322 *
     323 * @param   pVCpu     VMCPU Handle.
    298324 * @param   fFlag   The flag to set.
    299325 */
    300 #ifdef VBOX_WITH_SMP_GUESTS
    301 # define VMCPU_FF_SET(pVM, idCpu, fFlag)    ASMAtomicOrU32(&(pVM)->aCpu[idCpu].fForcedActions, (fFlag))
    302 #else
    303 # define VMCPU_FF_SET(pVM, idCpu, fFlag)    VM_FF_SET(pVM, fFlag)
     326#if 1 //def VBOX_WITH_SMP_GUESTS
     327# define VMCPU_FF_SET(pVCpu, fFlag)    ASMAtomicOrU32(&(pVCpu)->fLocalForcedActions, (fFlag))
     328#else
     329# define VMCPU_FF_SET(pVCpu, fFlag)    ASMAtomicOrU32(&(pVCpu)->CTX_SUFF(pVM)->fGlobalForcedActions, (fFlag))
    304330#endif
    305331
     
    311337 */
    312338#if 1
    313 # define VM_FF_CLEAR(pVM, fFlag)            ASMAtomicAndU32(&(pVM)->fForcedActions, ~(fFlag))
     339# define VM_FF_CLEAR(pVM, fFlag)            ASMAtomicAndU32(&(pVM)->fGlobalForcedActions, ~(fFlag))
    314340#else
    315341# define VM_FF_CLEAR(pVM, fFlag) \
    316     do { ASMAtomicAndU32(&(pVM)->fForcedActions, ~(fFlag)); \
    317          RTLogPrintf("VM_FF_CLEAR: %08x %s - %s(%d) %s\n", (pVM)->fForcedActions, #fFlag, __FILE__, __LINE__, __FUNCTION__); \
     342    do { ASMAtomicAndU32(&(pVM)->fGlobalForcedActions, ~(fFlag)); \
     343         RTLogPrintf("VM_FF_CLEAR: %08x %s - %s(%d) %s\n", (pVM)->fGlobalForcedActions, #fFlag, __FILE__, __LINE__, __FUNCTION__); \
    318344    } while (0)
    319345#endif
    320346
    321347/** @def VMCPU_FF_CLEAR
    322  * Clears a force action flag for given VCPU.
    323  *
    324  * @param   pVM     VM Handle.
    325  * @param   idCpu   Virtual CPU ID.
     348 * Clears a force action flag for the given VCPU.
     349 *
     350 * @param   pVCpu     VMCPU Handle.
    326351 * @param   fFlag   The flag to clear.
    327352 */
    328 #ifdef VBOX_WITH_SMP_GUESTS
    329 # define VMCPU_FF_CLEAR(pVM, idCpu, fFlag)  ASMAtomicAndU32(&(pVM)->aCpu[idCpu].fForcedActions, ~(fFlag))
    330 #else
    331 # define VMCPU_FF_CLEAR(pVM, idCpu, fFlag)  VM_FF_CLEAR(pVM, fFlag)
     353#if 1 //def VBOX_WITH_SMP_GUESTS
     354# define VMCPU_FF_CLEAR(pVCpu, fFlag)  ASMAtomicAndU32(&(pVCpu)->fLocalForcedActions, ~(fFlag))
     355#else
     356# define VMCPU_FF_CLEAR(pVCpu, fFlag)  ASMAtomicAndU32(&(pVCpu)->CTX_SUFF(pVM)->fGlobalForcedActions, ~(fFlag))
    332357#endif
    333358
     
    338363 * @param   fFlag   The flag to check.
    339364 */
    340 #define VM_FF_ISSET(pVM, fFlag)             (((pVM)->fForcedActions & (fFlag)) == (fFlag))
     365#define VM_FF_ISSET(pVM, fFlag)             (((pVM)->fGlobalForcedActions & (fFlag)) == (fFlag))
    341366
    342367/** @def VMCPU_FF_ISSET
    343  * Checks if a force action flag is set for given VCPU.
    344  *
    345  * @param   pVM     VM Handle.
    346  * @param   idCpu   Virtual CPU ID.
     368 * Checks if a force action flag is set for the given VCPU.
     369 *
     370 * @param   pVCpu     VMCPU Handle.
    347371 * @param   fFlag   The flag to check.
    348372 */
    349 #ifdef VBOX_WITH_SMP_GUESTS
    350 # define VMCPU_FF_ISSET(pVM, idCpu, fFlag)  (((pVM)->aCpu[idCpu].fForcedActions & (fFlag)) == (fFlag))
    351 #else
    352 # define VMCPU_FF_ISSET(pVM, idCpu, fFlag)  VM_FF_ISSET(pVM, fFlag)
     373#if 1 //def VBOX_WITH_SMP_GUESTS
     374# define VMCPU_FF_ISSET(pVCpu, fFlag)  (((pVCpu)->fLocalForcedActions & (fFlag)) == (fFlag))
     375#else
     376# define VMCPU_FF_ISSET(pVCpu, fFlag)  (((pVCpu)->CTX_SUFF(pVM)->fGlobalForcedActions & (fFlag)) == (fFlag))
    353377#endif
    354378
     
    359383 * @param   fFlags  The flags to check for.
    360384 */
    361 #define VM_FF_ISPENDING(pVM, fFlags)        ((pVM)->fForcedActions & (fFlags))
     385#define VM_FF_ISPENDING(pVM, fFlags)        ((pVM)->fGlobalForcedActions & (fFlags))
    362386
    363387/** @def VMCPU_FF_ISPENDING
    364  * Checks if one or more force action in the specified set is pending for given VCPU.
    365  *
    366  * @param   pVM     VM Handle.
    367  * @param   idCpu   Virtual CPU ID.
     388 * Checks if one or more force action in the specified set is pending for the given VCPU.
     389 *
     390 * @param   pVCpu     VMCPU Handle.
    368391 * @param   fFlags  The flags to check for.
    369392 */
    370 #ifdef VBOX_WITH_SMP_GUESTS
    371 # define VMCPU_FF_ISPENDING(pVM, idCpu, fFlags) ((pVM)->aCpu[idCpu].fForcedActions & (fFlags))
    372 #else
    373 # define VMCPU_FF_ISPENDING(pVM, idCpu, fFlags) VM_FF_ISPENDING(pVM, fFlags)
     393#if 1 //def VBOX_WITH_SMP_GUESTS
     394# define VMCPU_FF_ISPENDING(pVCpu, fFlags) ((pVCpu)->fLocalForcedActions & (fFlags))
     395#else
     396# define VMCPU_FF_ISPENDING(pVCpu, fFlags) ((pVCpu)->CTX_SUFF(pVM)->fGlobalForcedActions & (fFlags))
    374397#endif
    375398
     
    382405 * @param   fExcpt  The flags that should not be set.
    383406 */
    384 #define VM_FF_IS_PENDING_EXCEPT(pVM, fFlags, fExcpt)            ( ((pVM)->fForcedActions & (fFlags)) && !((pVM)->fForcedActions & (fExcpt)) )
     407#define VM_FF_IS_PENDING_EXCEPT(pVM, fFlags, fExcpt)            ( ((pVM)->fGlobalForcedActions & (fFlags)) && !((pVM)->fGlobalForcedActions & (fExcpt)) )
    385408
    386409/** @def VMCPU_FF_IS_PENDING_EXCEPT
    387  * Checks if one or more force action in the specified set is pending for given
     410 * Checks if one or more force action in the specified set is pending for the given
    388411 * VCPU while one or more other ones are not.
    389412 *
    390  * @param   pVM     VM Handle.
    391  * @param   idCpu   Virtual CPU ID.
     413 * @param   pVCpu     VMCPU Handle.
    392414 * @param   fFlags  The flags to check for.
    393415 * @param   fExcpt  The flags that should not be set.
    394416 */
    395 #ifdef VBOX_WITH_SMP_GUESTS
    396 # define VMCPU_FF_IS_PENDING_EXCEPT(pVM, idCpu, fFlags, fExcpt) ( ((pVM)->aCpu[idCpu].fForcedActions & (fFlags)) && !((pVM)->aCpu[idCpu].fForcedActions & (fExcpt)) )
    397 #else
    398 # define VMCPU_FF_IS_PENDING_EXCEPT(pVM, idCpu, fFlags, fExcpt) VM_FF_ISPENDING(pVM, fFlags, fExcpt)
     417#if 1 //def VBOX_WITH_SMP_GUESTS
     418# define VMCPU_FF_IS_PENDING_EXCEPT(pVCpu, fFlags, fExcpt) ( ((pVCpu)->fLocalForcedActions & (fFlags)) && !((pVCpu)->fLocalForcedActions & (fExcpt)) )
     419#else
     420# define VMCPU_FF_IS_PENDING_EXCEPT(pVCpu, fFlags, fExcpt) ( ((pVCpu)->CTX_SUFF(pVM)->fGlobalForcedActions & (fFlags)) && !((pVCpu)->CTX_SUFF(pVM)->fGlobalForcedActions & (fExcpt)) )
    399421#endif
    400422
     
    487509     * See the VM_FF_* \#defines. Updated atomically.
    488510     */
    489     volatile uint32_t           fForcedActions;
     511    volatile uint32_t           fGlobalForcedActions;
    490512    /** Pointer to the array of page descriptors for the VM structure allocation. */
    491513    R3PTRTYPE(PSUPPAGE)         paVMPagesR3;
  • trunk/include/VBox/vm.mac

    r18927 r19141  
    3535
    3636;/** This action forces the VM to service check and pending interrups on the APIC. */
    37 %define VM_FF_INTERRUPT_APIC            (1 << 0)
     37%define VMCPU_FF_INTERRUPT_APIC            (1 << 0)
    3838;/** This action forces the VM to service check and pending interrups on the PIC. */
    39 %define VM_FF_INTERRUPT_PIC             (1 << 1)
     39%define VMCPU_FF_INTERRUPT_PIC             (1 << 1)
    4040;/** This action forces the VM to schedule and run pending timer (TM). */
    41 %define VM_FF_TIMER                     (1 << 2)
     41%define VMCPU_FF_TIMER                     (1 << 2)
    4242;/** This action forces the VM to service pending requests from other
    4343; * thread or requests which must be executed in another context. */
    44 %define VM_FF_REQUEST                   (1 << 9)
     44%define VMCPU_FF_REQUEST                   (1 << 9)
    4545
    4646;;
     
    4848struc VM
    4949    .enmVMState         resd 1
    50     .fForcedActions    resd 1
     50    .fGlobalForcedActions resd 1
    5151    .paVMPagesR3        RTR3PTR_RES 1
    5252    .pSession           RTR0PTR_RES 1
     
    105105; This is part of  the VMCPU structure.
    106106struc VMCPU
    107     .fForcedActions    resd 1
    108     .enmState           resd 1
    109     .pVMR3              RTR3PTR_RES 1
    110     .pVMR0              RTR0PTR_RES 1
    111     .pVMRC              RTRCPTR_RES 1
    112     .idCpu              resd 1
     107    .fLocalForcedActions resd 1
     108    .enmState            resd 1
     109    .pVMR3               RTR3PTR_RES 1
     110    .pVMR0               RTR0PTR_RES 1
     111    .pVMRC               RTRCPTR_RES 1
     112    .idCpu               resd 1
    113113
    114     .hNativeThread      RTR0PTR_RES 1
     114    .hNativeThread       RTR0PTR_RES 1
    115115
    116116    alignb 64
    117117
    118     .cpum               resb 2048
     118    .cpum                resb 4096
    119119endstruc
    120120
  • trunk/include/VBox/vmapi.h

    r18649 r19141  
    432432VMMR3DECL(void) VMR3NotifyFF(PVM pVM, bool fNotifiedREM);
    433433VMMR3DECL(void) VMR3NotifyFFU(PUVM pUVM, bool fNotifiedREM);
    434 VMMR3DECL(int)  VMR3WaitHalted(PVM pVM, bool fIgnoreInterrupts);
     434VMMR3DECL(int)  VMR3WaitHalted(PVM pVM, PVMCPU pVCpu, bool fIgnoreInterrupts);
    435435VMMR3DECL(int)  VMR3WaitU(PUVM pUVM);
    436436VMMR3DECL(RTCPUID)          VMR3GetVMCPUId(PVM pVM);
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