Changeset 48426 in vbox
- Timestamp:
- Sep 11, 2013 11:52:56 AM (11 years ago)
- Location:
- trunk/src/VBox/VMM
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/VMMAll/VMMAll.cpp
r47989 r48426 201 201 */ 202 202 /* RTMpCpuId had better be cheap. */ 203 Assert(!RTThreadPreemptIsEnabled(NIL_RTTHREAD)); 203 204 RTCPUID idHostCpu = RTMpCpuId(); 204 205 -
trunk/src/VBox/VMM/VMMR0/HMR0.cpp
r48328 r48426 800 800 { 801 801 PHMR0FIRSTRC pFirstRc = (PHMR0FIRSTRC)pvUser1; 802 Assert(idCpu == (RTCPUID)RTMpCpuIdToSetIndex(idCpu)); / // @todo fix idCpu == index assumption (rainy day)802 Assert(idCpu == (RTCPUID)RTMpCpuIdToSetIndex(idCpu)); /** @todo fix idCpu == index assumption (rainy day) */ 803 803 Assert(!RTThreadPreemptIsEnabled(NIL_RTTHREAD)); 804 804 NOREF(pvUser2); … … 862 862 { 863 863 PHMR0FIRSTRC pFirstRc = (PHMR0FIRSTRC)pvUser1; 864 Assert(idCpu == (RTCPUID)RTMpCpuIdToSetIndex(idCpu)); /// @todo fix idCpu == index assumption (rainy day) 864 Assert(!RTThreadPreemptIsEnabled(NIL_RTTHREAD)); 865 Assert(idCpu == (RTCPUID)RTMpCpuIdToSetIndex(idCpu)); /** @todo fix idCpu == index assumption (rainy day) */ 865 866 NOREF(pvUser2); 866 867 … … 908 909 PHMGLOBALCPUINFO pCpu = &g_HvmR0.aCpuInfo[idCpu]; 909 910 910 Assert(idCpu == (RTCPUID)RTMpCpuIdToSetIndex(idCpu)); 911 Assert(idCpu == (RTCPUID)RTMpCpuIdToSetIndex(idCpu)); /** @todo fix idCpu == index assumption (rainy day) */ 911 912 Assert(idCpu < RT_ELEMENTS(g_HvmR0.aCpuInfo)); 912 913 Assert(!pCpu->fConfigured); … … 1062 1063 * @returns VBox status code. 1063 1064 * @param idCpu The identifier for the CPU the function is called on. 1065 * 1066 * @remarks Must be called with preemption disabled. 1064 1067 */ 1065 1068 static int hmR0DisableCpu(RTCPUID idCpu) … … 1068 1071 1069 1072 Assert(!g_HvmR0.vmx.fSupported || !g_HvmR0.vmx.fUsingSUPR0EnableVTx); 1070 Assert(idCpu == (RTCPUID)RTMpCpuIdToSetIndex(idCpu)); / // @todo fix idCpu == index assumption (rainy day)1073 Assert(idCpu == (RTCPUID)RTMpCpuIdToSetIndex(idCpu)); /** @todo fix idCpu == index assumption (rainy day) */ 1071 1074 Assert(idCpu < RT_ELEMENTS(g_HvmR0.aCpuInfo)); 1072 1075 Assert(!pCpu->fConfigured || pCpu->hMemObj != NIL_RTR0MEMOBJ); 1076 Assert(!RTThreadPreemptIsEnabled(NIL_RTTHREAD)); 1073 1077 1074 1078 if (pCpu->hMemObj == NIL_RTR0MEMOBJ) … … 1080 1084 void *pvCpuPage = RTR0MemObjAddress(pCpu->hMemObj); 1081 1085 RTHCPHYS HCPhysCpuPage = RTR0MemObjGetPagePhysAddr(pCpu->hMemObj, 0); 1082 if (idCpu == RTMpCpuId()) 1083 { 1084 rc = g_HvmR0.pfnDisableCpu(pCpu, pvCpuPage, HCPhysCpuPage); 1085 AssertRCReturn(rc, rc); 1086 } 1087 else 1088 { 1089 pCpu->fIgnoreAMDVInUseError = true; 1090 rc = VINF_SUCCESS; 1091 } 1086 1087 rc = g_HvmR0.pfnDisableCpu(pCpu, pvCpuPage, HCPhysCpuPage); 1088 AssertRCReturn(rc, rc); 1092 1089 1093 1090 pCpu->fConfigured = false; … … 1102 1099 1103 1100 /** 1104 * Worker function passed to RTMpOnAll , RTMpOnOthers and RTMpOnSpecific that1105 * is to be called on the targetCPUs.1101 * Worker function passed to RTMpOnAll() that is to be called on the target 1102 * CPUs. 1106 1103 * 1107 1104 * @param idCpu The identifier for the CPU the function is called on. … … 1517 1514 * @param pVCpu Pointer to the VMCPU. 1518 1515 * 1519 * @remarks Ca lled with preemption disabled and after first having called1520 * HMR0Enter.1516 * @remarks Can be called with preemption enabled if thread-context hooks are 1517 * used!!! 1521 1518 */ 1522 1519 VMMR0_INT_DECL(int) HMR0RunGuestCode(PVM pVM, PVMCPU pVCpu) 1523 1520 { 1524 1521 #ifdef VBOX_STRICT 1525 PHMGLOBALCPUINFO pCpu = &g_HvmR0.aCpuInfo[RTMpCpuId()]; 1526 Assert(!VMCPU_FF_IS_PENDING(pVCpu, VMCPU_FF_PGM_SYNC_CR3 | VMCPU_FF_PGM_SYNC_CR3_NON_GLOBAL)); 1527 Assert(pCpu->fConfigured); 1528 AssertReturn(!ASMAtomicReadBool(&g_HvmR0.fSuspended), VERR_HM_SUSPEND_PENDING); 1522 /* With thread-context hooks we would be running this code with preemption enabled. */ 1523 if (!RTThreadPreemptIsEnabled(NIL_RTTHREAD)) 1524 { 1525 PHMGLOBALCPUINFO pCpu = &g_HvmR0.aCpuInfo[RTMpCpuId()]; 1526 Assert(!VMCPU_FF_IS_PENDING(pVCpu, VMCPU_FF_PGM_SYNC_CR3 | VMCPU_FF_PGM_SYNC_CR3_NON_GLOBAL)); 1527 Assert(pCpu->fConfigured); 1528 AssertReturn(!ASMAtomicReadBool(&g_HvmR0.fSuspended), VERR_HM_SUSPEND_PENDING); 1529 } 1529 1530 #endif 1530 1531 1531 1532 #ifdef VBOX_WITH_2X_4GB_ADDR_SPACE 1532 1533 AssertReturn(!VMMR0ThreadCtxHooksAreRegistered(pVCpu), VERR_HM_IPE_4); 1534 Assert(!RTThreadPreemptIsEnabled(NIL_RTTHREAD)); 1533 1535 PGMRZDynMapStartAutoSet(pVCpu); 1534 1536 #endif … … 1622 1624 VMMR0DECL(PHMGLOBALCPUINFO) HMR0GetCurrentCpu(void) 1623 1625 { 1626 Assert(!RTThreadPreemptIsEnabled(NIL_RTTHREAD)); 1624 1627 RTCPUID idCpu = RTMpCpuId(); 1625 1628 Assert(idCpu < RT_ELEMENTS(g_HvmR0.aCpuInfo)); -
trunk/src/VBox/VMM/VMMR0/HMVMXR0.cpp
r48421 r48426 6197 6197 { 6198 6198 int rc2 = hmR0VmxLeave(pVM, pVCpu, pMixedCtx, true /* fSaveGuestState */); 6199 AssertRCReturn (rc2, rc2);6199 AssertRCReturnStmt(rc2, HM_RESTORE_PREEMPT_IF_NEEDED(), rc2); 6200 6200 pVCpu->hm.s.fLeaveDone = true; 6201 6201 } … … 6285 6285 /* Save guest state and restore host state bits. */ 6286 6286 int rc = hmR0VmxLeaveSession(pVM, pVCpu, pMixedCtx); 6287 AssertRCReturn(rc, rc); 6287 6288 STAM_COUNTER_DEC(&pVCpu->hm.s.StatSwitchLongJmpToR3); 6288 6289
Note:
See TracChangeset
for help on using the changeset viewer.