- Timestamp:
- Sep 25, 2017 1:10:41 PM (8 years ago)
- svn:sync-xref-src-repo-rev:
- 118107
- Location:
- trunk/src/VBox/VMM
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/VMMR3/VM.cpp
r67529 r68853 2535 2535 LogFlow(("vmR3Destroy: returning %Rrc\n", VINF_EM_TERMINATE)); 2536 2536 } 2537 2538 /* 2539 * Decrement the active EMT count here. 2540 */ 2541 PUVMCPU pUVCpu = &pUVM->aCpus[pVCpu->idCpu]; 2542 if (!pUVCpu->vm.s.fBeenThruVmDestroy) 2543 { 2544 pUVCpu->vm.s.fBeenThruVmDestroy = true; 2545 ASMAtomicDecU32(&pUVM->vm.s.cActiveEmts); 2546 } 2547 else 2548 AssertFailed(); 2549 2537 2550 return VINF_EM_TERMINATE; 2538 2551 } -
trunk/src/VBox/VMM/VMMR3/VMEmt.cpp
r67987 r68853 94 94 Log(("vmR3EmulationThread: Emulation thread starting the days work... Thread=%#x pUVM=%p\n", hThreadSelf, pUVM)); 95 95 VMSTATE enmBefore = VMSTATE_CREATED; /* (only used for logging atm.) */ 96 ASMAtomicIncU32(&pUVM->vm.s.cActiveEmts); 96 97 for (;;) 97 98 { … … 244 245 245 246 } /* forever */ 247 248 249 /* 250 * Decrement the active EMT count if we haven't done it yet in vmR3Destroy. 251 */ 252 if (!pUVCpu->vm.s.fBeenThruVmDestroy) 253 ASMAtomicDecU32(&pUVM->vm.s.cActiveEmts); 246 254 247 255 … … 1381 1389 } 1382 1390 1391 1392 /** 1393 * Returns the number of active EMTs. 1394 * 1395 * This is used by the rendezvous code during VM destruction to avoid waiting 1396 * for EMTs that aren't around any more. 1397 * 1398 * @returns Number of active EMTs. 0 if invalid parameter. 1399 * @param pUVM The user mode VM structure. 1400 */ 1401 VMMR3_INT_DECL(uint32_t) VMR3GetActiveEmts(PUVM pUVM) 1402 { 1403 UVM_ASSERT_VALID_EXT_RETURN(pUVM, 0); 1404 return pUVM->vm.s.cActiveEmts; 1405 } 1406 -
trunk/src/VBox/VMM/VMMR3/VMM.cpp
r66848 r68853 2160 2160 PVMCPU pVCpu = VMMGetCpu(pVM); 2161 2161 if (!pVCpu) 2162 { 2162 2163 /* 2163 2164 * Forward the request to an EMT thread. 2164 2165 */ 2165 {2166 2166 Log(("VMMR3EmtRendezvous: %#x non-EMT\n", fFlags)); 2167 2167 if (!(fFlags & VMMEMTRENDEZVOUS_FLAGS_PRIORITY)) … … 2171 2171 Log(("VMMR3EmtRendezvous: %#x non-EMT returns %Rrc\n", fFlags, VBOXSTRICTRC_VAL(rcStrict))); 2172 2172 } 2173 else if (pVM->cCpus == 1) 2173 else if ( pVM->cCpus == 1 2174 || ( pVM->enmVMState == VMSTATE_DESTROYING 2175 && VMR3GetActiveEmts(pVM->pUVM) < pVM->cCpus ) ) 2174 2176 { 2175 2177 /* 2176 2178 * Shortcut for the single EMT case. 2179 * 2180 * We also ends up here if EMT(0) (or others) tries to issue a rendezvous 2181 * during vmR3Destroy after other emulation threads have started terminating. 2177 2182 */ 2178 2183 if (!pVCpu->vmm.s.fInRendezvous) -
trunk/src/VBox/VMM/include/VMInternal.h
r62478 r68853 191 191 /** The reference count of the UVM handle. */ 192 192 volatile uint32_t cUvmRefs; 193 194 /** Number of active EMTs. */ 195 volatile uint32_t cActiveEmts; 193 196 194 197 # ifdef VBOX_WITH_STATISTICS … … 342 345 /** Wait/Idle indicator. */ 343 346 bool volatile fWait; 347 /** Set if we've been thru vmR3Destroy and decremented the active EMT count 348 * already. */ 349 bool volatile fBeenThruVmDestroy; 344 350 /** Align the next bit. */ 345 bool afAlignment[HC_ARCH_BITS == 32 ? 3 : 7];351 bool afAlignment[HC_ARCH_BITS == 32 ? 2 : 6]; 346 352 347 353 /** @name Generic Halt data
Note:
See TracChangeset
for help on using the changeset viewer.