Changeset 54395 in vbox for trunk/src/VBox/VMM/VMMR0
- Timestamp:
- Feb 23, 2015 5:34:01 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/VMMR0/HMR0.cpp
r54332 r54395 994 994 * 995 995 * @returns VBox status code. 996 * @param idCpu The identifier for the CPU th efunction is called on.996 * @param idCpu The identifier for the CPU this function is called on. 997 997 * 998 998 * @remarks Must be called with preemption disabled. … … 1007 1007 Assert(idCpu < RT_ELEMENTS(g_HvmR0.aCpuInfo)); 1008 1008 Assert(!pCpu->fConfigured || pCpu->hMemObj != NIL_RTR0MEMOBJ); 1009 AssertRelease(idCpu == RTMpCpuId()); 1009 1010 1010 1011 if (pCpu->hMemObj == NIL_RTR0MEMOBJ) … … 1012 1013 1013 1014 int rc; 1014 if ( pCpu->fConfigured 1015 && idCpu == RTMpCpuId()) /* We may not be firing on the CPU being disabled/going offline. */ 1015 if (pCpu->fConfigured) 1016 1016 { 1017 1017 void *pvCpuPage = RTR0MemObjAddress(pCpu->hMemObj); … … 1043 1043 AssertReturnVoid(g_HvmR0.fGlobalInit); 1044 1044 hmR0FirstRcSetStatus(pFirstRc, hmR0DisableCpu(idCpu)); 1045 } 1046 1047 1048 /** 1049 * Worker function passed to RTMpOnSpecific() that is to be called on the target 1050 * CPU. 1051 * 1052 * @param idCpu The identifier for the CPU the function is called on. 1053 * @param pvUser1 Null, not used. 1054 * @param pvUser2 Null, not used. 1055 */ 1056 static DECLCALLBACK(void) hmR0DisableCpuOnSpecificCallback(RTCPUID idCpu, void *pvUser1, void *pvUser2) 1057 { 1058 NOREF(pvUser1); 1059 NOREF(pvUser2); 1060 hmR0DisableCpu(idCpu); 1045 1061 } 1046 1062 … … 1061 1077 * CPU comes online, the initialization is done lazily in HMR0Enter(). 1062 1078 */ 1063 Assert(!RTThreadPreemptIsEnabled(NIL_RTTHREAD));1064 1079 switch (enmEvent) 1065 1080 { 1066 1081 case RTMPEVENT_OFFLINE: 1067 1082 { 1068 int rc = hmR0DisableCpu(idCpu); 1069 AssertRC(rc); 1083 RTTHREADPREEMPTSTATE PreemptState = RTTHREADPREEMPTSTATE_INITIALIZER; 1084 RTThreadPreemptDisable(&PreemptState); 1085 if (idCpu == RTMpCpuId()) 1086 { 1087 int rc = hmR0DisableCpu(idCpu); 1088 AssertRC(rc); 1089 RTThreadPreemptRestore(&PreemptState); 1090 } 1091 else 1092 { 1093 RTThreadPreemptRestore(&PreemptState); 1094 RTMpOnSpecific(idCpu, hmR0DisableCpuOnSpecificCallback, NULL /* pvUser1 */, NULL /* pvUser2 */); 1095 } 1070 1096 break; 1071 1097 }
Note:
See TracChangeset
for help on using the changeset viewer.