Changeset 48262 in vbox for trunk/src/VBox/VMM/VMMR0
- Timestamp:
- Sep 4, 2013 12:01:35 PM (11 years ago)
- Location:
- trunk/src/VBox/VMM/VMMR0
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/VMMR0/HMSVMR0.cpp
r48256 r48262 1627 1627 1628 1628 VMMRZCallRing3Enable(pVCpu); /* Restore longjmp state. */ 1629 STAM_COUNTER_INC(&pVCpu->hm.s.StatPreemptPreempting); 1629 1630 break; 1630 1631 } -
trunk/src/VBox/VMM/VMMR0/HMVMXR0.cpp
r48256 r48262 7006 7006 case RTTHREADCTXEVENT_PREEMPTING: 7007 7007 { 7008 /** @todo Stats. */7009 7008 Assert(!RTThreadPreemptIsEnabled(NIL_RTTHREAD)); 7010 7009 Assert(VMMR0ThreadCtxHooksAreRegistered(pVCpu)); … … 7031 7030 /* Restore longjmp state. */ 7032 7031 VMMRZCallRing3Enable(pVCpu); 7032 STAM_COUNTER_INC(&pVCpu->hm.s.StatPreemptPreempting); 7033 7033 break; 7034 7034 } … … 7036 7036 case RTTHREADCTXEVENT_RESUMED: 7037 7037 { 7038 /** @todo Stats. */7039 7038 Assert(!RTThreadPreemptIsEnabled(NIL_RTTHREAD)); 7040 7039 Assert(VMMR0ThreadCtxHooksAreRegistered(pVCpu)); … … 7060 7059 } 7061 7060 pVCpu->hm.s.fLeaveDone = false; 7061 7062 /* Restore longjmp state. */ 7062 7063 VMMRZCallRing3Enable(pVCpu); 7063 7064 break; … … 7119 7120 LogFlowFunc(("pVM=%p pVCpu=%p\n", pVM, pVCpu)); 7120 7121 7121 /* When thread-context hooks are available, this is done later (when preemption/interrupts are disabled). */ 7122 if (!VMMR0ThreadCtxHooksAreRegistered(pVCpu)) 7123 { 7124 Assert(!RTThreadPreemptIsEnabled(NIL_RTTHREAD)); 7125 return hmR0VmxSaveHostState(pVM, pVCpu); 7126 } 7127 return VINF_SUCCESS; 7122 /* Save the host state here while entering HM context. When thread-context hooks are used, we might get preempted 7123 and have to resave the host state but most of the time we won't be, so do it here before we disable interrupts. */ 7124 Assert(!RTThreadPreemptIsEnabled(NIL_RTTHREAD)); 7125 return hmR0VmxSaveHostState(pVM, pVCpu); 7128 7126 } 7129 7127 … … 7466 7464 7467 7465 /* 7468 * Load the host state bits as we may've been preempted (only happens when7469 * thread-context hooks are used).7470 */7471 if (pVCpu->hm.s.fContextUseFlags & HM_CHANGED_HOST_CONTEXT)7472 {7473 Assert(VMMR0ThreadCtxHooksAreRegistered(pVCpu));7474 int rc = hmR0VmxSaveHostState(pVM, pVCpu);7475 AssertRC(rc);7476 }7477 Assert(!(pVCpu->hm.s.fContextUseFlags & HM_CHANGED_HOST_CONTEXT));7478 7479 /*7480 7466 * If we are injecting events to a real-on-v86 mode guest, we may have to update 7481 7467 * RIP and some other registers, i.e. hmR0VmxInjectPendingEvent()->hmR0VmxInjectEventVmcs(). … … 7489 7475 } 7490 7476 7491 /* Load the state shared between host and guest (FPU, debug). */ 7477 /* 7478 * Load the host state bits as we may've been preempted (only happens when 7479 * thread-context hooks are used). 7480 */ 7481 if (pVCpu->hm.s.fContextUseFlags & HM_CHANGED_HOST_CONTEXT) 7482 { 7483 Assert(VMMR0ThreadCtxHooksAreRegistered(pVCpu)); 7484 int rc = hmR0VmxSaveHostState(pVM, pVCpu); 7485 AssertRC(rc); 7486 STAM_COUNTER_INC(&pVCpu->hm.s.StatPreemptSaveHostState); 7487 } 7488 Assert(!(pVCpu->hm.s.fContextUseFlags & HM_CHANGED_HOST_CONTEXT)); 7489 7490 /* 7491 * Load the state shared between host and guest (FPU, debug). 7492 */ 7492 7493 if (pVCpu->hm.s.fContextUseFlags & HM_CHANGED_HOST_GUEST_SHARED_STATE) 7493 7494 hmR0VmxLoadSharedState(pVM, pVCpu, pMixedCtx); … … 7501 7502 7502 7503 PHMGLOBALCPUINFO pCpu = HMR0GetCurrentCpu(); 7503 RTCPUID idCurrentCpu= pCpu->idCpu;7504 RTCPUID idCurrentCpu = pCpu->idCpu; 7504 7505 if ( pVmxTransient->fUpdateTscOffsettingAndPreemptTimer 7505 7506 || idCurrentCpu != pVCpu->hm.s.idLastCpu) … … 7511 7512 ASMAtomicWriteBool(&pVCpu->hm.s.fCheckedTLBFlush, true); /* Used for TLB-shootdowns, set this across the world switch. */ 7512 7513 hmR0VmxFlushTaggedTlb(pVCpu, pCpu); /* Invalidate the appropriate guest entries from the TLB. */ 7513 7514 7514 Assert(idCurrentCpu == pVCpu->hm.s.idLastCpu); 7515 7515 pVCpu->hm.s.vmx.LastError.idCurrentCpu = idCurrentCpu; /* Update the error reporting info. with the current host CPU. */
Note:
See TracChangeset
for help on using the changeset viewer.