Changeset 26062 in vbox for trunk/src/VBox/VMM/VMMR0/HWSVMR0.cpp
- Timestamp:
- Jan 27, 2010 10:20:01 AM (15 years ago)
- svn:sync-xref-src-repo-rev:
- 56981
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/VMMR0/HWSVMR0.cpp
r26018 r26062 1026 1026 1027 1027 /* Check for pending actions that force us to go back to ring 3. */ 1028 if ( VM_FF_ISPENDING(pVM, VM_FF_HWACCM_TO_R3_MASK | VM_FF_REQUEST) 1029 || VMCPU_FF_ISPENDING(pVCpu, VMCPU_FF_HWACCM_TO_R3_MASK | VMCPU_FF_PGM_SYNC_CR3 | VMCPU_FF_PGM_SYNC_CR3_NON_GLOBAL | VMCPU_FF_REQUEST)) 1030 { 1031 /* Check if a sync operation is pending. */ 1032 if (VMCPU_FF_ISPENDING(pVCpu, VMCPU_FF_PGM_SYNC_CR3 | VMCPU_FF_PGM_SYNC_CR3_NON_GLOBAL)) 1033 { 1034 rc = PGMSyncCR3(pVCpu, pCtx->cr0, pCtx->cr3, pCtx->cr4, VMCPU_FF_ISSET(pVCpu, VMCPU_FF_PGM_SYNC_CR3)); 1035 AssertRC(rc); 1036 if (rc != VINF_SUCCESS) 1037 { 1038 Log(("Pending pool sync is forcing us back to ring 3; rc=%d\n", rc)); 1039 goto end; 1040 } 1041 } 1042 1028 1043 #ifdef DEBUG 1029 /* Intercept X86_XCPT_DB if stepping is enabled */ 1030 if (!DBGFIsStepping(pVCpu)) 1031 #endif 1032 { 1033 if ( VM_FF_ISPENDING(pVM, VM_FF_HWACCM_TO_R3_MASK) 1034 || VMCPU_FF_ISPENDING(pVCpu, VMCPU_FF_HWACCM_TO_R3_MASK)) 1035 { 1036 VMCPU_FF_CLEAR(pVCpu, VMCPU_FF_TO_R3); 1037 STAM_COUNTER_INC(&pVCpu->hwaccm.s.StatSwitchToR3); 1044 /* Intercept X86_XCPT_DB if stepping is enabled */ 1045 if (!DBGFIsStepping(pVCpu)) 1046 #endif 1047 { 1048 if ( VM_FF_ISPENDING(pVM, VM_FF_HWACCM_TO_R3_MASK) 1049 || VMCPU_FF_ISPENDING(pVCpu, VMCPU_FF_HWACCM_TO_R3_MASK)) 1050 { 1051 VMCPU_FF_CLEAR(pVCpu, VMCPU_FF_TO_R3); 1052 STAM_COUNTER_INC(&pVCpu->hwaccm.s.StatSwitchToR3); 1053 STAM_PROFILE_ADV_STOP(&pVCpu->hwaccm.s.StatEntry, x); 1054 rc = RT_UNLIKELY(VM_FF_ISPENDING(pVM, VM_FF_PGM_NO_MEMORY)) ? VINF_EM_NO_MEMORY : VINF_EM_RAW_TO_R3; 1055 goto end; 1056 } 1057 } 1058 1059 /* Pending request packets might contain actions that need immediate attention, such as pending hardware interrupts. */ 1060 if ( VM_FF_ISPENDING(pVM, VM_FF_REQUEST) 1061 || VMCPU_FF_ISPENDING(pVCpu, VMCPU_FF_REQUEST)) 1062 { 1038 1063 STAM_PROFILE_ADV_STOP(&pVCpu->hwaccm.s.StatEntry, x); 1039 rc = RT_UNLIKELY(VM_FF_ISPENDING(pVM, VM_FF_PGM_NO_MEMORY)) ? VINF_EM_NO_MEMORY : VINF_EM_RAW_TO_R3;1064 rc = VINF_EM_PENDING_REQUEST; 1040 1065 goto end; 1041 1066 } 1042 }1043 1044 /* Pending request packets might contain actions that need immediate attention, such as pending hardware interrupts. */1045 if ( VM_FF_ISPENDING(pVM, VM_FF_REQUEST)1046 || VMCPU_FF_ISPENDING(pVCpu, VMCPU_FF_REQUEST))1047 {1048 STAM_PROFILE_ADV_STOP(&pVCpu->hwaccm.s.StatEntry, x);1049 rc = VINF_EM_PENDING_REQUEST;1050 goto end;1051 1067 } 1052 1068 … … 1713 1729 TRPMResetTrap(pVCpu); 1714 1730 STAM_PROFILE_ADV_STOP(&pVCpu->hwaccm.s.StatExit1, x); 1715 1716 /* Check if a sync operation is pending. */1717 if (VMCPU_FF_ISPENDING(pVCpu, VMCPU_FF_PGM_SYNC_CR3 | VMCPU_FF_PGM_SYNC_CR3_NON_GLOBAL))1718 {1719 rc = PGMSyncCR3(pVCpu, pCtx->cr0, pCtx->cr3, pCtx->cr4, VMCPU_FF_ISSET(pVCpu, VMCPU_FF_PGM_SYNC_CR3));1720 AssertRC(rc);1721 if (rc != VINF_SUCCESS)1722 {1723 Log(("Pending pool sync is forcing us back to ring 3; rc=%d\n", rc));1724 break;1725 }1726 }1727 1728 1731 goto ResumeExecution; 1729 1732 } … … 1897 1900 TRPMResetTrap(pVCpu); 1898 1901 1899 Assert(!VMCPU_FF_ISPENDING(pVCpu, VMCPU_FF_PGM_SYNC_CR3 | VMCPU_FF_PGM_SYNC_CR3_NON_GLOBAL));1900 1901 1902 STAM_PROFILE_ADV_STOP(&pVCpu->hwaccm.s.StatExit1, x); 1902 1903 goto ResumeExecution; … … 2048 2049 default: 2049 2050 AssertFailed(); 2050 }2051 /* Check if a sync operation is pending. */2052 if ( rc == VINF_SUCCESS /* don't bother if we are going to ring 3 anyway */2053 && VMCPU_FF_ISPENDING(pVCpu, VMCPU_FF_PGM_SYNC_CR3 | VMCPU_FF_PGM_SYNC_CR3_NON_GLOBAL))2054 {2055 rc = PGMSyncCR3(pVCpu, pCtx->cr0, pCtx->cr3, pCtx->cr4, VMCPU_FF_ISSET(pVCpu, VMCPU_FF_PGM_SYNC_CR3));2056 AssertRC(rc);2057 2058 STAM_COUNTER_INC(&pVCpu->hwaccm.s.StatFlushTLBCRxChange);2059 2060 /* Must be set by PGMSyncCR3 */2061 AssertMsg(rc == VINF_SUCCESS || rc == VINF_PGM_SYNC_CR3 || PGMGetGuestMode(pVCpu) <= PGMMODE_PROTECTED || pVCpu->hwaccm.s.fForceTLBFlush,2062 ("rc=%Rrc mode=%d fForceTLBFlush=%RTbool\n", rc, PGMGetGuestMode(pVCpu), pVCpu->hwaccm.s.fForceTLBFlush));2063 2051 } 2064 2052 if (rc == VINF_SUCCESS)
Note:
See TracChangeset
for help on using the changeset viewer.