Changeset 48194 in vbox for trunk/src/VBox
- Timestamp:
- Aug 30, 2013 2:33:38 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/VMMR0/HMVMXR0.cpp
r48174 r48194 7209 7209 DECLINLINE(void) hmR0VmxLoadGuestStateOptimal(PVM pVM, PVMCPU pVCpu, PCPUMCTX pMixedCtx) 7210 7210 { 7211 HMVMX_ASSERT_PREEMPT_SAFE(); 7212 7211 7213 Log5(("LoadFlags=%#RX32\n", pVCpu->hm.s.fContextUseFlags)); 7212 7214 #ifdef HMVMX_SYNC_FULL_GUEST_STATE … … 7303 7305 #endif /* !IEM_VERIFICATION_MODE_FULL */ 7304 7306 7305 /* 7306 * When thread-context hooks are used, load the required guest-state bits here 7307 * before we go ahead and disable interrupts. We can handle getting preempted 7308 * while loading the guest state. 7309 */ 7310 if (VMMR0ThreadCtxHooksAreRegistered(pVCpu)) 7311 hmR0VmxLoadGuestStateOptimal(pVM, pVCpu, pMixedCtx); 7307 /* Load the guest state bits, we can handle longjmps/getting preempted here. */ 7308 hmR0VmxLoadGuestStateOptimal(pVM, pVCpu, pMixedCtx); 7312 7309 7313 7310 /* … … 7345 7342 } 7346 7343 7347 /* Indicate the start of guest execution. No more longjmps or returns to ring-3 from this point!!! */7348 VMCPU_ASSERT_STATE(pVCpu, VMCPUSTATE_STARTED_HM);7349 VMCPU_SET_STATE(pVCpu, VMCPUSTATE_STARTED_EXEC);7350 7351 7344 /* 7345 * No more longjmps or returns to ring-3 (that can continue guest execution) from this point!!! 7346 * 7352 7347 * Event injection might result in triple-faulting the VM (real-on-v86 case), which is why it's 7353 7348 * done here and not in hmR0VmxPreRunGuestCommitted() which doesn't expect failures. 7354 7349 */ 7355 7350 rc = hmR0VmxInjectPendingEvent(pVCpu, pMixedCtx); 7351 if (RT_UNLIKELY(rc != VINF_SUCCESS)) 7352 ASMSetFlags(pVmxTransient->uEflags); 7356 7353 return rc; 7357 7354 } … … 7379 7376 Assert(!RTThreadPreemptIsEnabled(NIL_RTTHREAD)); 7380 7377 7378 VMCPU_ASSERT_STATE(pVCpu, VMCPUSTATE_STARTED_HM); 7379 VMCPU_SET_STATE(pVCpu, VMCPUSTATE_STARTED_EXEC); /* Indicate the start of guest execution. */ 7380 7381 7381 /* 7382 7382 * Load the host state bits as we may've been preempted (only happens when … … 7392 7392 7393 7393 /* 7394 * When thread-context hooks are -not- used we need to load the required 7395 * guest state bits here i.e. when we can no longer be rescheduled. 7394 * If we are injecting events to a real-on-v86 mode guest, we may have to update 7395 * RIP and some other registers, i.e. hmR0VmxInjectPendingEvent()->hmR0VmxInjectEventVmcs(). 7396 * Reload only the necessary state, the assertion will catch if other parts of the code 7397 * change. 7396 7398 */ 7397 if (!VMMR0ThreadCtxHooksAreRegistered(pVCpu)) 7398 hmR0VmxLoadGuestStateOptimal(pVM, pVCpu, pMixedCtx); 7399 else 7400 { 7401 /* 7402 * If we are injecting events to a real-on-v86 mode guest, we may have to update 7403 * RIP and some other registers, i.e. hmR0VmxInjectPendingEvent()->hmR0VmxInjectEventVmcs(). 7404 * Reload only the necessary state, the assertion will catch if other parts of the code 7405 * change. 7406 */ 7407 if (pVCpu->hm.s.vmx.RealMode.fRealOnV86Active) 7408 { 7409 hmR0VmxLoadGuestRipRspRflags(pVCpu, pMixedCtx); 7410 hmR0VmxLoadGuestSegmentRegs(pVCpu, pMixedCtx); 7411 } 7399 if (pVCpu->hm.s.vmx.RealMode.fRealOnV86Active) 7400 { 7401 hmR0VmxLoadGuestRipRspRflags(pVCpu, pMixedCtx); 7402 hmR0VmxLoadGuestSegmentRegs(pVCpu, pMixedCtx); 7412 7403 } 7413 7404
Note:
See TracChangeset
for help on using the changeset viewer.