Changeset 26062 in vbox
- Timestamp:
- Jan 27, 2010 10:20:01 AM (15 years ago)
- Location:
- trunk/src/VBox/VMM/VMMR0
- Files:
-
- 2 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) -
trunk/src/VBox/VMM/VMMR0/HWVMXR0.cpp
r26025 r26062 2422 2422 2423 2423 /* Check for pending actions that force us to go back to ring 3. */ 2424 if ( VM_FF_ISPENDING(pVM, VM_FF_HWACCM_TO_R3_MASK | VM_FF_REQUEST) 2425 || 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)) 2426 { 2427 /* Check if a sync operation is pending. */ 2428 if (VMCPU_FF_ISPENDING(pVCpu, VMCPU_FF_PGM_SYNC_CR3 | VMCPU_FF_PGM_SYNC_CR3_NON_GLOBAL)) 2429 { 2430 rc = PGMSyncCR3(pVCpu, pCtx->cr0, pCtx->cr3, pCtx->cr4, VMCPU_FF_ISSET(pVCpu, VMCPU_FF_PGM_SYNC_CR3)); 2431 AssertRC(rc); 2432 if (rc != VINF_SUCCESS) 2433 { 2434 Log(("Pending pool sync is forcing us back to ring 3; rc=%d\n", rc)); 2435 goto end; 2436 } 2437 } 2438 2424 2439 #ifdef DEBUG 2425 /* Intercept X86_XCPT_DB if stepping is enabled */ 2426 if (!DBGFIsStepping(pVCpu)) 2427 #endif 2428 { 2429 if ( VM_FF_ISPENDING(pVM, VM_FF_HWACCM_TO_R3_MASK) 2430 || VMCPU_FF_ISPENDING(pVCpu, VMCPU_FF_HWACCM_TO_R3_MASK)) 2431 { 2432 VMCPU_FF_CLEAR(pVCpu, VMCPU_FF_TO_R3); 2433 STAM_COUNTER_INC(&pVCpu->hwaccm.s.StatSwitchToR3); 2434 rc = RT_UNLIKELY(VM_FF_ISPENDING(pVM, VM_FF_PGM_NO_MEMORY)) ? VINF_EM_NO_MEMORY : VINF_EM_RAW_TO_R3; 2440 /* Intercept X86_XCPT_DB if stepping is enabled */ 2441 if (!DBGFIsStepping(pVCpu)) 2442 #endif 2443 { 2444 if ( VM_FF_ISPENDING(pVM, VM_FF_HWACCM_TO_R3_MASK) 2445 || VMCPU_FF_ISPENDING(pVCpu, VMCPU_FF_HWACCM_TO_R3_MASK)) 2446 { 2447 VMCPU_FF_CLEAR(pVCpu, VMCPU_FF_TO_R3); 2448 STAM_COUNTER_INC(&pVCpu->hwaccm.s.StatSwitchToR3); 2449 STAM_PROFILE_ADV_STOP(&pVCpu->hwaccm.s.StatEntry, x); 2450 rc = RT_UNLIKELY(VM_FF_ISPENDING(pVM, VM_FF_PGM_NO_MEMORY)) ? VINF_EM_NO_MEMORY : VINF_EM_RAW_TO_R3; 2451 goto end; 2452 } 2453 } 2454 2455 /* Pending request packets might contain actions that need immediate attention, such as pending hardware interrupts. */ 2456 if ( VM_FF_ISPENDING(pVM, VM_FF_REQUEST) 2457 || VMCPU_FF_ISPENDING(pVCpu, VMCPU_FF_REQUEST)) 2458 { 2459 STAM_PROFILE_ADV_STOP(&pVCpu->hwaccm.s.StatEntry, x); 2460 rc = VINF_EM_PENDING_REQUEST; 2435 2461 goto end; 2436 2462 } 2437 }2438 2439 /* Pending request packets might contain actions that need immediate attention, such as pending hardware interrupts. */2440 if ( VM_FF_ISPENDING(pVM, VM_FF_REQUEST)2441 || VMCPU_FF_ISPENDING(pVCpu, VMCPU_FF_REQUEST))2442 {2443 rc = VINF_EM_PENDING_REQUEST;2444 goto end;2445 2463 } 2446 2464 … … 2906 2924 TRPMResetTrap(pVCpu); 2907 2925 STAM_PROFILE_ADV_STOP(&pVCpu->hwaccm.s.StatExit2Sub3, y3); 2908 2909 /* Check if a sync operation is pending. */2910 if (VMCPU_FF_ISPENDING(pVCpu, VMCPU_FF_PGM_SYNC_CR3 | VMCPU_FF_PGM_SYNC_CR3_NON_GLOBAL))2911 {2912 rc = PGMSyncCR3(pVCpu, pCtx->cr0, pCtx->cr3, pCtx->cr4, VMCPU_FF_ISSET(pVCpu, VMCPU_FF_PGM_SYNC_CR3));2913 AssertRC(rc);2914 if (rc != VINF_SUCCESS)2915 {2916 Log(("Pending pool sync is forcing us back to ring 3; rc=%d\n", rc));2917 break;2918 }2919 }2920 2926 goto ResumeExecution; 2921 2927 } … … 3406 3412 3407 3413 TRPMResetTrap(pVCpu); 3408 3409 Assert(!VMCPU_FF_ISPENDING(pVCpu, VMCPU_FF_PGM_SYNC_CR3 | VMCPU_FF_PGM_SYNC_CR3_NON_GLOBAL));3410 3414 goto ResumeExecution; 3411 3415 } … … 3594 3598 AssertFailed(); 3595 3599 break; 3596 }3597 /* Check if a sync operation is pending. */3598 if ( rc == VINF_SUCCESS /* don't bother if we are going to ring 3 anyway */3599 && VMCPU_FF_ISPENDING(pVCpu, VMCPU_FF_PGM_SYNC_CR3 | VMCPU_FF_PGM_SYNC_CR3_NON_GLOBAL))3600 {3601 rc = PGMSyncCR3(pVCpu, pCtx->cr0, pCtx->cr3, pCtx->cr4, VMCPU_FF_ISSET(pVCpu, VMCPU_FF_PGM_SYNC_CR3));3602 AssertRC(rc);3603 3600 } 3604 3601 break;
Note:
See TracChangeset
for help on using the changeset viewer.