Changeset 67989 in vbox
- Timestamp:
- Jul 17, 2017 12:13:28 PM (7 years ago)
- Location:
- trunk
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/VBox/vmm/gvmm.h
r67987 r67989 171 171 GVMMR0DECL(PVM) GVMMR0GetVMByHandle(uint32_t hGVM); 172 172 GVMMR0DECL(PVM) GVMMR0GetVMByEMT(RTNATIVETHREAD hEMT); 173 GVMMR0DECL(int) GVMMR0SchedHalt(PVM pVM, VMCPUID idCpu, uint64_t u64ExpireGipTime); 174 GVMMR0DECL(int) GVMMR0SchedWakeUp(PVM pVM, VMCPUID idCpu); 175 GVMMR0DECL(int) GVMMR0SchedWakeUpEx(PVM pVM, VMCPUID idCpu, bool fTakeUsedLock); 176 GVMMR0DECL(int) GVMMR0SchedPoke(PVM pVM, VMCPUID idCpu); 177 GVMMR0DECL(int) GVMMR0SchedPokeEx(PVM pVM, VMCPUID idCpu, bool fTakeUsedLock); 173 GVMMR0DECL(int) GVMMR0SchedHalt(PGVM pGVM, PVM pVM, VMCPUID idCpu, uint64_t u64ExpireGipTime); 174 GVMMR0DECL(int) GVMMR0SchedWakeUp(PGVM pGVM, PVM pVM, VMCPUID idCpu); 175 GVMMR0DECL(int) GVMMR0SchedWakeUpEx(PGVM pGVM, PVM pVM, VMCPUID idCpu, bool fTakeUsedLock); 176 GVMMR0DECL(int) GVMMR0SchedWakeUpNoGVMNoLock(PVM pVM, VMCPUID idCpu); 177 GVMMR0DECL(int) GVMMR0SchedPoke(PGVM pGVM, PVM pVM, VMCPUID idCpu); 178 GVMMR0DECL(int) GVMMR0SchedPokeEx(PGVM pGVM, PVM pVM, VMCPUID idCpu, bool fTakeUsedLock); 179 GVMMR0DECL(int) GVMMR0SchedPokeNoGVMNoLock(PVM pVM, VMCPUID idCpu); 178 180 GVMMR0DECL(int) GVMMR0SchedWakeUpAndPokeCpus(PVM pVM, PCVMCPUSET pSleepSet, PCVMCPUSET pPokeSet); 179 181 GVMMR0DECL(int) GVMMR0SchedPoll(PVM pVM, VMCPUID idCpu, bool fYield); -
trunk/src/VBox/VMM/VMMAll/APICAll.cpp
r67051 r67989 2827 2827 { 2828 2828 case VMCPUSTATE_STARTED_EXEC: 2829 GVMMR0SchedPoke Ex(pVM, idCpu, false /* fTakeUsedLock */);2829 GVMMR0SchedPokeNoGVMNoLock(pVM, idCpu); 2830 2830 break; 2831 2831 2832 2832 case VMCPUSTATE_STARTED_HALTED: 2833 GVMMR0SchedWakeUp Ex(pVM, idCpu, false /* fTakeUsedLock */);2833 GVMMR0SchedWakeUpNoGVMNoLock(pVM, idCpu); 2834 2834 break; 2835 2835 -
trunk/src/VBox/VMM/VMMAll/EMAll.cpp
r67131 r67989 304 304 thread-context hooks being used), so don't try obtaining the GVMMR0 used 305 305 lock here. See @bugref{7270#c148}. */ 306 int rc = GVMMR0SchedWakeUp Ex(pVM, pVCpuDst->idCpu, false /* fTakeUsedLock */);306 int rc = GVMMR0SchedWakeUpNoGVMNoLock(pVM, pVCpuDst->idCpu); 307 307 AssertRC(rc); 308 308 -
trunk/src/VBox/VMM/VMMR0/GVMMR0.cpp
r67988 r67989 2123 2123 * @returns VINF_SUCCESS normal wakeup (timeout or kicked by other thread). 2124 2124 * VERR_INTERRUPTED if a signal was scheduled for the thread. 2125 * @param pGVM The global (ring-0) VM structure. 2125 2126 * @param pVM The cross context VM structure. 2126 2127 * @param idCpu The Virtual CPU ID of the calling EMT. … … 2128 2129 * @thread EMT(idCpu). 2129 2130 */ 2130 GVMMR0DECL(int) GVMMR0SchedHalt(P VM pVM, VMCPUID idCpu, uint64_t u64ExpireGipTime)2131 { 2132 LogFlow(("GVMMR0SchedHalt: p VM=%p\n", pVM));2131 GVMMR0DECL(int) GVMMR0SchedHalt(PGVM pGVM, PVM pVM, VMCPUID idCpu, uint64_t u64ExpireGipTime) 2132 { 2133 LogFlow(("GVMMR0SchedHalt: pGVM=%p pVM=%p idCpu=%#x u64ExpireGipTime=%#RX64\n", pGVM, pVM, idCpu, u64ExpireGipTime)); 2133 2134 GVMM_CHECK_SMAP_SETUP(); 2134 2135 GVMM_CHECK_SMAP_CHECK2(pVM, RT_NOTHING); … … 2137 2138 * Validate the VM structure, state and handle. 2138 2139 */ 2139 PGVM pGVM;2140 2140 PGVMM pGVMM; 2141 int rc = gvmmR0By VMAndEMT(pVM, idCpu, &pGVM, &pGVMM);2141 int rc = gvmmR0ByGVMandVMandEMT(pGVM, pVM, idCpu, &pGVMM); 2142 2142 if (RT_FAILURE(rc)) 2143 2143 return rc; … … 2282 2282 * @retval VINF_GVM_NOT_BLOCKED if the EMT wasn't blocked. 2283 2283 * 2284 * @param pGVM The global (ring-0) VM structure. 2284 2285 * @param pVM The cross context VM structure. 2285 2286 * @param idCpu The Virtual CPU ID of the EMT to wake up. 2286 2287 * @param fTakeUsedLock Take the used lock or not 2287 * @thread Any but EMT .2288 */ 2289 GVMMR0DECL(int) GVMMR0SchedWakeUpEx(P VM pVM, VMCPUID idCpu, bool fTakeUsedLock)2288 * @thread Any but EMT(idCpu). 2289 */ 2290 GVMMR0DECL(int) GVMMR0SchedWakeUpEx(PGVM pGVM, PVM pVM, VMCPUID idCpu, bool fTakeUsedLock) 2290 2291 { 2291 2292 GVMM_CHECK_SMAP_SETUP(); … … 2295 2296 * Validate input and take the UsedLock. 2296 2297 */ 2297 PGVM pGVM;2298 2298 PGVMM pGVMM; 2299 int rc = gvmmR0By VM(pVM, &pGVM, &pGVMM, fTakeUsedLock);2299 int rc = gvmmR0ByGVMandVM(pGVM, pVM, &pGVMM, fTakeUsedLock); 2300 2300 GVMM_CHECK_SMAP_CHECK2(pVM, RT_NOTHING); 2301 2301 if (RT_SUCCESS(rc)) … … 2331 2331 } 2332 2332 2333 LogFlow(("GVMMR0SchedWakeUp : returns %Rrc\n", rc));2333 LogFlow(("GVMMR0SchedWakeUpEx: returns %Rrc\n", rc)); 2334 2334 return rc; 2335 2335 } … … 2343 2343 * @retval VINF_GVM_NOT_BLOCKED if the EMT wasn't blocked. 2344 2344 * 2345 * @param pGVM The global (ring-0) VM structure. 2345 2346 * @param pVM The cross context VM structure. 2346 2347 * @param idCpu The Virtual CPU ID of the EMT to wake up. 2347 * @thread Any but EMT. 2348 */ 2349 GVMMR0DECL(int) GVMMR0SchedWakeUp(PVM pVM, VMCPUID idCpu) 2350 { 2351 return GVMMR0SchedWakeUpEx(pVM, idCpu, true /* fTakeUsedLock */); 2352 } 2348 * @thread Any but EMT(idCpu). 2349 */ 2350 GVMMR0DECL(int) GVMMR0SchedWakeUp(PGVM pGVM, PVM pVM, VMCPUID idCpu) 2351 { 2352 return GVMMR0SchedWakeUpEx(pGVM, pVM, idCpu, true /* fTakeUsedLock */); 2353 } 2354 2355 2356 /** 2357 * Wakes up the halted EMT thread so it can service a pending request, no GVM 2358 * parameter and no used locking. 2359 * 2360 * @returns VBox status code. 2361 * @retval VINF_SUCCESS if successfully woken up. 2362 * @retval VINF_GVM_NOT_BLOCKED if the EMT wasn't blocked. 2363 * 2364 * @param pVM The cross context VM structure. 2365 * @param idCpu The Virtual CPU ID of the EMT to wake up. 2366 * @param fTakeUsedLock Take the used lock or not 2367 * @thread Any but EMT(idCpu). 2368 * @deprecated Don't use in new code if possible! Use the GVM variant. 2369 */ 2370 GVMMR0DECL(int) GVMMR0SchedWakeUpNoGVMNoLock(PVM pVM, VMCPUID idCpu) 2371 { 2372 GVMM_CHECK_SMAP_SETUP(); 2373 GVMM_CHECK_SMAP_CHECK2(pVM, RT_NOTHING); 2374 PGVM pGVM; 2375 PGVMM pGVMM; 2376 int rc = gvmmR0ByVM(pVM, &pGVM, &pGVMM, false /*fTakeUsedLock*/); 2377 GVMM_CHECK_SMAP_CHECK2(pVM, RT_NOTHING); 2378 if (RT_SUCCESS(rc)) 2379 rc = GVMMR0SchedWakeUpEx(pGVM, pVM, idCpu, false /*fTakeUsedLock*/); 2380 return rc; 2381 } 2382 2353 2383 2354 2384 /** … … 2380 2410 } 2381 2411 2412 2382 2413 /** 2383 2414 * Pokes an EMT if it's still busy running guest code. … … 2387 2418 * @retval VINF_GVM_NOT_BUSY_IN_GC if the EMT wasn't busy in GC. 2388 2419 * 2420 * @param pGVM The global (ring-0) VM structure. 2389 2421 * @param pVM The cross context VM structure. 2390 2422 * @param idCpu The ID of the virtual CPU to poke. 2391 2423 * @param fTakeUsedLock Take the used lock or not 2392 2424 */ 2393 GVMMR0DECL(int) GVMMR0SchedPokeEx(P VM pVM, VMCPUID idCpu, bool fTakeUsedLock)2425 GVMMR0DECL(int) GVMMR0SchedPokeEx(PGVM pGVM, PVM pVM, VMCPUID idCpu, bool fTakeUsedLock) 2394 2426 { 2395 2427 /* 2396 2428 * Validate input and take the UsedLock. 2397 2429 */ 2398 PGVM pGVM;2399 2430 PGVMM pGVMM; 2400 int rc = gvmmR0By VM(pVM, &pGVM, &pGVMM, fTakeUsedLock);2431 int rc = gvmmR0ByGVMandVM(pGVM, pVM, &pGVMM, fTakeUsedLock); 2401 2432 if (RT_SUCCESS(rc)) 2402 2433 { … … 2425 2456 * @retval VINF_GVM_NOT_BUSY_IN_GC if the EMT wasn't busy in GC. 2426 2457 * 2458 * @param pGVM The global (ring-0) VM structure. 2427 2459 * @param pVM The cross context VM structure. 2428 2460 * @param idCpu The ID of the virtual CPU to poke. 2429 2461 */ 2430 GVMMR0DECL(int) GVMMR0SchedPoke(PVM pVM, VMCPUID idCpu) 2431 { 2432 return GVMMR0SchedPokeEx(pVM, idCpu, true /* fTakeUsedLock */); 2462 GVMMR0DECL(int) GVMMR0SchedPoke(PGVM pGVM, PVM pVM, VMCPUID idCpu) 2463 { 2464 return GVMMR0SchedPokeEx(pGVM, pVM, idCpu, true /* fTakeUsedLock */); 2465 } 2466 2467 2468 /** 2469 * Pokes an EMT if it's still busy running guest code, no GVM parameter and no 2470 * used locking. 2471 * 2472 * @returns VBox status code. 2473 * @retval VINF_SUCCESS if poked successfully. 2474 * @retval VINF_GVM_NOT_BUSY_IN_GC if the EMT wasn't busy in GC. 2475 * 2476 * @param pVM The cross context VM structure. 2477 * @param idCpu The ID of the virtual CPU to poke. 2478 * 2479 * @deprecated Don't use in new code if possible! Use the GVM variant. 2480 */ 2481 GVMMR0DECL(int) GVMMR0SchedPokeNoGVMNoLock(PVM pVM, VMCPUID idCpu) 2482 { 2483 PGVM pGVM; 2484 PGVMM pGVMM; 2485 int rc = gvmmR0ByVM(pVM, &pGVM, &pGVMM, false /*fTakeUsedLock*/); 2486 if (RT_SUCCESS(rc)) 2487 { 2488 if (idCpu < pGVM->cCpus) 2489 rc = gvmmR0SchedPokeOne(pGVM, &pVM->aCpus[idCpu]); 2490 else 2491 rc = VERR_INVALID_CPU_ID; 2492 } 2493 return rc; 2433 2494 } 2434 2495 -
trunk/src/VBox/VMM/VMMR0/VMMR0.cpp
r67987 r67989 1456 1456 return VERR_INVALID_PARAMETER; 1457 1457 VMM_CHECK_SMAP_CHECK2(pVM, RT_NOTHING); 1458 rc = GVMMR0SchedHalt(p VM, idCpu, u64Arg);1458 rc = GVMMR0SchedHalt(pGVM, pVM, idCpu, u64Arg); 1459 1459 VMM_CHECK_SMAP_CHECK2(pVM, RT_NOTHING); 1460 1460 break; … … 1464 1464 return VERR_INVALID_PARAMETER; 1465 1465 VMM_CHECK_SMAP_CHECK2(pVM, RT_NOTHING); 1466 rc = GVMMR0SchedWakeUp(p VM, idCpu);1466 rc = GVMMR0SchedWakeUp(pGVM, pVM, idCpu); 1467 1467 VMM_CHECK_SMAP_CHECK2(pVM, RT_NOTHING); 1468 1468 break; … … 1471 1471 if (pReqHdr || u64Arg) 1472 1472 return VERR_INVALID_PARAMETER; 1473 rc = GVMMR0SchedPoke(p VM, idCpu);1473 rc = GVMMR0SchedPoke(pGVM, pVM, idCpu); 1474 1474 VMM_CHECK_SMAP_CHECK2(pVM, RT_NOTHING); 1475 1475 break;
Note:
See TracChangeset
for help on using the changeset viewer.