Changeset 48370 in vbox
- Timestamp:
- Sep 6, 2013 6:28:00 PM (11 years ago)
- Location:
- trunk
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/VBox/vmm/em.h
r47807 r48370 200 200 VMM_INT_DECL(int) EMInterpretWrmsr(PVM pVM, PVMCPU pVCpu, PCPUMCTXCORE pRegFrame); 201 201 VMM_INT_DECL(bool) EMShouldContinueAfterHalt(PVMCPU pVCpu, PCPUMCTX pCtx); 202 VMM_INT_DECL(bool) EMMonitorWaitShouldContinue(PVMCPU pVCpu, PCPUMCTX pCtx); 202 203 VMM_INT_DECL(int) EMMonitorWaitPrepare(PVMCPU pVCpu, uint64_t rax, uint64_t rcx, uint64_t rdx, RTGCPHYS GCPhys); 203 204 VMM_INT_DECL(int) EMMonitorWaitPerform(PVMCPU pVCpu, uint64_t rax, uint64_t rcx); -
trunk/src/VBox/VMM/VMMAll/EMAll.cpp
r48177 r48370 219 219 220 220 /** 221 * Determine if we should continue after encountering a hlt or mwait 222 * instruction. 221 * Determine if we should continue after encountering a mwait instruction. 223 222 * 224 223 * Clears MWAIT flags if returning @c true. 225 224 * 226 * @returns boolean225 * @returns true if we should continue, false if we should halt. 227 226 * @param pVCpu Pointer to the VMCPU. 228 227 * @param pCtx Current CPU context. 229 228 */ 230 VMM_INT_DECL(bool) EM ShouldContinueAfterHalt(PVMCPU pVCpu, PCPUMCTX pCtx)229 VMM_INT_DECL(bool) EMMonitorWaitShouldContinue(PVMCPU pVCpu, PCPUMCTX pCtx) 231 230 { 232 231 if ( pCtx->eflags.Bits.u1IF … … 234 233 == (EMMWAIT_FLAG_ACTIVE | EMMWAIT_FLAG_BREAKIRQIF0)) ) 235 234 { 236 pVCpu->em.s.MWait.fWait &= ~(EMMWAIT_FLAG_ACTIVE | EMMWAIT_FLAG_BREAKIRQIF0); 235 if (VMCPU_FF_IS_PENDING(pVCpu, (VMCPU_FF_INTERRUPT_APIC | VMCPU_FF_INTERRUPT_PIC))) 236 { 237 pVCpu->em.s.MWait.fWait &= ~(EMMWAIT_FLAG_ACTIVE | EMMWAIT_FLAG_BREAKIRQIF0); 238 return true; 239 } 240 } 241 242 return false; 243 } 244 245 246 /** 247 * Determine if we should continue after encountering a hlt instruction. 248 * 249 * @returns true if we should continue, false if we should halt. 250 * @param pVCpu Pointer to the VMCPU. 251 * @param pCtx Current CPU context. 252 */ 253 VMM_INT_DECL(bool) EMShouldContinueAfterHalt(PVMCPU pVCpu, PCPUMCTX pCtx) 254 { 255 if (pCtx->eflags.Bits.u1IF) 237 256 return !!VMCPU_FF_IS_PENDING(pVCpu, (VMCPU_FF_INTERRUPT_APIC | VMCPU_FF_INTERRUPT_PIC)); 238 }239 240 257 return false; 241 258 } -
trunk/src/VBox/VMM/VMMR0/HMSVMR0.cpp
r48329 r48370 4012 4012 4013 4013 if ( rc == VINF_EM_HALT 4014 && EM ShouldContinueAfterHalt(pVCpu, pCtx))4014 && EMMonitorWaitShouldContinue(pVCpu, pCtx)) 4015 4015 { 4016 4016 rc = VINF_SUCCESS; -
trunk/src/VBox/VMM/VMMR0/HMVMXR0.cpp
r48369 r48370 8953 8953 8954 8954 if ( rc == VINF_EM_HALT 8955 && EM ShouldContinueAfterHalt(pVCpu, pMixedCtx))8955 && EMMonitorWaitShouldContinue(pVCpu, pMixedCtx)) 8956 8956 { 8957 8957 rc = VINF_SUCCESS; -
trunk/src/VBox/VMM/VMMR3/EM.cpp
r48130 r48370 2514 2514 { 2515 2515 STAM_REL_PROFILE_START(&pVCpu->em.s.StatHalted, y); 2516 /* If HM (or someone else) store a pending interrupt in 2517 TRPM, it must be dispatched ASAP without any halting. 2518 Anything pending in TRPM has been accepted and the CPU 2519 should already be the right state to receive it. */ 2520 if (TRPMHasTrap(pVCpu)) 2521 rc = VINF_EM_RESCHEDULE; 2516 2522 /* MWAIT has a special extension where it's woken up when 2517 2523 an interrupt is pending even when IF=0. */ 2518 if ( (pVCpu->em.s.MWait.fWait & (EMMWAIT_FLAG_ACTIVE | EMMWAIT_FLAG_BREAKIRQIF0))2519 == (EMMWAIT_FLAG_ACTIVE | EMMWAIT_FLAG_BREAKIRQIF0))2524 else if ( (pVCpu->em.s.MWait.fWait & (EMMWAIT_FLAG_ACTIVE | EMMWAIT_FLAG_BREAKIRQIF0)) 2525 == (EMMWAIT_FLAG_ACTIVE | EMMWAIT_FLAG_BREAKIRQIF0)) 2520 2526 { 2521 2527 rc = VMR3WaitHalted(pVM, pVCpu, false /*fIgnoreInterrupts*/); … … 2527 2533 } 2528 2534 } 2529 else if (TRPMHasTrap(pVCpu))2530 rc = VINF_EM_RESCHEDULE;2531 2535 else 2532 2536 rc = VMR3WaitHalted(pVM, pVCpu, !(CPUMGetGuestEFlags(pVCpu) & X86_EFL_IF));
Note:
See TracChangeset
for help on using the changeset viewer.