Changeset 48205 in vbox for trunk/src/VBox/VMM/VMMR0
- Timestamp:
- Aug 30, 2013 5:26:51 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/VMMR0/HMVMXR0.cpp
r48194 r48205 7318 7318 7319 7319 /* 7320 * No longjmps to ring-3 from this point on!!! 7321 * Asserts() will still longjmp to ring-3 (but won't return), which is intentional, better than a kernel panic. 7322 * This also disables flushing of the R0-logger instance (if any). 7323 */ 7324 VMMRZCallRing3Disable(pVCpu); 7325 7326 /* 7320 7327 * We disable interrupts so that we don't miss any interrupts that would flag preemption (IPI/timers etc.) 7321 7328 * when thread-context hooks aren't used and we've been running with preemption disabled for a while. … … 7332 7339 { 7333 7340 ASMSetFlags(pVmxTransient->uEflags); 7341 VMMRZCallRing3Enable(pVCpu); 7334 7342 STAM_COUNTER_INC(&pVCpu->hm.s.StatSwitchHmToR3FF); 7335 7343 return VINF_EM_RAW_TO_R3; … … 7338 7346 { 7339 7347 ASMSetFlags(pVmxTransient->uEflags); 7348 VMMRZCallRing3Enable(pVCpu); 7340 7349 STAM_COUNTER_INC(&pVCpu->hm.s.StatPendingHostIrq); 7341 7350 return VINF_EM_RAW_INTERRUPT; … … 7343 7352 7344 7353 /* 7345 * No more longjmps or returns to ring-3 (that can continue guest execution) from this point!!!7346 *7347 7354 * Event injection might result in triple-faulting the VM (real-on-v86 case), which is why it's 7348 7355 * done here and not in hmR0VmxPreRunGuestCommitted() which doesn't expect failures. … … 7350 7357 rc = hmR0VmxInjectPendingEvent(pVCpu, pMixedCtx); 7351 7358 if (RT_UNLIKELY(rc != VINF_SUCCESS)) 7359 { 7352 7360 ASMSetFlags(pVmxTransient->uEflags); 7353 return rc; 7361 VMMRZCallRing3Enable(pVCpu); 7362 return rc; 7363 } 7364 7365 return VINF_SUCCESS; 7354 7366 } 7355 7367 … … 7490 7502 7491 7503 STAM_PROFILE_ADV_STOP_START(&pVCpu->hm.s.StatInGC, &pVCpu->hm.s.StatExit1, x); 7492 TMNotifyEndOfExecution(pVCpu); /* Notify TM that the guest is no longer running. */7504 TMNotifyEndOfExecution(pVCpu); /* Notify TM that the guest is no longer running. */ 7493 7505 Assert(!(ASMGetFlags() & X86_EFL_IF)); 7494 7506 VMCPU_SET_STATE(pVCpu, VMCPUSTATE_STARTED_HM); 7495 7507 7496 7508 pVCpu->hm.s.vmx.fRestoreHostFlags |= VMX_RESTORE_HOST_REQUIRED; /* Host state messed up by VT-x, we must restore. */ 7497 pVCpu->hm.s.vmx.uVmcsState |= HMVMX_VMCS_STATE_LAUNCHED; /* Use VMRESUME instead of VMLAUNCH in the next run. */7498 ASMSetFlags(pVmxTransient->uEflags); /* Enable interrupts. */7499 VMMRZCallRing3Enable(pVCpu); /* It is now safe to do longjmps to ring-3!!! */7509 pVCpu->hm.s.vmx.uVmcsState |= HMVMX_VMCS_STATE_LAUNCHED; /* Use VMRESUME instead of VMLAUNCH in the next run. */ 7510 ASMSetFlags(pVmxTransient->uEflags); /* Enable interrupts. */ 7511 VMMRZCallRing3Enable(pVCpu); /* It is now safe to do longjmps to ring-3!!! */ 7500 7512 7501 7513 /* Save the basic VM-exit reason. Refer Intel spec. 24.9.1 "Basic VM-exit Information". */ … … 7570 7582 break; 7571 7583 7572 /*7573 * No longjmps to ring-3 from this point on!!!7574 * Asserts() will still longjmp to ring-3 (but won't return), which is intentional, better than a kernel panic.7575 * This also disables flushing of the R0-logger instance (if any).7576 */7577 VMMRZCallRing3Disable(pVCpu);7578 7584 hmR0VmxPreRunGuestCommitted(pVM, pVCpu, pCtx, &VmxTransient); 7579 7580 7585 rc = hmR0VmxRunGuest(pVM, pVCpu, pCtx); 7581 7586 /* The guest-CPU context is now outdated, 'pCtx' is to be treated as 'pMixedCtx' from this point on!!! */ 7582 7587 7583 /* 7584 * Restore any residual host-state and save any bits shared between host and guest into the guest-CPU state. 7585 * This will also re-enable longjmps to ring-3 when it has reached a safe point!!! 7586 */ 7588 /* Restore any residual host-state and save any bits shared between host and guest into the guest-CPU state. */ 7587 7589 hmR0VmxPostRunGuest(pVM, pVCpu, pCtx, &VmxTransient, rc); 7588 if (RT_UNLIKELY(rc != VINF_SUCCESS)) /* Check for errors with running the VM (VMLAUNCH/VMRESUME). */ 7590 7591 /* Check for errors with running the VM (VMLAUNCH/VMRESUME). */ 7592 if (RT_UNLIKELY(rc != VINF_SUCCESS)) 7589 7593 { 7590 7594 STAM_PROFILE_ADV_STOP(&pVCpu->hm.s.StatExit1, x); … … 7650 7654 break; 7651 7655 7652 /*7653 * No longjmps to ring-3 from this point on!!!7654 * Asserts() will still longjmp to ring-3 (but won't return), which is intentional, better than a kernel panic.7655 * This also disables flushing of the R0-logger instance (if any).7656 */7657 VMMRZCallRing3Disable(pVCpu);7658 7656 hmR0VmxPreRunGuestCommitted(pVM, pVCpu, pCtx, &VmxTransient); 7659 7660 7657 rc = hmR0VmxRunGuest(pVM, pVCpu, pCtx); 7661 7658 /* The guest-CPU context is now outdated, 'pCtx' is to be treated as 'pMixedCtx' from this point on!!! */ 7662 7659 7663 /* 7664 * Restore any residual host-state and save any bits shared between host and guest into the guest-CPU state. 7665 * This will also re-enable longjmps to ring-3 when it has reached a safe point!!! 7666 */ 7660 /* Restore any residual host-state and save any bits shared between host and guest into the guest-CPU state. */ 7667 7661 hmR0VmxPostRunGuest(pVM, pVCpu, pCtx, &VmxTransient, rc); 7668 if (RT_UNLIKELY(rc != VINF_SUCCESS)) /* Check for errors with running the VM (VMLAUNCH/VMRESUME). */ 7662 7663 /* Check for errors with running the VM (VMLAUNCH/VMRESUME). */ 7664 if (RT_UNLIKELY(rc != VINF_SUCCESS)) 7669 7665 { 7670 7666 STAM_PROFILE_ADV_STOP(&pVCpu->hm.s.StatExit1, x);
Note:
See TracChangeset
for help on using the changeset viewer.