Changeset 38838 in vbox
- Timestamp:
- Sep 23, 2011 11:21:55 AM (13 years ago)
- Location:
- trunk
- Files:
-
- 34 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/VBox/vmm/dbgf.h
r35694 r38838 510 510 VMMR3DECL(int) DBGFR3InfoDeregisterExternal(PVM pVM, const char *pszName); 511 511 VMMR3DECL(int) DBGFR3Info(PVM pVM, const char *pszName, const char *pszArgs, PCDBGFINFOHLP pHlp); 512 VMMR3DECL(int) DBGFR3InfoEx(PVM pVM, VMCPUID idCpu, const char *pszName, const char *pszArgs, PCDBGFINFOHLP pHlp); 512 513 VMMR3DECL(int) DBGFR3InfoLogRel(PVM pVM, const char *pszName, const char *pszArgs); 513 514 VMMR3DECL(int) DBGFR3InfoStdErr(PVM pVM, const char *pszName, const char *pszArgs); -
trunk/include/VBox/vmm/vmapi.h
r37211 r38838 227 227 VMREQFLAGS_NO_WAIT = 2, 228 228 /** Poke the destination EMT(s) if executing guest code. Use with care. */ 229 VMREQFLAGS_POKE = 4 229 VMREQFLAGS_POKE = 4, 230 /** Priority request that can safely be processed while doing async 231 * suspend and power off. */ 232 VMREQFLAGS_PRIORITY = 8 230 233 } VMREQFLAGS; 231 234 … … 385 388 VMMR3DECL(int) VMR3ReqCallVU(PUVM pUVM, VMCPUID idDstCpu, PVMREQ *ppReq, RTMSINTERVAL cMillies, uint32_t fFlags, PFNRT pfnFunction, unsigned cArgs, va_list Args); 386 389 VMMR3DECL(int) VMR3ReqCallWait(PVM pVM, VMCPUID idDstCpu, PFNRT pfnFunction, unsigned cArgs, ...); 387 VMMR3DECL(int) VMR3ReqCallWaitU(PUVM pUVM, VMCPUID idDstCpu, PFNRT pfnFunction, unsigned cArgs, ...);388 390 VMMR3DECL(int) VMR3ReqCallNoWait(PVM pVM, VMCPUID idDstCpu, PFNRT pfnFunction, unsigned cArgs, ...); 389 VMMR3DECL(int) VMR3ReqCallNoWaitU(PUVM pUVM, VMCPUID idDstCpu, PFNRT pfnFunction, unsigned cArgs, ...);390 391 VMMR3DECL(int) VMR3ReqCallVoidWait(PVM pVM, VMCPUID idDstCpu, PFNRT pfnFunction, unsigned cArgs, ...); 391 VMMR3DECL(int) VMR3ReqCallVoidWaitU(PUVM pUVM, VMCPUID idDstCpu, PFNRT pfnFunction, unsigned cArgs, ...);392 392 VMMR3DECL(int) VMR3ReqCallVoidNoWait(PVM pVM, VMCPUID idDstCpu, PFNRT pfnFunction, unsigned cArgs, ...); 393 VMMR3DECL(int) VMR3ReqCallVoidNoWaitU(PUVM pUVM, VMCPUID idDstCpu, PFNRT pfnFunction, unsigned cArgs, ...); 393 VMMR3DECL(int) VMR3ReqPriorityCallWait(PVM pVM, VMCPUID idDstCpu, PFNRT pfnFunction, unsigned cArgs, ...); 394 VMMR3DECL(int) VMR3ReqPriorityCallVoidWait(PVM pVM, VMCPUID idDstCpu, PFNRT pfnFunction, unsigned cArgs, ...); 394 395 VMMR3DECL(int) VMR3ReqAlloc(PVM pVM, PVMREQ *ppReq, VMREQTYPE enmType, VMCPUID idDstCpu); 395 396 VMMR3DECL(int) VMR3ReqAllocU(PUVM pUVM, PVMREQ *ppReq, VMREQTYPE enmType, VMCPUID idDstCpu); … … 397 398 VMMR3DECL(int) VMR3ReqQueue(PVMREQ pReq, RTMSINTERVAL cMillies); 398 399 VMMR3DECL(int) VMR3ReqWait(PVMREQ pReq, RTMSINTERVAL cMillies); 399 VMMR3DECL(int) VMR3ReqProcessU(PUVM pUVM, VMCPUID idDstCpu );400 VMMR3DECL(int) VMR3ReqProcessU(PUVM pUVM, VMCPUID idDstCpu, bool fPriorityOnly); 400 401 VMMR3DECL(void) VMR3NotifyGlobalFFU(PUVM pUVM, uint32_t fFlags); 401 402 VMMR3DECL(void) VMR3NotifyCpuFFU(PUVMCPU pUVMCpu, uint32_t fFlags); -
trunk/src/VBox/Debugger/DBGCCommands.cpp
r35696 r38838 906 906 * Dump it. 907 907 */ 908 /** @todo DBGFR3Info should do this, not we. */909 int rc = VMR3ReqCallWait(pVM, pDbgc->idCpu, (PFNRT)DBGFR3Info, 4,910 pVM, paArgs[0].u.pszString, cArgs == 2 ? paArgs[1].u.pszString : NULL,911 908 int rc = DBGFR3InfoEx(pVM, pDbgc->idCpu, 909 paArgs[0].u.pszString, 910 cArgs == 2 ? paArgs[1].u.pszString : NULL, 911 DBGCCmdHlpGetDbgfOutputHlp(pCmdHlp)); 912 912 if (RT_FAILURE(rc)) 913 return pCmdHlp->pfnVBoxError(pCmdHlp, rc, "DBGFR3Info ()\n");913 return pCmdHlp->pfnVBoxError(pCmdHlp, rc, "DBGFR3InfoEx()\n"); 914 914 915 915 NOREF(pCmd); -
trunk/src/VBox/Debugger/testcase/tstDBGCStubs.cpp
r35629 r38838 104 104 } 105 105 VMMR3DECL(int) DBGFR3Info(PVM pVM, const char *pszName, const char *pszArgs, PCDBGFINFOHLP pHlp) 106 { 107 return VERR_INTERNAL_ERROR; 108 } 109 VMMR3DECL(int) DBGFR3InfoEx(PVM pVM, VMCPUID idCpu, const char *pszName, const char *pszArgs, PCDBGFINFOHLP pHlp) 106 110 { 107 111 return VERR_INTERNAL_ERROR; … … 405 409 } 406 410 407 VMMR3DECL(int) VMR3ReqCallWait(PVM pVm, VMCPUID idDstCpu, PFNRT pfnFunction, unsigned cArgs, ...)408 {409 return VERR_INTERNAL_ERROR;410 } -
trunk/src/VBox/Devices/Storage/ATAController.cpp
r37687 r38838 2408 2408 2409 2409 PDMCritSectLeave(&pCtl->lock); 2410 rc = VMR3Req CallWait(PDMDevHlpGetVM(pDevIns), VMCPUID_ANY,2411 (PFNRT)s->pDrvMount->pfnUnmount, 3, s->pDrvMount,2412 false /*=fForce*/, true /*=fEeject*/);2410 rc = VMR3ReqPriorityCallWait(PDMDevHlpGetVM(pDevIns), VMCPUID_ANY, 2411 (PFNRT)s->pDrvMount->pfnUnmount, 3, s->pDrvMount, 2412 false /*=fForce*/, true /*=fEeject*/); 2413 2413 Assert(RT_SUCCESS(rc) || (rc == VERR_PDM_MEDIA_LOCKED) || (rc = VERR_PDM_MEDIA_NOT_MOUNTED)); 2414 2414 if (RT_SUCCESS(rc) && pCtl->pMediaNotify) -
trunk/src/VBox/Devices/Storage/DevAHCI.cpp
r38675 r38838 4415 4415 PPDMDEVINS pDevIns = pAhci->CTX_SUFF(pDevIns); 4416 4416 4417 rc2 = VMR3Req CallWait(PDMDevHlpGetVM(pDevIns), VMCPUID_ANY,4418 (PFNRT)pAhciPort->pDrvMount->pfnUnmount, 3,4419 pAhciPort->pDrvMount, false/*=fForce*/, true/*=fEject*/);4417 rc2 = VMR3ReqPriorityCallWait(PDMDevHlpGetVM(pDevIns), VMCPUID_ANY, 4418 (PFNRT)pAhciPort->pDrvMount->pfnUnmount, 3, 4419 pAhciPort->pDrvMount, false/*=fForce*/, true/*=fEject*/); 4420 4420 Assert(RT_SUCCESS(rc2) || (rc2 == VERR_PDM_MEDIA_LOCKED) || (rc2 = VERR_PDM_MEDIA_NOT_MOUNTED)); 4421 4421 if (RT_SUCCESS(rc) && pAhci->pMediaNotify) -
trunk/src/VBox/Devices/Storage/DevATA.cpp
r38710 r38838 3125 3125 3126 3126 PDMCritSectLeave(&pCtl->lock); 3127 rc = VMR3Req CallWait(PDMDevHlpGetVM(pDevIns), VMCPUID_ANY,3128 (PFNRT)s->pDrvMount->pfnUnmount, 3,3129 s->pDrvMount, false /*=fForce*/, true /*=fEject*/);3127 rc = VMR3ReqPriorityCallWait(PDMDevHlpGetVM(pDevIns), VMCPUID_ANY, 3128 (PFNRT)s->pDrvMount->pfnUnmount, 3, 3129 s->pDrvMount, false /*=fForce*/, true /*=fEject*/); 3130 3130 Assert(RT_SUCCESS(rc) || (rc == VERR_PDM_MEDIA_LOCKED) || (rc = VERR_PDM_MEDIA_NOT_MOUNTED)); 3131 3131 if (RT_SUCCESS(rc) && pThis->pMediaNotify) -
trunk/src/VBox/Main/src-client/DisplayImpl.cpp
r38642 r38838 2288 2288 while (cRetries-- > 0) 2289 2289 { 2290 vrc = VMR3ReqCallWait(pVM, VMCPUID_ANY, (PFNRT)Display::displayTakeScreenshotEMT, 6, 2291 pDisplay, aScreenId, &pu8Data, &cbData, &cx, &cy); 2290 /* Note! Not sure if the priority call is such a good idea here, but 2291 it would be nice to have an accurate screenshot for the bug 2292 report if the VM deadlocks. */ 2293 vrc = VMR3ReqPriorityCallWait(pVM, VMCPUID_ANY, (PFNRT)Display::displayTakeScreenshotEMT, 6, 2294 pDisplay, aScreenId, &pu8Data, &cbData, &cx, &cy); 2292 2295 if (vrc != VERR_TRY_AGAIN) 2293 2296 { -
trunk/src/VBox/VMM/VMMAll/VMAll.cpp
r35346 r38838 81 81 va_list va2; 82 82 va_copy(va2, args); /* Have to make a copy here or GCC will break. */ 83 VMR3Req CallWait(pVM, VMCPUID_ANY, (PFNRT)vmR3SetErrorUV, 7, /* ASSUMES 3 source pos args! */84 pVM->pUVM, rc, RT_SRC_POS_ARGS, pszFormat, &va2);83 VMR3ReqPriorityCallWait(pVM, VMCPUID_ANY, (PFNRT)vmR3SetErrorUV, 7, /* ASSUMES 3 source pos args! */ 84 pVM->pUVM, rc, RT_SRC_POS_ARGS, pszFormat, &va2); 85 85 va_end(va2); 86 86 … … 262 262 va_list va2; 263 263 va_copy(va2, va); /* Have to make a copy here or GCC will break. */ 264 rc = VMR3Req CallWaitU(pVM->pUVM, VMCPUID_ANY,265 (PFNRT)vmR3SetRuntimeErrorV, 5, pVM, fFlags, pszErrorId, pszFormat, &va2);264 rc = VMR3ReqPriorityCallWait(pVM, VMCPUID_ANY, 265 (PFNRT)vmR3SetRuntimeErrorV, 5, pVM, fFlags, pszErrorId, pszFormat, &va2); 266 266 va_end(va2); 267 267 } … … 269 269 { 270 270 char *pszMessage = MMR3HeapAPrintfV(pVM, MM_TAG_VM, pszFormat, va); 271 rc = VMR3ReqCallNoWait U(pVM->pUVM, VMCPUID_ANY,272 271 rc = VMR3ReqCallNoWait(pVM, VMCPUID_ANY, 272 (PFNRT)vmR3SetRuntimeError, 4, pVM, fFlags, pszErrorId, pszMessage); 273 273 if (RT_FAILURE(rc)) 274 274 MMR3HeapFree(pszMessage); -
trunk/src/VBox/VMM/VMMR3/DBGF.cpp
r37410 r38838 650 650 { 651 651 LogFlow(("dbgfR3VMMWait: Processes requests...\n")); 652 rc = VMR3ReqProcessU(pVM->pUVM, VMCPUID_ANY );652 rc = VMR3ReqProcessU(pVM->pUVM, VMCPUID_ANY, false /*fPriorityOnly*/); 653 653 if (rc == VINF_SUCCESS) 654 rc = VMR3ReqProcessU(pVM->pUVM, pVCpu->idCpu );654 rc = VMR3ReqProcessU(pVM->pUVM, pVCpu->idCpu, false /*fPriorityOnly*/); 655 655 LogFlow(("dbgfR3VMMWait: VMR3ReqProcess -> %Rrc rcRet=%Rrc\n", rc, rcRet)); 656 656 cPollHack = 1; … … 854 854 VMMR3DECL(int) DBGFR3Attach(PVM pVM) 855 855 { 856 /* 857 * Some validations first. 858 */ 859 if (!VALID_PTR(pVM)) 860 { 861 Log(("DBGFR3Attach: bad VM handle: %p\n", pVM)); 862 return VERR_INVALID_HANDLE; 863 } 864 VMSTATE enmVMState = pVM->enmVMState; 865 if ( enmVMState >= VMSTATE_DESTROYING 866 || enmVMState < VMSTATE_CREATING) 867 { 868 Log(("DBGFR3Attach: Invalid VM state: %s\n", VMGetStateName(enmVMState))); 869 return VERR_INVALID_HANDLE; 870 } 856 VM_ASSERT_VALID_EXT_RETURN(pVM, VERR_INVALID_VM_HANDLE); 871 857 872 858 /* -
trunk/src/VBox/VMM/VMMR3/DBGFAddr.cpp
r35346 r38838 274 274 rc = dbgfR3AddrToPhysOnVCpu(pVCpu, pAddress, pGCPhys); 275 275 else 276 rc = VMR3Req CallWait(pVCpu->pVMR3, pVCpu->idCpu,277 (PFNRT)dbgfR3AddrToPhysOnVCpu, 3, pVCpu, pAddress, pGCPhys);276 rc = VMR3ReqPriorityCallWait(pVCpu->pVMR3, pVCpu->idCpu, 277 (PFNRT)dbgfR3AddrToPhysOnVCpu, 3, pVCpu, pAddress, pGCPhys); 278 278 } 279 279 return rc; … … 432 432 * Convert it. 433 433 */ 434 return VMR3Req CallWait(pVM, idCpu, (PFNRT)dbgfR3AddrToVolatileR3PtrOnVCpu, 5, pVM, idCpu, pAddress, fReadOnly, ppvR3Ptr);434 return VMR3ReqPriorityCallWait(pVM, idCpu, (PFNRT)dbgfR3AddrToVolatileR3PtrOnVCpu, 5, pVM, idCpu, pAddress, fReadOnly, ppvR3Ptr); 435 435 } 436 436 -
trunk/src/VBox/VMM/VMMR3/DBGFBp.cpp
r35694 r38838 281 281 { 282 282 /* 283 * This must be done in EMT.283 * This must be done on EMT. 284 284 */ 285 285 /** @todo SMP? */ 286 int rc = VMR3Req CallWait(pVM, VMCPUID_ANY, (PFNRT)dbgfR3BpSetInt3, 5, pVM, pAddress, &iHitTrigger, &iHitDisable, piBp);286 int rc = VMR3ReqPriorityCallWait(pVM, VMCPUID_ANY, (PFNRT)dbgfR3BpSetInt3, 5, pVM, pAddress, &iHitTrigger, &iHitDisable, piBp); 287 287 LogFlow(("DBGFR3BpSet: returns %Rrc\n", rc)); 288 288 return rc; … … 439 439 /** @todo SMP - broadcast, VT-x/AMD-V. */ 440 440 /* 441 * This must be done in EMT.442 */ 443 int rc = VMR3Req CallWait(pVM, VMCPUID_ANY, (PFNRT)dbgfR3BpSetReg, 7, pVM, pAddress, &iHitTrigger, &iHitDisable, fType, cb, piBp);441 * This must be done on EMT. 442 */ 443 int rc = VMR3ReqPriorityCallWait(pVM, VMCPUID_ANY, (PFNRT)dbgfR3BpSetReg, 7, pVM, pAddress, &iHitTrigger, &iHitDisable, fType, cb, piBp); 444 444 LogFlow(("DBGFR3BpSetReg: returns %Rrc\n", rc)); 445 445 return rc; … … 606 606 { 607 607 /* 608 * This must be done in EMT.609 */ 610 int rc = VMR3Req CallWait(pVM, VMCPUID_ANY, (PFNRT)dbgfR3BpSetREM, 5, pVM, pAddress, &iHitTrigger, &iHitDisable, piBp);608 * This must be done on EMT. 609 */ 610 int rc = VMR3ReqPriorityCallWait(pVM, VMCPUID_ANY, (PFNRT)dbgfR3BpSetREM, 5, pVM, pAddress, &iHitTrigger, &iHitDisable, piBp); 611 611 LogFlow(("DBGFR3BpSetREM: returns %Rrc\n", rc)); 612 612 return rc; … … 698 698 { 699 699 /* 700 * This must be done in EMT.701 */ 702 int rc = VMR3Req CallWait(pVM, VMCPUID_ANY, (PFNRT)dbgfR3BpClear, 2, pVM, iBp);700 * This must be done on EMT. 701 */ 702 int rc = VMR3ReqPriorityCallWait(pVM, VMCPUID_ANY, (PFNRT)dbgfR3BpClear, 2, pVM, iBp); 703 703 LogFlow(("DBGFR3BpClear: returns %Rrc\n", rc)); 704 704 return rc; … … 771 771 { 772 772 /* 773 * This must be done in EMT.774 */ 775 int rc = VMR3Req CallWait(pVM, VMCPUID_ANY, (PFNRT)dbgfR3BpEnable, 2, pVM, iBp);773 * This must be done on EMT. 774 */ 775 int rc = VMR3ReqPriorityCallWait(pVM, VMCPUID_ANY, (PFNRT)dbgfR3BpEnable, 2, pVM, iBp); 776 776 LogFlow(("DBGFR3BpEnable: returns %Rrc\n", rc)); 777 777 return rc; … … 844 844 { 845 845 /* 846 * This must be done in EMT.847 */ 848 int rc = VMR3Req CallWait(pVM, VMCPUID_ANY, (PFNRT)dbgfR3BpDisable, 2, pVM, iBp);846 * This must be done on EMT. 847 */ 848 int rc = VMR3ReqPriorityCallWait(pVM, VMCPUID_ANY, (PFNRT)dbgfR3BpDisable, 2, pVM, iBp); 849 849 LogFlow(("DBGFR3BpDisable: returns %Rrc\n", rc)); 850 850 return rc; … … 916 916 { 917 917 /* 918 * This must be done in EMT.919 */ 920 int rc = VMR3Req CallWait(pVM, VMCPUID_ANY, (PFNRT)dbgfR3BpEnum, 3, pVM, pfnCallback, pvUser);918 * This must be done on EMT. 919 */ 920 int rc = VMR3ReqPriorityCallWait(pVM, VMCPUID_ANY, (PFNRT)dbgfR3BpEnum, 3, pVM, pfnCallback, pvUser); 921 921 LogFlow(("DBGFR3BpClear: returns %Rrc\n", rc)); 922 922 return rc; -
trunk/src/VBox/VMM/VMMR3/DBGFCpu.cpp
r35346 r38838 61 61 62 62 CPUMMODE enmMode; 63 int rc = VMR3Req CallWait(pVM, idCpu, (PFNRT)dbgfR3CpuGetMode, 3, pVM, idCpu, &enmMode);63 int rc = VMR3ReqPriorityCallWait(pVM, idCpu, (PFNRT)dbgfR3CpuGetMode, 3, pVM, idCpu, &enmMode); 64 64 if (RT_FAILURE(rc)) 65 65 return CPUMMODE_INVALID; -
trunk/src/VBox/VMM/VMMR3/DBGFDisas.cpp
r35346 r38838 593 593 rc = dbgfR3DisasInstrExOnVCpu(pVM, pVCpu, Sel, &GCPtr, fFlags, pszOutput, cbOutput, pcbInstr); 594 594 else 595 rc = VMR3Req CallWait(pVM, idCpu, (PFNRT)dbgfR3DisasInstrExOnVCpu, 8,596 pVM, VMMGetCpuById(pVM, idCpu), Sel, &GCPtr, fFlags, pszOutput, cbOutput, pcbInstr);595 rc = VMR3ReqPriorityCallWait(pVM, idCpu, (PFNRT)dbgfR3DisasInstrExOnVCpu, 8, 596 pVM, VMMGetCpuById(pVM, idCpu), Sel, &GCPtr, fFlags, pszOutput, cbOutput, pcbInstr); 597 597 return rc; 598 598 } -
trunk/src/VBox/VMM/VMMR3/DBGFInfo.cpp
r35346 r38838 685 685 686 686 /** 687 * Display a piece of info writing to the supplied handler. 688 * 689 * @returns VBox status code. 690 * @param pVM VM handle. 691 * @param pszName The identifier of the info to display. 692 * @param pszArgs Arguments to the info handler. 693 * @param pHlp The output helper functions. If NULL the logger will be used. 694 */ 695 VMMR3DECL(int) DBGFR3Info(PVM pVM, const char *pszName, const char *pszArgs, PCDBGFINFOHLP pHlp) 687 * Worker for DBGFR3Info and DBGFR3InfoEx. 688 * 689 * @returns VBox status code. 690 * @param pVM The VM handle. 691 * @param idCpu Which CPU to run EMT bound handlers on. 692 * VMCPUID_ANY or a valid CPU ID. 693 * @param pszName What to dump. 694 * @param pszArgs Arguments, optional. 695 * @param pHlp Output helper, optional. 696 */ 697 static DECLCALLBACK(int) dbgfR3Info(PVM pVM, VMCPUID idCpu, const char *pszName, const char *pszArgs, PCDBGFINFOHLP pHlp) 696 698 { 697 699 /* 698 700 * Validate input. 699 701 */ 700 if (!pszName) 701 { 702 AssertMsgFailed(("!pszName\n")); 703 return VERR_INVALID_PARAMETER; 704 } 702 AssertPtrReturn(pszName, VERR_INVALID_POINTER); 705 703 if (pHlp) 706 704 { … … 741 739 case DBGFINFOTYPE_DEV: 742 740 if (Info.fFlags & DBGFINFO_FLAGS_RUN_ON_EMT) 743 rc = VMR3ReqCallVoidWait(pVM, VMCPUID_ANY, (PFNRT)Info.u.Dev.pfnHandler, 3, Info.u.Dev.pDevIns, pHlp, pszArgs);741 rc = VMR3ReqCallVoidWait(pVM, idCpu, (PFNRT)Info.u.Dev.pfnHandler, 3, Info.u.Dev.pDevIns, pHlp, pszArgs); 744 742 else 745 743 Info.u.Dev.pfnHandler(Info.u.Dev.pDevIns, pHlp, pszArgs); … … 748 746 case DBGFINFOTYPE_DRV: 749 747 if (Info.fFlags & DBGFINFO_FLAGS_RUN_ON_EMT) 750 rc = VMR3ReqCallVoidWait(pVM, VMCPUID_ANY, (PFNRT)Info.u.Drv.pfnHandler, 3, Info.u.Drv.pDrvIns, pHlp, pszArgs);748 rc = VMR3ReqCallVoidWait(pVM, idCpu, (PFNRT)Info.u.Drv.pfnHandler, 3, Info.u.Drv.pDrvIns, pHlp, pszArgs); 751 749 else 752 750 Info.u.Drv.pfnHandler(Info.u.Drv.pDrvIns, pHlp, pszArgs); … … 755 753 case DBGFINFOTYPE_INT: 756 754 if (Info.fFlags & DBGFINFO_FLAGS_RUN_ON_EMT) 757 rc = VMR3ReqCallVoidWait(pVM, VMCPUID_ANY, (PFNRT)Info.u.Int.pfnHandler, 3, pVM, pHlp, pszArgs);755 rc = VMR3ReqCallVoidWait(pVM, idCpu, (PFNRT)Info.u.Int.pfnHandler, 3, pVM, pHlp, pszArgs); 758 756 else 759 757 Info.u.Int.pfnHandler(pVM, pHlp, pszArgs); … … 762 760 case DBGFINFOTYPE_EXT: 763 761 if (Info.fFlags & DBGFINFO_FLAGS_RUN_ON_EMT) 764 rc = VMR3ReqCallVoidWait(pVM, VMCPUID_ANY, (PFNRT)Info.u.Ext.pfnHandler, 3, Info.u.Ext.pvUser, pHlp, pszArgs);762 rc = VMR3ReqCallVoidWait(pVM, idCpu, (PFNRT)Info.u.Ext.pfnHandler, 3, Info.u.Ext.pvUser, pHlp, pszArgs); 765 763 else 766 764 Info.u.Ext.pfnHandler(Info.u.Ext.pvUser, pHlp, pszArgs); … … 780 778 } 781 779 return rc; 780 } 781 782 /** 783 * Display a piece of info writing to the supplied handler. 784 * 785 * @returns VBox status code. 786 * @param pVM VM handle. 787 * @param pszName The identifier of the info to display. 788 * @param pszArgs Arguments to the info handler. 789 * @param pHlp The output helper functions. If NULL the logger will be used. 790 */ 791 VMMR3DECL(int) DBGFR3Info(PVM pVM, const char *pszName, const char *pszArgs, PCDBGFINFOHLP pHlp) 792 { 793 return dbgfR3Info(pVM, VMCPUID_ANY, pszName, pszArgs, pHlp); 794 } 795 796 797 /** 798 * Display a piece of info writing to the supplied handler. 799 * 800 * @returns VBox status code. 801 * @param pVM VM handle. 802 * @param idCpu The CPU to exectue the request on. Pass NIL_VMCPUID 803 * to not involve any EMT. 804 * @param pszName The identifier of the info to display. 805 * @param pszArgs Arguments to the info handler. 806 * @param pHlp The output helper functions. If NULL the logger will be used. 807 */ 808 VMMR3DECL(int) DBGFR3InfoEx(PVM pVM, VMCPUID idCpu, const char *pszName, const char *pszArgs, PCDBGFINFOHLP pHlp) 809 { 810 if (idCpu == NIL_VMCPUID) 811 return dbgfR3Info(pVM, VMCPUID_ANY, pszName, pszArgs, pHlp); 812 return VMR3ReqPriorityCallWait(pVM, idCpu, 813 (PFNRT)dbgfR3Info, 5, pVM, idCpu, pszName, pszArgs, pHlp); 782 814 } 783 815 -
trunk/src/VBox/VMM/VMMR3/DBGFLog.cpp
r35346 r38838 48 48 AssertPtrReturn(pszGroupSettings, VERR_INVALID_POINTER); 49 49 50 return VMR3Req CallWait(pVM, VMCPUID_ANY, (PFNRT)dbgfR3LogModifyGroups, 2, pVM, pszGroupSettings);50 return VMR3ReqPriorityCallWait(pVM, VMCPUID_ANY, (PFNRT)dbgfR3LogModifyGroups, 2, pVM, pszGroupSettings); 51 51 } 52 52 … … 80 80 AssertPtrReturn(pszFlagSettings, VERR_INVALID_POINTER); 81 81 82 return VMR3Req CallWait(pVM, VMCPUID_ANY, (PFNRT)dbgfR3LogModifyFlags, 2, pVM, pszFlagSettings);82 return VMR3ReqPriorityCallWait(pVM, VMCPUID_ANY, (PFNRT)dbgfR3LogModifyFlags, 2, pVM, pszFlagSettings); 83 83 } 84 84 … … 112 112 AssertReturn(VALID_PTR(pszDestSettings), VERR_INVALID_POINTER); 113 113 114 return VMR3Req CallWait(pVM, VMCPUID_ANY, (PFNRT)dbgfR3LogModifyDestinations, 2, pVM, pszDestSettings);114 return VMR3ReqPriorityCallWait(pVM, VMCPUID_ANY, (PFNRT)dbgfR3LogModifyDestinations, 2, pVM, pszDestSettings); 115 115 } 116 116 -
trunk/src/VBox/VMM/VMMR3/DBGFMem.cpp
r35346 r38838 127 127 VM_ASSERT_VALID_EXT_RETURN(pVM, VERR_INVALID_VM_HANDLE); 128 128 AssertReturn(idCpu < pVM->cCpus, VERR_INVALID_CPU_ID); 129 return VMR3Req CallWait(pVM, idCpu, (PFNRT)dbgfR3MemScan, 8,130 pVM, idCpu, pAddress, &cbRange, &uAlign, pvNeedle, cbNeedle, pHitAddress);129 return VMR3ReqPriorityCallWait(pVM, idCpu, (PFNRT)dbgfR3MemScan, 8, 130 pVM, idCpu, pAddress, &cbRange, &uAlign, pvNeedle, cbNeedle, pHitAddress); 131 131 132 132 } … … 212 212 return VMMR3ReadR0Stack(pVM, idCpu, (RTHCUINTPTR)pAddress->FlatPtr, pvBuf, cbRead); 213 213 } 214 return VMR3Req CallWaitU(pVM->pUVM, idCpu, (PFNRT)dbgfR3MemRead, 5, pVM, idCpu, pAddress, pvBuf, cbRead);214 return VMR3ReqPriorityCallWait(pVM, idCpu, (PFNRT)dbgfR3MemRead, 5, pVM, idCpu, pAddress, pvBuf, cbRead); 215 215 } 216 216 … … 291 291 * Pass it on to the EMT. 292 292 */ 293 return VMR3Req CallWaitU(pVM->pUVM, idCpu, (PFNRT)dbgfR3MemReadString, 5, pVM, idCpu, pAddress, pszBuf, cchBuf);293 return VMR3ReqPriorityCallWait(pVM, idCpu, (PFNRT)dbgfR3MemReadString, 5, pVM, idCpu, pAddress, pszBuf, cchBuf); 294 294 } 295 295 … … 367 367 VM_ASSERT_VALID_EXT_RETURN(pVM, VERR_INVALID_VM_HANDLE); 368 368 AssertReturn(idCpu < pVM->cCpus, VERR_INVALID_CPU_ID); 369 return VMR3Req CallWaitU(pVM->pUVM, idCpu, (PFNRT)dbgfR3MemWrite, 5, pVM, idCpu, pAddress, pvBuf, cbWrite);369 return VMR3ReqPriorityCallWait(pVM, idCpu, (PFNRT)dbgfR3MemWrite, 5, pVM, idCpu, pAddress, pvBuf, cbWrite); 370 370 } 371 371 … … 470 470 * Dispatch the request to a worker running on the target CPU. 471 471 */ 472 return VMR3Req CallWaitU(pVM->pUVM, idCpu, (PFNRT)dbgfR3SelQueryInfo, 5, pVM, idCpu, Sel, fFlags, pSelInfo);472 return VMR3ReqPriorityCallWait(pVM, idCpu, (PFNRT)dbgfR3SelQueryInfo, 5, pVM, idCpu, Sel, fFlags, pSelInfo); 473 473 } 474 474 … … 657 657 * Forward the request to the target CPU. 658 658 */ 659 return VMR3Req CallWaitU(pVM->pUVM, idCpu, (PFNRT)dbgfR3PagingDumpEx, 8,660 pVM, idCpu, fFlags, &cr3, &u64FirstAddr, &u64LastAddr, cMaxDepth, pHlp);661 } 662 659 return VMR3ReqPriorityCallWait(pVM, idCpu, (PFNRT)dbgfR3PagingDumpEx, 8, 660 pVM, idCpu, fFlags, &cr3, &u64FirstAddr, &u64LastAddr, cMaxDepth, pHlp); 661 } 662 -
trunk/src/VBox/VMM/VMMR3/DBGFOS.cpp
r35346 r38838 156 156 * Pass it on to EMT(0). 157 157 */ 158 return VMR3Req CallWaitU(pVM->pUVM, 0 /*idDstCpu*/, (PFNRT)dbgfR3OSRegister, 2, pVM, pReg);158 return VMR3ReqPriorityCallWait(pVM, 0 /*idDstCpu*/, (PFNRT)dbgfR3OSRegister, 2, pVM, pReg); 159 159 } 160 160 … … 247 247 * Pass it on to EMT(0). 248 248 */ 249 return VMR3Req CallWaitU(pVM->pUVM, 0 /*idDstCpu*/, (PFNRT)dbgfR3OSDeregister, 2, pVM, pReg);249 return VMR3ReqPriorityCallWait(pVM, 0 /*idDstCpu*/, (PFNRT)dbgfR3OSDeregister, 2, pVM, pReg); 250 250 } 251 251 … … 319 319 * Pass it on to EMT(0). 320 320 */ 321 return VMR3Req CallWaitU(pVM->pUVM, 0 /*idDstCpu*/, (PFNRT)dbgfR3OSDetect, 3, pVM, pszName, cchName);321 return VMR3ReqPriorityCallWait(pVM, 0 /*idDstCpu*/, (PFNRT)dbgfR3OSDetect, 3, pVM, pszName, cchName); 322 322 } 323 323 … … 397 397 * Pass it on to EMT(0). 398 398 */ 399 return VMR3Req CallWaitU(pVM->pUVM, 0 /*idDstCpu*/,400 (PFNRT)dbgfR3OSQueryNameAndVersion, 5, pVM, pszName, cchName, pszVersion, cchVersion);399 return VMR3ReqPriorityCallWait(pVM, 0 /*idDstCpu*/, 400 (PFNRT)dbgfR3OSQueryNameAndVersion, 5, pVM, pszName, cchName, pszVersion, cchVersion); 401 401 } 402 402 … … 442 442 */ 443 443 void *pvIf = NULL; 444 VMR3Req CallVoidWait(pVM, VMCPUID_ANY, (PFNRT)dbgfR3OSQueryInterface, 3, pVM, enmIf, &pvIf);444 VMR3ReqPriorityCallVoidWait(pVM, VMCPUID_ANY, (PFNRT)dbgfR3OSQueryInterface, 3, pVM, enmIf, &pvIf); 445 445 return pvIf; 446 446 } -
trunk/src/VBox/VMM/VMMR3/DBGFReg.cpp
r36826 r38838 864 864 AssertReturn(idCpu < pVM->cCpus, VERR_INVALID_CPU_ID); 865 865 866 return VMR3Req CallWait(pVM, idCpu, (PFNRT)dbgfR3RegCpuQueryWorkerOnCpu, 6,867 pVM, idCpu, enmReg, enmType, fGuestRegs, pValue);866 return VMR3ReqPriorityCallWait(pVM, idCpu, (PFNRT)dbgfR3RegCpuQueryWorkerOnCpu, 6, 867 pVM, idCpu, enmReg, enmType, fGuestRegs, pValue); 868 868 } 869 869 … … 1409 1409 else if (idDefCpu != VMCPUID_ANY) 1410 1410 idDefCpu &= ~DBGFREG_HYPER_VMCPUID; 1411 return VMR3Req CallWait(pVM, idDefCpu, (PFNRT)dbgfR3RegNmQueryWorkerOnCpu, 5, pVM, pLookupRec, enmType, pValue, penmType);1411 return VMR3ReqPriorityCallWait(pVM, idDefCpu, (PFNRT)dbgfR3RegNmQueryWorkerOnCpu, 5, pVM, pLookupRec, enmType, pValue, penmType); 1412 1412 } 1413 1413 return VERR_DBGF_REGISTER_NOT_FOUND; … … 2280 2280 Args.cchLeftBuf = cbBuf - 1; 2281 2281 Args.rc = VINF_SUCCESS; 2282 int rc = VMR3Req CallWait(pVM, Args.idCpu, (PFNRT)dbgfR3RegPrintfWorkerOnCpu, 1, &Args);2282 int rc = VMR3ReqPriorityCallWait(pVM, Args.idCpu, (PFNRT)dbgfR3RegPrintfWorkerOnCpu, 1, &Args); 2283 2283 va_end(Args.va); 2284 2284 return rc; -
trunk/src/VBox/VMM/VMMR3/DBGFStack.cpp
r35346 r38838 454 454 AssertFailedReturn(VERR_INVALID_PARAMETER); 455 455 } 456 return VMR3Req CallWait(pVM, idCpu, (PFNRT)dbgfR3StackWalkCtxFull, 10,457 pVM, idCpu, pCtxCore, hAs, enmCodeType,458 pAddrFrame, pAddrStack, pAddrPC, enmReturnType, ppFirstFrame);456 return VMR3ReqPriorityCallWait(pVM, idCpu, (PFNRT)dbgfR3StackWalkCtxFull, 10, 457 pVM, idCpu, pCtxCore, hAs, enmCodeType, 458 pAddrFrame, pAddrStack, pAddrPC, enmReturnType, ppFirstFrame); 459 459 } 460 460 -
trunk/src/VBox/VMM/VMMR3/EM.cpp
r38612 r38838 1489 1489 if (VM_FF_IS_PENDING_EXCEPT(pVM, VM_FF_REQUEST, VM_FF_PGM_NO_MEMORY)) 1490 1490 { 1491 rc2 = VMR3ReqProcessU(pVM->pUVM, VMCPUID_ANY );1491 rc2 = VMR3ReqProcessU(pVM->pUVM, VMCPUID_ANY, false /*fPriorityOnly*/); 1492 1492 if (rc2 == VINF_EM_OFF || rc2 == VINF_EM_TERMINATE) /** @todo this shouldn't be necessary */ 1493 1493 { … … 1541 1541 if (VMCPU_FF_ISPENDING(pVCpu, VMCPU_FF_REQUEST)) 1542 1542 { 1543 rc2 = VMR3ReqProcessU(pVM->pUVM, pVCpu->idCpu );1543 rc2 = VMR3ReqProcessU(pVM->pUVM, pVCpu->idCpu, false /*fPriorityOnly*/); 1544 1544 if (rc2 == VINF_EM_OFF || rc2 == VINF_EM_TERMINATE || rc2 == VINF_EM_RESET) 1545 1545 { -
trunk/src/VBox/VMM/VMMR3/FTM.cpp
r38614 r38838 1329 1329 if (VM_FF_ISPENDING(pVM, VM_FF_REQUEST)) 1330 1330 { 1331 rc = VMR3ReqProcessU(pVM->pUVM, VMCPUID_ANY );1331 rc = VMR3ReqProcessU(pVM->pUVM, VMCPUID_ANY, true /*fPriorityOnly*/); 1332 1332 AssertRC(rc); 1333 1333 } -
trunk/src/VBox/VMM/VMMR3/HWACCM.cpp
r37323 r38838 1748 1748 VMMR3DECL(int) HWACMMR3EnablePatching(PVM pVM, RTGCPTR pPatchMem, unsigned cbPatchMem) 1749 1749 { 1750 VM_ASSERT_EMT(pVM); 1750 1751 Log(("HWACMMR3EnablePatching %RGv size %x\n", pPatchMem, cbPatchMem)); 1751 1752 if (pVM->cCpus > 1) 1752 1753 { 1753 1754 /* We own the IOM lock here and could cause a deadlock by waiting for a VCPU that is blocking on the IOM lock. */ 1754 int rc = VMR3ReqCallNoWait U(pVM->pUVM, VMCPUID_ANY_QUEUE,1755 1755 int rc = VMR3ReqCallNoWait(pVM, VMCPUID_ANY_QUEUE, 1756 (PFNRT)hwaccmR3EnablePatching, 4, pVM, VMMGetCpuId(pVM), (RTRCPTR)pPatchMem, cbPatchMem); 1756 1757 AssertRC(rc); 1757 1758 return rc; -
trunk/src/VBox/VMM/VMMR3/PDM.cpp
r38749 r38838 1236 1236 static void pdmR3NotifyAsyncWaitAndProcessRequests(PPDMNOTIFYASYNCSTATS pThis, PVM pVM) 1237 1237 { 1238 /** @todo This is utterly nuts and completely unsafe... will get back to it in a1239 * bit I hope... */1240 1238 VM_ASSERT_EMT0(pVM); 1241 1239 int rc = VMR3AsyncPdmNotificationWaitU(&pVM->pUVM->aCpus[0]); 1242 1240 AssertReleaseMsg(rc == VINF_SUCCESS, ("%Rrc - %s - %s\n", rc, pThis->pszOp, pThis->szList)); 1243 1241 1244 rc = VMR3ReqProcessU(pVM->pUVM, VMCPUID_ANY );1242 rc = VMR3ReqProcessU(pVM->pUVM, VMCPUID_ANY, true /*fPriorityOnly*/); 1245 1243 AssertReleaseMsg(rc == VINF_SUCCESS, ("%Rrc - %s - %s\n", rc, pThis->pszOp, pThis->szList)); 1246 rc = VMR3ReqProcessU(pVM->pUVM, 0/*idDstCpu*/ );1244 rc = VMR3ReqProcessU(pVM->pUVM, 0/*idDstCpu*/, true /*fPriorityOnly*/); 1247 1245 AssertReleaseMsg(rc == VINF_SUCCESS, ("%Rrc - %s - %s\n", rc, pThis->pszOp, pThis->szList)); 1248 1246 } -
trunk/src/VBox/VMM/VMMR3/PDMDevHlp.cpp
r37466 r38838 3104 3104 { 3105 3105 /* We own the IOM lock here and could cause a deadlock by waiting for a VCPU that is blocking on the IOM lock. */ 3106 rc = VMR3ReqCallNoWait U(pVM->pUVM, VMCPUID_ANY_QUEUE, (PFNRT)VMR3Suspend, 1, pVM);3106 rc = VMR3ReqCallNoWait(pVM, VMCPUID_ANY_QUEUE, (PFNRT)VMR3Suspend, 1, pVM); 3107 3107 AssertRC(rc); 3108 3108 rc = VINF_EM_SUSPEND; … … 3166 3166 && pVM->pUVM->pVmm2UserMethods->pfnSaveState) 3167 3167 { 3168 rc = VMR3ReqCallNoWait U(pVM->pUVM, VMCPUID_ANY_QUEUE, (PFNRT)pdmR3DevHlp_VMSuspendSaveAndPowerOffWorker, 2, pVM, pDevIns);3168 rc = VMR3ReqCallNoWait(pVM, VMCPUID_ANY_QUEUE, (PFNRT)pdmR3DevHlp_VMSuspendSaveAndPowerOffWorker, 2, pVM, pDevIns); 3169 3169 if (RT_SUCCESS(rc)) 3170 3170 { … … 3195 3195 { 3196 3196 /* We own the IOM lock here and could cause a deadlock by waiting for a VCPU that is blocking on the IOM lock. */ 3197 rc = VMR3ReqCallNoWait U(pVM->pUVM, VMCPUID_ANY_QUEUE, (PFNRT)VMR3PowerOff, 1, pVM);3197 rc = VMR3ReqCallNoWait(pVM, VMCPUID_ANY_QUEUE, (PFNRT)VMR3PowerOff, 1, pVM); 3198 3198 AssertRC(rc); 3199 3199 /* Set the VCPU state to stopped here as well to make sure no -
trunk/src/VBox/VMM/VMMR3/PGMPhys.cpp
r38708 r38838 142 142 pgmUnlock(pVM); 143 143 144 return VMR3Req CallWait(pVM, VMCPUID_ANY, (PFNRT)pgmR3PhysReadExternalEMT, 4,145 pVM, &GCPhys, pvBuf, cbRead);144 return VMR3ReqPriorityCallWait(pVM, VMCPUID_ANY, (PFNRT)pgmR3PhysReadExternalEMT, 4, 145 pVM, &GCPhys, pvBuf, cbRead); 146 146 } 147 147 Assert(!PGM_PAGE_IS_MMIO(pPage)); … … 281 281 pgmUnlock(pVM); 282 282 283 return VMR3Req CallWait(pVM, VMCPUID_ANY, (PFNRT)pgmR3PhysWriteExternalEMT, 4,284 pVM, &GCPhys, pvBuf, cbWrite);283 return VMR3ReqPriorityCallWait(pVM, VMCPUID_ANY, (PFNRT)pgmR3PhysWriteExternalEMT, 4, 284 pVM, &GCPhys, pvBuf, cbWrite); 285 285 } 286 286 } … … 463 463 pgmUnlock(pVM); 464 464 465 return VMR3Req CallWait(pVM, VMCPUID_ANY, (PFNRT)pgmR3PhysGCPhys2CCPtrDelegated, 4,466 pVM, &GCPhys, ppv, pLock);465 return VMR3ReqPriorityCallWait(pVM, VMCPUID_ANY, (PFNRT)pgmR3PhysGCPhys2CCPtrDelegated, 4, 466 pVM, &GCPhys, ppv, pLock); 467 467 } 468 468 } … … 4000 4000 { 4001 4001 /* Postpone the unmap operation (which requires a rendezvous operation) as we own the PGM lock here. */ 4002 rc = VMR3ReqCallNoWait U(pVM->pUVM, VMCPUID_ANY_QUEUE, (PFNRT)pgmR3PhysUnmapChunk, 1, pVM);4002 rc = VMR3ReqCallNoWait(pVM, VMCPUID_ANY_QUEUE, (PFNRT)pgmR3PhysUnmapChunk, 1, pVM); 4003 4003 AssertRC(rc); 4004 4004 } -
trunk/src/VBox/VMM/VMMR3/TM.cpp
r37527 r38838 2696 2696 VMMDECL(int) TMR3SetWarpDrive(PVM pVM, uint32_t u32Percent) 2697 2697 { 2698 return VMR3Req CallWait(pVM, VMCPUID_ANY, (PFNRT)tmR3SetWarpDrive, 2, pVM, u32Percent);2698 return VMR3ReqPriorityCallWait(pVM, VMCPUID_ANY, (PFNRT)tmR3SetWarpDrive, 2, pVM, u32Percent); 2699 2699 } 2700 2700 -
trunk/src/VBox/VMM/VMMR3/VM.cpp
r38229 r38838 848 848 for (VMCPUID idCpu = 1; idCpu < pVM->cCpus; idCpu++) 849 849 { 850 rc = VMR3ReqCallWait U(pUVM, idCpu, (PFNRT)vmR3RegisterEMT, 2, pVM, idCpu);850 rc = VMR3ReqCallWait(pVM, idCpu, (PFNRT)vmR3RegisterEMT, 2, pVM, idCpu); 851 851 if (RT_FAILURE(rc)) 852 852 return rc; … … 1733 1733 */ 1734 1734 PSSMHANDLE pSSM; 1735 int rc = VMR3ReqCallWait U(pVM->pUVM, 0 /*idDstCpu*/,1736 1737 1735 int rc = VMR3ReqCallWait(pVM, 0 /*idDstCpu*/, 1736 (PFNRT)vmR3Save, 10, pVM, cMsMaxDowntime, pszFilename, pStreamOps, pvStreamOpsUser, 1737 enmAfter, pfnProgress, pvProgressUser, &pSSM, fSkipStateChanges); 1738 1738 if ( RT_SUCCESS(rc) 1739 1739 && pSSM) … … 1763 1763 } 1764 1764 if (RT_SUCCESS(rc)) 1765 rc = VMR3ReqCallWait U(pVM->pUVM, 0 /*idDstCpu*/, (PFNRT)vmR3LiveDoStep2, 2, pVM, pSSM);1765 rc = VMR3ReqCallWait(pVM, 0 /*idDstCpu*/, (PFNRT)vmR3LiveDoStep2, 2, pVM, pSSM); 1766 1766 else 1767 1767 { 1768 int rc2 = VMR3ReqCallWait U(pVM->pUVM, 0 /*idDstCpu*/, (PFNRT)SSMR3LiveDone, 1, pSSM);1768 int rc2 = VMR3ReqCallWait(pVM, 0 /*idDstCpu*/, (PFNRT)SSMR3LiveDone, 1, pSSM); 1769 1769 AssertMsg(rc2 == rc, ("%Rrc != %Rrc\n", rc2, rc)); 1770 1770 } … … 1772 1772 else 1773 1773 { 1774 int rc2 = VMR3ReqCallWait U(pVM->pUVM, 0 /*idDstCpu*/, (PFNRT)SSMR3LiveDone, 1, pSSM);1774 int rc2 = VMR3ReqCallWait(pVM, 0 /*idDstCpu*/, (PFNRT)SSMR3LiveDone, 1, pSSM); 1775 1775 AssertMsg(rc2 == rc, ("%Rrc != %Rrc\n", rc2, rc)); 1776 1776 … … 2045 2045 * since there is no execution taking place when this call is allowed. 2046 2046 */ 2047 int rc = VMR3ReqCallWait U(pVM->pUVM, 0 /*idDstCpu*/, (PFNRT)vmR3Load, 8,2048 2049 2047 int rc = VMR3ReqCallWait(pVM, 0 /*idDstCpu*/, (PFNRT)vmR3Load, 8, 2048 pVM, pszFilename, (uintptr_t)NULL /*pStreamOps*/, (uintptr_t)NULL /*pvStreamOpsUser*/, pfnProgress, pvUser, 2049 false /*fTeleporting*/, false /* fSkipStateChanges */); 2050 2050 LogFlow(("VMR3LoadFromFile: returns %Rrc\n", rc)); 2051 2051 return rc; … … 2084 2084 * since there is no execution taking place when this call is allowed. 2085 2085 */ 2086 int rc = VMR3ReqCallWait U(pVM->pUVM, 0 /*idDstCpu*/, (PFNRT)vmR3Load, 8,2087 2088 2086 int rc = VMR3ReqCallWait(pVM, 0 /*idDstCpu*/, (PFNRT)vmR3Load, 8, 2087 pVM, (uintptr_t)NULL /*pszFilename*/, pStreamOps, pvStreamOpsUser, pfnProgress, pvProgressUser, 2088 true /*fTeleporting*/, false /* fSkipStateChanges */); 2089 2089 LogFlow(("VMR3LoadFromStream: returns %Rrc\n", rc)); 2090 2090 return rc; … … 2122 2122 * since there is no execution taking place when this call is allowed. 2123 2123 */ 2124 int rc = VMR3ReqCallWait U(pVM->pUVM, 0 /*idDstCpu*/, (PFNRT)vmR3Load, 8,2125 2126 2124 int rc = VMR3ReqCallWait(pVM, 0 /*idDstCpu*/, (PFNRT)vmR3Load, 8, 2125 pVM, (uintptr_t)NULL /*pszFilename*/, pStreamOps, pvStreamOpsUser, NULL, NULL, 2126 true /*fTeleporting*/, true /* fSkipStateChanges */); 2127 2127 LogFlow(("VMR3LoadFromStream: returns %Rrc\n", rc)); 2128 2128 return rc; … … 2349 2349 */ 2350 2350 /* vmR3Destroy on all EMTs, ending with EMT(0). */ 2351 rc = VMR3ReqCallWait U(pUVM, VMCPUID_ALL_REVERSE, (PFNRT)vmR3Destroy, 1, pVM);2351 rc = VMR3ReqCallWait(pVM, VMCPUID_ALL_REVERSE, (PFNRT)vmR3Destroy, 1, pVM); 2352 2352 AssertLogRelRC(rc); 2353 2353 … … 2535 2535 for (unsigned i = 0; i < 10; i++) 2536 2536 { 2537 PVMREQ pReqHead = ASMAtomicXchgPtrT(&pUVM->vm.s.pReqs, NULL, PVMREQ); 2538 AssertMsg(!pReqHead, ("This isn't supposed to happen! VMR3Destroy caller has to serialize this.\n")); 2537 PVMREQ pReqHead = ASMAtomicXchgPtrT(&pUVM->vm.s.pPriorityReqs, NULL, PVMREQ); 2539 2538 if (!pReqHead) 2540 break; 2539 { 2540 pReqHead = ASMAtomicXchgPtrT(&pUVM->vm.s.pNormalReqs, NULL, PVMREQ); 2541 if (!pReqHead) 2542 break; 2543 } 2544 AssertLogRelMsgFailed(("Requests pending! VMR3Destroy caller has to serialize this.\n")); 2545 2541 2546 for (PVMREQ pReq = pReqHead; pReq; pReq = pReq->pNext) 2542 2547 { … … 2560 2565 for (unsigned i = 0; i < 10; i++) 2561 2566 { 2562 PVMREQ pReqHead = ASMAtomicXchgPtrT(&pUVCpu->vm.s.pReqs, NULL, PVMREQ); 2563 AssertMsg(!pReqHead, ("This isn't supposed to happen! VMR3Destroy caller has to serialize this.\n")); 2567 PVMREQ pReqHead = ASMAtomicXchgPtrT(&pUVCpu->vm.s.pPriorityReqs, NULL, PVMREQ); 2564 2568 if (!pReqHead) 2565 break; 2569 { 2570 pReqHead = ASMAtomicXchgPtrT(&pUVCpu->vm.s.pNormalReqs, NULL, PVMREQ); 2571 if (!pReqHead) 2572 break; 2573 } 2574 AssertLogRelMsgFailed(("Requests pending! VMR3Destroy caller has to serialize this.\n")); 2575 2566 2576 for (PVMREQ pReq = pReqHead; pReq; pReq = pReq->pNext) 2567 2577 { … … 4431 4441 * offline and send it to SPIP wait. Maybe modify VMCPUSTATE and push 4432 4442 * it out of the EM loops when offline. */ 4433 return VMR3ReqCallNoWait U(pVM->pUVM, idCpu, (PFNRT)vmR3HotUnplugCpu, 2, pVM, idCpu);4443 return VMR3ReqCallNoWait(pVM, idCpu, (PFNRT)vmR3HotUnplugCpu, 2, pVM, idCpu); 4434 4444 } 4435 4445 -
trunk/src/VBox/VMM/VMMR3/VMEmt.cpp
r36437 r38838 113 113 * See also VMR3Create 114 114 */ 115 if ( pUVM->vm.s.pReqs115 if ( (pUVM->vm.s.pNormalReqs || pUVM->vm.s.pPriorityReqs) 116 116 && pUVCpu->idCpu == 0) 117 117 { … … 119 119 * Service execute in any EMT request. 120 120 */ 121 rc = VMR3ReqProcessU(pUVM, VMCPUID_ANY );121 rc = VMR3ReqProcessU(pUVM, VMCPUID_ANY, false /*fPriorityOnly*/); 122 122 Log(("vmR3EmulationThread: Req rc=%Rrc, VM state %s -> %s\n", rc, VMR3GetStateName(enmBefore), pUVM->pVM ? VMR3GetStateName(pUVM->pVM->enmVMState) : "CREATING")); 123 123 } 124 else if (pUVCpu->vm.s.p Reqs)124 else if (pUVCpu->vm.s.pNormalReqs || pUVCpu->vm.s.pPriorityReqs) 125 125 { 126 126 /* 127 127 * Service execute in specific EMT request. 128 128 */ 129 rc = VMR3ReqProcessU(pUVM, pUVCpu->idCpu );129 rc = VMR3ReqProcessU(pUVM, pUVCpu->idCpu, false /*fPriorityOnly*/); 130 130 Log(("vmR3EmulationThread: Req (cpu=%u) rc=%Rrc, VM state %s -> %s\n", pUVCpu->idCpu, rc, VMR3GetStateName(enmBefore), pUVM->pVM ? VMR3GetStateName(pUVM->pVM->enmVMState) : "CREATING")); 131 131 } … … 164 164 Log(("vmR3EmulationThread: Rendezvous rc=%Rrc, VM state %s -> %s\n", rc, VMR3GetStateName(enmBefore), VMR3GetStateName(pVM->enmVMState))); 165 165 } 166 else if (pUVM->vm.s.p Reqs)166 else if (pUVM->vm.s.pNormalReqs || pUVM->vm.s.pPriorityReqs) 167 167 { 168 168 /* 169 169 * Service execute in any EMT request. 170 170 */ 171 rc = VMR3ReqProcessU(pUVM, VMCPUID_ANY );171 rc = VMR3ReqProcessU(pUVM, VMCPUID_ANY, false /*fPriorityOnly*/); 172 172 Log(("vmR3EmulationThread: Req rc=%Rrc, VM state %s -> %s\n", rc, VMR3GetStateName(enmBefore), VMR3GetStateName(pVM->enmVMState))); 173 173 } 174 else if (pUVCpu->vm.s.p Reqs)174 else if (pUVCpu->vm.s.pNormalReqs || pUVCpu->vm.s.pPriorityReqs) 175 175 { 176 176 /* 177 177 * Service execute in specific EMT request. 178 178 */ 179 rc = VMR3ReqProcessU(pUVM, pUVCpu->idCpu );179 rc = VMR3ReqProcessU(pUVM, pUVCpu->idCpu, false /*fPriorityOnly*/); 180 180 Log(("vmR3EmulationThread: Req (cpu=%u) rc=%Rrc, VM state %s -> %s\n", pUVCpu->idCpu, rc, VMR3GetStateName(enmBefore), VMR3GetStateName(pVM->enmVMState))); 181 181 } … … 847 847 * Check Relevant FFs. 848 848 */ 849 if (pUVM->vm.s.p Reqs) /* global requests pending? */850 break; 851 if (pUVCpu->vm.s.p Reqs) /* local requests pending? */849 if (pUVM->vm.s.pNormalReqs || pUVM->vm.s.pPriorityReqs) /* global requests pending? */ 850 break; 851 if (pUVCpu->vm.s.pNormalReqs || pUVCpu->vm.s.pPriorityReqs) /* local requests pending? */ 852 852 break; 853 853 -
trunk/src/VBox/VMM/VMMR3/VMReq.cpp
r38613 r38838 122 122 * Convenience wrapper for VMR3ReqCallU. 123 123 * 124 * This assumes (1) you're calling a function that returns an VBox status code,125 * (2) that you want it's return code on success, and (3) that you wish to wait126 * for ever for it to return.127 *128 * @returns VBox status code. In the unlikely event that VMR3ReqCallVU fails,129 * its status code is return. Otherwise, the status of pfnFunction is130 * returned.131 *132 * @param pUVM Pointer to the user mode VM structure.133 * @param idDstCpu The destination CPU(s). Either a specific CPU ID or134 * one of the following special values:135 * VMCPUID_ANY, VMCPUID_ANY_QUEUE, VMCPUID_ALL or VMCPUID_ALL_REVERSE.136 * @param pfnFunction Pointer to the function to call.137 * @param cArgs Number of arguments following in the ellipsis.138 * @param ... Function arguments.139 *140 * @remarks See remarks on VMR3ReqCallVU.141 */142 VMMR3DECL(int) VMR3ReqCallWaitU(PUVM pUVM, VMCPUID idDstCpu, PFNRT pfnFunction, unsigned cArgs, ...)143 {144 PVMREQ pReq;145 va_list va;146 va_start(va, cArgs);147 int rc = VMR3ReqCallVU(pUVM, idDstCpu, &pReq, RT_INDEFINITE_WAIT, VMREQFLAGS_VBOX_STATUS,148 pfnFunction, cArgs, va);149 va_end(va);150 if (RT_SUCCESS(rc))151 rc = pReq->iStatus;152 VMR3ReqFree(pReq);153 return rc;154 }155 156 157 /**158 * Convenience wrapper for VMR3ReqCallU.159 *160 124 * This assumes (1) you're calling a function that returns an VBox status code 161 125 * and that you do not wish to wait for it to complete. … … 178 142 va_start(va, cArgs); 179 143 int rc = VMR3ReqCallVU(pVM->pUVM, idDstCpu, NULL, 0, VMREQFLAGS_VBOX_STATUS | VMREQFLAGS_NO_WAIT, 180 pfnFunction, cArgs, va);181 va_end(va);182 return rc;183 }184 185 186 /**187 * Convenience wrapper for VMR3ReqCallU.188 *189 * This assumes (1) you're calling a function that returns an VBox status code190 * and that you do not wish to wait for it to complete.191 *192 * @returns VBox status code returned by VMR3ReqCallVU.193 *194 * @param pUVM Pointer to the user mode VM structure.195 * @param idDstCpu The destination CPU(s). Either a specific CPU ID or196 * one of the following special values:197 * VMCPUID_ANY, VMCPUID_ANY_QUEUE, VMCPUID_ALL or VMCPUID_ALL_REVERSE.198 * @param pfnFunction Pointer to the function to call.199 * @param cArgs Number of arguments following in the ellipsis.200 * @param ... Function arguments.201 *202 * @remarks See remarks on VMR3ReqCallVU.203 */204 VMMR3DECL(int) VMR3ReqCallNoWaitU(PUVM pUVM, VMCPUID idDstCpu, PFNRT pfnFunction, unsigned cArgs, ...)205 {206 va_list va;207 va_start(va, cArgs);208 int rc = VMR3ReqCallVU(pUVM, idDstCpu, NULL, 0, VMREQFLAGS_VBOX_STATUS | VMREQFLAGS_NO_WAIT,209 144 pfnFunction, cArgs, va); 210 145 va_end(va); … … 248 183 * 249 184 * This assumes (1) you're calling a function that returns void, and (2) that 250 * you wish to wait for ever for it to return.251 *252 * @returns VBox status code of VMR3ReqCallVU.253 *254 * @param pUVM Pointer to the user mode VM structure.255 * @param idDstCpu The destination CPU(s). Either a specific CPU ID or256 * one of the following special values:257 * VMCPUID_ANY, VMCPUID_ANY_QUEUE, VMCPUID_ALL or VMCPUID_ALL_REVERSE.258 * @param pfnFunction Pointer to the function to call.259 * @param cArgs Number of arguments following in the ellipsis.260 * @param ... Function arguments.261 *262 * @remarks See remarks on VMR3ReqCallVU.263 */264 VMMR3DECL(int) VMR3ReqCallVoidWaitU(PUVM pUVM, VMCPUID idDstCpu, PFNRT pfnFunction, unsigned cArgs, ...)265 {266 PVMREQ pReq;267 va_list va;268 va_start(va, cArgs);269 int rc = VMR3ReqCallVU(pUVM, idDstCpu, &pReq, RT_INDEFINITE_WAIT, VMREQFLAGS_VOID,270 pfnFunction, cArgs, va);271 va_end(va);272 VMR3ReqFree(pReq);273 return rc;274 }275 276 277 /**278 * Convenience wrapper for VMR3ReqCallU.279 *280 * This assumes (1) you're calling a function that returns void, and (2) that281 185 * you do not wish to wait for it to complete. 282 186 * … … 309 213 * Convenience wrapper for VMR3ReqCallU. 310 214 * 311 * This assumes (1) you're calling a function that returns void, and (2) that 312 * you do not wish to wait for it to complete. 313 * 314 * @returns VBox status code of VMR3ReqCallVU. 315 * 316 * @param pUVM Pointer to the user mode VM structure. 215 * This assumes (1) you're calling a function that returns an VBox status code, 216 * (2) that you want it's return code on success, (3) that you wish to wait for 217 * ever for it to return, and (4) that it's priority request that can be safely 218 * be handled during async suspend and power off. 219 * 220 * @returns VBox status code. In the unlikely event that VMR3ReqCallVU fails, 221 * its status code is return. Otherwise, the status of pfnFunction is 222 * returned. 223 * 224 * @param pVM Pointer to the shared VM structure. 317 225 * @param idDstCpu The destination CPU(s). Either a specific CPU ID or 318 226 * one of the following special values: … … 324 232 * @remarks See remarks on VMR3ReqCallVU. 325 233 */ 326 VMMR3DECL(int) VMR3Req CallVoidNoWaitU(PUVM pUVM, VMCPUID idDstCpu, PFNRT pfnFunction, unsigned cArgs, ...)234 VMMR3DECL(int) VMR3ReqPriorityCallWait(PVM pVM, VMCPUID idDstCpu, PFNRT pfnFunction, unsigned cArgs, ...) 327 235 { 328 236 PVMREQ pReq; 329 237 va_list va; 330 238 va_start(va, cArgs); 331 int rc = VMR3ReqCallVU(pUVM, idDstCpu, &pReq, RT_INDEFINITE_WAIT, VMREQFLAGS_VOID | VMREQFLAGS_NO_WAIT, 239 int rc = VMR3ReqCallVU(pVM->pUVM, idDstCpu, &pReq, RT_INDEFINITE_WAIT, VMREQFLAGS_VBOX_STATUS | VMREQFLAGS_PRIORITY, 240 pfnFunction, cArgs, va); 241 va_end(va); 242 if (RT_SUCCESS(rc)) 243 rc = pReq->iStatus; 244 VMR3ReqFree(pReq); 245 return rc; 246 } 247 248 249 /** 250 * Convenience wrapper for VMR3ReqCallU. 251 * 252 * This assumes (1) you're calling a function that returns void, (2) that you 253 * wish to wait for ever for it to return, and (3) that it's priority request 254 * that can be safely be handled during async suspend and power off. 255 * 256 * @returns VBox status code of VMR3ReqCallVU. 257 * 258 * @param pVM Pointer to the shared VM structure. 259 * @param idDstCpu The destination CPU(s). Either a specific CPU ID or 260 * one of the following special values: 261 * VMCPUID_ANY, VMCPUID_ANY_QUEUE, VMCPUID_ALL or VMCPUID_ALL_REVERSE. 262 * @param pfnFunction Pointer to the function to call. 263 * @param cArgs Number of arguments following in the ellipsis. 264 * @param ... Function arguments. 265 * 266 * @remarks See remarks on VMR3ReqCallVU. 267 */ 268 VMMR3DECL(int) VMR3ReqPriorityCallVoidWait(PVM pVM, VMCPUID idDstCpu, PFNRT pfnFunction, unsigned cArgs, ...) 269 { 270 PVMREQ pReq; 271 va_list va; 272 va_start(va, cArgs); 273 int rc = VMR3ReqCallVU(pVM->pUVM, idDstCpu, &pReq, RT_INDEFINITE_WAIT, VMREQFLAGS_VOID | VMREQFLAGS_PRIORITY, 332 274 pfnFunction, cArgs, va); 333 275 va_end(va); … … 424 366 AssertPtrReturn(pfnFunction, VERR_INVALID_POINTER); 425 367 AssertPtrReturn(pUVM, VERR_INVALID_POINTER); 426 AssertReturn(!(fFlags & ~(VMREQFLAGS_RETURN_MASK | VMREQFLAGS_NO_WAIT | VMREQFLAGS_POKE )), VERR_INVALID_PARAMETER);368 AssertReturn(!(fFlags & ~(VMREQFLAGS_RETURN_MASK | VMREQFLAGS_NO_WAIT | VMREQFLAGS_POKE | VMREQFLAGS_PRIORITY)), VERR_INVALID_PARAMETER); 427 369 if (!(fFlags & VMREQFLAGS_NO_WAIT) || ppReq) 428 370 { … … 800 742 pReq->enmType, VMREQTYPE_INVALID + 1, VMREQTYPE_MAX - 1), 801 743 VERR_VM_REQUEST_INVALID_TYPE); 802 Assert(!(pReq->fFlags & ~(VMREQFLAGS_RETURN_MASK | VMREQFLAGS_NO_WAIT | VMREQFLAGS_POKE )));744 Assert(!(pReq->fFlags & ~(VMREQFLAGS_RETURN_MASK | VMREQFLAGS_NO_WAIT | VMREQFLAGS_POKE | VMREQFLAGS_PRIORITY))); 803 745 804 746 /* … … 853 795 * Insert it. 854 796 */ 797 volatile PVMREQ *ppQueueHead = pReq->fFlags & VMREQFLAGS_PRIORITY ? &pUVCpu->vm.s.pPriorityReqs : &pUVCpu->vm.s.pNormalReqs; 855 798 pReq->enmState = VMREQSTATE_QUEUED; 856 799 PVMREQ pNext; 857 800 do 858 801 { 859 pNext = ASMAtomicUoReadPtrT( &pUVCpu->vm.s.pReqs, PVMREQ);802 pNext = ASMAtomicUoReadPtrT(ppQueueHead, PVMREQ); 860 803 ASMAtomicWritePtr(&pReq->pNext, pNext); 861 804 ASMCompilerBarrier(); 862 } while (!ASMAtomicCmpXchgPtr( &pUVCpu->vm.s.pReqs, pReq, pNext));805 } while (!ASMAtomicCmpXchgPtr(ppQueueHead, pReq, pNext)); 863 806 864 807 /* … … 887 830 * Insert it. 888 831 */ 832 volatile PVMREQ *ppQueueHead = pReq->fFlags & VMREQFLAGS_PRIORITY ? &pUVM->vm.s.pPriorityReqs : &pUVM->vm.s.pNormalReqs; 889 833 pReq->enmState = VMREQSTATE_QUEUED; 890 834 PVMREQ pNext; 891 835 do 892 836 { 893 pNext = ASMAtomicUoReadPtrT( &pUVM->vm.s.pReqs, PVMREQ);837 pNext = ASMAtomicUoReadPtrT(ppQueueHead, PVMREQ); 894 838 ASMAtomicWritePtr(&pReq->pNext, pNext); 895 839 ASMCompilerBarrier(); 896 } while (!ASMAtomicCmpXchgPtr( &pUVM->vm.s.pReqs, pReq, pNext));840 } while (!ASMAtomicCmpXchgPtr(ppQueueHead, pReq, pNext)); 897 841 898 842 /* … … 989 933 990 934 /** 935 * Sets the relevant FF. 936 * 937 * @param pUVM Pointer to the user mode VM structure. 938 * @param idDstCpu VMCPUID_ANY or the ID of the current CPU. 939 */ 940 DECLINLINE(void) vmR3ReqSetFF(PUVM pUVM, VMCPUID idDstCpu) 941 { 942 if (RT_LIKELY(pUVM->pVM)) 943 { 944 if (idDstCpu == VMCPUID_ANY) 945 VM_FF_SET(pUVM->pVM, VM_FF_REQUEST); 946 else 947 VMCPU_FF_SET(&pUVM->pVM->aCpus[idDstCpu], VMCPU_FF_REQUEST); 948 } 949 } 950 951 952 /** 991 953 * VMR3ReqProcessU helper that handles cases where there are more than one 992 954 * pending request. … … 1001 963 { 1002 964 STAM_COUNTER_INC(&pUVM->vm.s.StatReqMoreThan1); 1003 /* Chop off the last one (pReq). */ 965 966 /* 967 * Chop off the last one (pReq). 968 */ 1004 969 PVMREQ pPrev; 1005 970 PVMREQ pReqRet = pReqList; … … 1011 976 ASMAtomicWriteNullPtr(&pPrev->pNext); 1012 977 1013 /* Push the others back onto the list (end of it). */ 978 /* 979 * Push the others back onto the list (end of it). 980 */ 1014 981 Log2(("VMR3ReqProcess: Pushing back %p %p...\n", pReqList, pReqList->pNext)); 1015 982 if (RT_UNLIKELY(!ASMAtomicCmpXchgPtr(ppReqs, pReqList, NULL))) … … 1031 998 } 1032 999 1033 if (RT_LIKELY(pUVM->pVM)) 1034 { 1035 if (idDstCpu == VMCPUID_ANY) 1036 VM_FF_SET(pUVM->pVM, VM_FF_REQUEST); 1037 else 1038 VMCPU_FF_SET(&pUVM->pVM->aCpus[idDstCpu], VMCPU_FF_REQUEST); 1039 } 1040 1000 vmR3ReqSetFF(pUVM, idDstCpu); 1041 1001 return pReqRet; 1042 1002 } … … 1055 1015 * and the CPU ID for a CPU specific one. In the latter 1056 1016 * case the calling thread must be the EMT of that CPU. 1017 * @param fPriorityOnly When set, only process the priority request queue. 1057 1018 * 1058 1019 * @note SMP safe (multiple EMTs trying to satisfy VM_FF_REQUESTs). 1059 1020 * 1060 * @remarks This was made reentrant for 1061 */ 1062 VMMR3DECL(int) VMR3ReqProcessU(PUVM pUVM, VMCPUID idDstCpu) 1021 * @remarks This was made reentrant for async PDM handling, the debugger and 1022 * others. 1023 */ 1024 VMMR3DECL(int) VMR3ReqProcessU(PUVM pUVM, VMCPUID idDstCpu, bool fPriorityOnly) 1063 1025 { 1064 1026 LogFlow(("VMR3ReqProcessU: (enmVMState=%d) idDstCpu=%d\n", pUVM->pVM ? pUVM->pVM->enmVMState : VMSTATE_CREATING, idDstCpu)); 1027 1028 /* 1029 * Determine which queues to process. 1030 */ 1031 PVMREQ volatile *ppNormalReqs; 1032 PVMREQ volatile *ppPriorityReqs; 1033 if (idDstCpu == VMCPUID_ANY) 1034 { 1035 ppPriorityReqs = &pUVM->vm.s.pPriorityReqs; 1036 ppNormalReqs = !fPriorityOnly ? &pUVM->vm.s.pNormalReqs : ppPriorityReqs; 1037 } 1038 else 1039 { 1040 Assert(idDstCpu < pUVM->cCpus); 1041 Assert(pUVM->aCpus[idDstCpu].vm.s.NativeThreadEMT == RTThreadNativeSelf()); 1042 ppPriorityReqs = &pUVM->aCpus[idDstCpu].vm.s.pPriorityReqs; 1043 ppNormalReqs = !fPriorityOnly ? &pUVM->aCpus[idDstCpu].vm.s.pNormalReqs : ppPriorityReqs; 1044 } 1065 1045 1066 1046 /* … … 1074 1054 { 1075 1055 /* 1076 * Get the pending requests. 1056 * Get the pending requests. 1057 * 1077 1058 * If there are more than one request, unlink the oldest and put the 1078 1059 * rest back so that we're reentrant. 1079 1060 */ 1080 PVMREQ volatile *ppReqs; 1081 if (idDstCpu == VMCPUID_ANY) 1082 { 1083 ppReqs = &pUVM->vm.s.pReqs; 1084 if (RT_LIKELY(pUVM->pVM)) 1061 if (RT_LIKELY(pUVM->pVM)) 1062 { 1063 if (idDstCpu == VMCPUID_ANY) 1085 1064 VM_FF_CLEAR(pUVM->pVM, VM_FF_REQUEST); 1065 else 1066 VMCPU_FF_CLEAR(&pUVM->pVM->aCpus[idDstCpu], VMCPU_FF_REQUEST); 1067 } 1068 1069 PVMREQ pReq = ASMAtomicXchgPtrT(ppPriorityReqs, NULL, PVMREQ); 1070 if (pReq) 1071 { 1072 if (RT_UNLIKELY(pReq->pNext)) 1073 pReq = vmR3ReqProcessUTooManyHelper(pUVM, idDstCpu, pReq, ppPriorityReqs); 1074 else if (ASMAtomicReadPtrT(ppNormalReqs, PVMREQ)) 1075 vmR3ReqSetFF(pUVM, idDstCpu); 1086 1076 } 1087 1077 else 1088 1078 { 1089 Assert(idDstCpu < pUVM->cCpus);1090 Assert(pUVM->aCpus[idDstCpu].vm.s.NativeThreadEMT == RTThreadNativeSelf());1091 ppReqs = &pUVM->aCpus[idDstCpu].vm.s.pReqs;1092 if (RT_ LIKELY(pUVM->pVM))1093 VMCPU_FF_CLEAR(&pUVM->pVM->aCpus[idDstCpu], VMCPU_FF_REQUEST);1079 pReq = ASMAtomicXchgPtrT(ppNormalReqs, NULL, PVMREQ); 1080 if (!pReq) 1081 break; 1082 if (RT_UNLIKELY(pReq->pNext)) 1083 pReq = vmR3ReqProcessUTooManyHelper(pUVM, idDstCpu, pReq, ppNormalReqs); 1094 1084 } 1095 1096 PVMREQ pReq = ASMAtomicXchgPtrT(ppReqs, NULL, PVMREQ);1097 if (!pReq)1098 break;1099 if (RT_UNLIKELY(pReq->pNext))1100 pReq = vmR3ReqProcessUTooManyHelper(pUVM, idDstCpu, pReq, ppReqs);1101 1085 1102 1086 /* … … 1129 1113 { 1130 1114 LogFlow(("vmR3ReqProcessOneU: pReq=%p type=%d fFlags=%#x\n", pReq, pReq->enmType, pReq->fFlags)); 1115 1116 #if 1 /*def VBOX_STRICT */ 1117 /* 1118 * Disable rendezvous if servicing a priority request. Priority requests 1119 * can not make use of the EMT rendezvous API. 1120 */ 1121 PVMCPU pVCpu = NULL; 1122 bool fSavedInRendezvous = true; 1123 bool const fPriorityReq = RT_BOOL(pReq->fFlags & VMREQFLAGS_PRIORITY); 1124 if (fPriorityReq && pUVM->pVM) 1125 { 1126 pVCpu = VMMGetCpu(pUVM->pVM); 1127 fSavedInRendezvous = VMMR3EmtRendezvousSetDisabled(pVCpu, true /*fDisabled*/); 1128 } 1129 #endif 1131 1130 1132 1131 /* … … 1265 1264 } 1266 1265 } 1266 1267 #if 1 /*def VBOX_STRICT */ 1268 /* 1269 * Restore the rendezvous disabled state. 1270 */ 1271 if (!fSavedInRendezvous) 1272 VMMR3EmtRendezvousSetDisabled(pVCpu, false /*fDisabled*/); 1273 #endif 1267 1274 return rcRet; 1268 1275 } -
trunk/src/VBox/VMM/include/VMInternal.h
r36041 r38838 174 174 typedef struct VMINTUSERPERVM 175 175 { 176 /** Head of the request queue. Atomic. */ 177 volatile PVMREQ pReqs; 176 /** Head of the standard request queue. Atomic. */ 177 volatile PVMREQ pNormalReqs; 178 /** Head of the priority request queue. Atomic. */ 179 volatile PVMREQ pPriorityReqs; 178 180 /** The last index used during alloc/free. */ 179 181 volatile uint32_t iReqFree; … … 315 317 typedef struct VMINTUSERPERVMCPU 316 318 { 317 /** Head of the request queue. Atomic. */ 318 volatile PVMREQ pReqs; 319 /** Head of the normal request queue. Atomic. */ 320 volatile PVMREQ pNormalReqs; 321 /** Head of the priority request queue. Atomic. */ 322 volatile PVMREQ pPriorityReqs; 319 323 320 324 /** The handle to the EMT thread. */ -
trunk/src/VBox/VMM/testcase/tstVMM.cpp
r38636 r38838 274 274 for (VMCPUID idCpu = 1; idCpu < g_cCpus; idCpu++) 275 275 { 276 rc = VMR3ReqCallNoWait U(pVM->pUVM, idCpu, (PFNRT)tstTMWorker, 2, pVM, hTest);276 rc = VMR3ReqCallNoWait(pVM, idCpu, (PFNRT)tstTMWorker, 2, pVM, hTest); 277 277 if (RT_FAILURE(rc)) 278 278 RTTestFailed(hTest, "VMR3ReqCall failed: rc=%Rrc\n", rc); -
trunk/src/recompiler/VBoxREMWrapper.cpp
r38364 r38838 1291 1291 { "TRPMSetFaultAddress", VMM_FN(TRPMSetFaultAddress), &g_aArgsTRPMSetFaultAddress[0], RT_ELEMENTS(g_aArgsTRPMSetFaultAddress), REMFNDESC_FLAGS_RET_VOID, 0, NULL }, 1292 1292 { "VMMGetCpu", VMM_FN(VMMGetCpu), &g_aArgsVM[0], RT_ELEMENTS(g_aArgsVM), REMFNDESC_FLAGS_RET_INT, sizeof(PVMCPU), NULL }, 1293 { "VMR3ReqCallWait", VMM_FN(VMR3ReqCallWait), &g_aArgsVMR3ReqCallWait[0], RT_ELEMENTS(g_aArgsVMR3ReqCallWait), REMFNDESC_FLAGS_RET_INT, sizeof(int), NULL }, 1294 { "VMR3ReqFree", VMM_FN(VMR3ReqFree), &g_aArgsVMR3ReqFree[0], RT_ELEMENTS(g_aArgsVMR3ReqFree), REMFNDESC_FLAGS_RET_INT | REMFNDESC_FLAGS_ELLIPSIS, sizeof(int), NULL }, 1293 { "VMR3ReqCallWait", VMM_FN(VMR3ReqCallWait), &g_aArgsVMR3ReqCallWait[0], RT_ELEMENTS(g_aArgsVMR3ReqCallWait), REMFNDESC_FLAGS_RET_INT | REMFNDESC_FLAGS_ELLIPSIS, sizeof(int), NULL }, 1294 { "VMR3ReqPriorityCallWait", VMM_FN(VMR3ReqPriorityCallWait), &g_aArgsVMR3ReqCallWait[0], RT_ELEMENTS(g_aArgsVMR3ReqCallWait), REMFNDESC_FLAGS_RET_INT | REMFNDESC_FLAGS_ELLIPSIS, sizeof(int), NULL }, 1295 { "VMR3ReqFree", VMM_FN(VMR3ReqFree), &g_aArgsVMR3ReqFree[0], RT_ELEMENTS(g_aArgsVMR3ReqFree), REMFNDESC_FLAGS_RET_INT, sizeof(int), NULL }, 1295 1296 { "VMR3GetVMCPUId", VMM_FN(VMR3GetVMCPUId), &g_aArgsVM[0], RT_ELEMENTS(g_aArgsVM), REMFNDESC_FLAGS_RET_INT, sizeof(int), NULL }, 1296 1297 { "VMR3GetVMCPUNativeThread", VMM_FN(VMR3GetVMCPUNativeThread), &g_aArgsVM[0], RT_ELEMENTS(g_aArgsVM), REMFNDESC_FLAGS_RET_INT, sizeof(void *), NULL }, 1297 { "EMInterpretInstructionCPU", VMM_FN(EMInterpretInstructionCPU), &g_aArgsEMInterpretInstructionCPU[0], RT_ELEMENTS(g_aArgsEMInterpretInstructionCPU), REMFNDESC_FLAGS_RET_INT, sizeof(int), NULL },1298 { "EMInterpretInstructionCPU", VMM_FN(EMInterpretInstructionCPU), &g_aArgsEMInterpretInstructionCPU[0], RT_ELEMENTS(g_aArgsEMInterpretInstructionCPU), REMFNDESC_FLAGS_RET_INT, sizeof(int), NULL }, 1298 1299 // { "", VMM_FN(), &g_aArgsVM[0], RT_ELEMENTS(g_aArgsVM), REMFNDESC_FLAGS_RET_INT, sizeof(int), NULL }, 1299 1300 }; -
trunk/src/recompiler/VBoxRecompiler.c
r38326 r38838 3922 3922 return remR3DisasEnableStepping(pVM, fEnable); 3923 3923 3924 rc = VMR3Req CallWait(pVM, VMCPUID_ANY, (PFNRT)remR3DisasEnableStepping, 2, pVM, fEnable);3924 rc = VMR3ReqPriorityCallWait(pVM, VMCPUID_ANY, (PFNRT)remR3DisasEnableStepping, 2, pVM, fEnable); 3925 3925 AssertRC(rc); 3926 3926 return rc;
Note:
See TracChangeset
for help on using the changeset viewer.