Changeset 13765 in vbox
- Timestamp:
- Nov 3, 2008 5:20:11 PM (16 years ago)
- svn:sync-xref-src-repo-rev:
- 38741
- Location:
- trunk
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/VBox/vmapi.h
r13755 r13765 424 424 VMMR3DECL(int) VMR3ReqQueue(PVMREQ pReq, unsigned cMillies); 425 425 VMMR3DECL(int) VMR3ReqWait(PVMREQ pReq, unsigned cMillies); 426 VMMR3DECL(int) VMR3ReqProcessU(PUVM pUVM );426 VMMR3DECL(int) VMR3ReqProcessU(PUVM pUVM, VMREQDEST enmDest); 427 427 VMMR3DECL(void) VMR3NotifyFF(PVM pVM, bool fNotifiedREM); 428 428 VMMR3DECL(void) VMR3NotifyFFU(PUVM pUVM, bool fNotifiedREM); -
trunk/src/VBox/VMM/DBGF.cpp
r13755 r13765 611 611 { 612 612 LogFlow(("dbgfR3VMMWait: Processes requests...\n")); 613 rc = VMR3ReqProcessU(pVM->pUVM );613 rc = VMR3ReqProcessU(pVM->pUVM, VMREQDEST_ALL); 614 614 LogFlow(("dbgfR3VMMWait: VMR3ReqProcess -> %Vrc rcRet=%Vrc\n", rc, rcRet)); 615 615 if (rc >= VINF_EM_FIRST && rc <= VINF_EM_LAST) -
trunk/src/VBox/VMM/EM.cpp
r13703 r13765 3116 3116 if (VM_FF_ISSET(pVM, VM_FF_REQUEST)) 3117 3117 { 3118 rc2 = VMR3ReqProcessU(pVM->pUVM );3118 rc2 = VMR3ReqProcessU(pVM->pUVM, VMREQDEST_ALL); 3119 3119 if (rc2 == VINF_EM_OFF || rc2 == VINF_EM_TERMINATE) 3120 3120 { -
trunk/src/VBox/VMM/VMEmt.cpp
r13667 r13765 97 97 * Service execute in EMT request. 98 98 */ 99 rc = VMR3ReqProcessU(pUVM );99 rc = VMR3ReqProcessU(pUVM, VMREQDEST_ALL); 100 100 Log(("vmR3EmulationThread: Req rc=%Vrc, VM state %d -> %d\n", rc, enmBefore, pUVM->pVM ? pUVM->pVM->enmVMState : VMSTATE_CREATING)); 101 101 } … … 132 132 * Service execute in EMT request. 133 133 */ 134 rc = VMR3ReqProcessU(pUVM );134 rc = VMR3ReqProcessU(pUVM, VMREQDEST_ALL); 135 135 Log(("vmR3EmulationThread: Req rc=%Vrc, VM state %d -> %d\n", rc, enmBefore, pVM->enmVMState)); 136 136 } … … 252 252 * Service execute in EMT request. 253 253 */ 254 rc = VMR3ReqProcessU(pUVM );254 rc = VMR3ReqProcessU(pUVM, VMREQDEST_ALL); 255 255 Log(("vmR3EmulationThread: Req rc=%Vrc, VM state %d -> %d\n", rc, enmBefore, pVM->enmVMState)); 256 256 } -
trunk/src/VBox/VMM/VMReq.cpp
r13755 r13765 401 401 VERR_VM_REQUEST_INVALID_TYPE); 402 402 AssertPtrReturn(ppReq, VERR_INVALID_POINTER); 403 AssertMsgReturn(enmDest == VMREQDEST_ALL || (unsigned)enmDest < pUVM->pVM->cCPUs, ("Invalid destination %d (max=%d)\n", enmDest, pUVM->pVM->cCPUs), VERR_INVALID_PARAMETER); 403 404 404 405 /* … … 619 620 int rc = VINF_SUCCESS; 620 621 PUVM pUVM = ((VMREQ volatile *)pReq)->pUVM; /* volatile paranoia */ 621 if (pUVM->vm.s.NativeThreadEMT != RTThreadNativeSelf()) 622 if ( pReq->enmDest == VMREQDEST_ALL 623 && pUVM->vm.s.NativeThreadEMT != RTThreadNativeSelf()) 622 624 { 623 625 unsigned fFlags = ((VMREQ volatile *)pReq)->fFlags; /* volatile paranoia */ … … 639 641 if (pUVM->pVM) 640 642 VM_FF_SET(pUVM->pVM, VM_FF_REQUEST); 643 VMR3NotifyFFU(pUVM, false); 644 645 /* 646 * Wait and return. 647 */ 648 if (!(fFlags & VMREQFLAGS_NO_WAIT)) 649 rc = VMR3ReqWait(pReq, cMillies); 650 LogFlow(("VMR3ReqQueue: returns %Vrc\n", rc)); 651 } 652 else 653 if ( pReq->enmDest != VMREQDEST_ALL 654 && pUVM->aCpu[pReq->enmDest].vm.s.NativeThreadEMT != RTThreadNativeSelf()) 655 { 656 RTCPUID idTarget = (RTCPUID)pReq->enmDest; 657 unsigned fFlags = ((VMREQ volatile *)pReq)->fFlags; /* volatile paranoia */ 658 659 /* 660 * Insert it. 661 */ 662 pReq->enmState = VMREQSTATE_QUEUED; 663 PVMREQ pNext; 664 do 665 { 666 pNext = pUVM->aCpu[idTarget].vm.s.pReqs; 667 pReq->pNext = pNext; 668 } while (!ASMAtomicCmpXchgPtr((void * volatile *)&pUVM->aCpu[idTarget].vm.s.pReqs, (void *)pReq, (void *)pNext)); 669 670 /* 671 * Notify EMT. 672 */ 673 if (pUVM->pVM) 674 VMCPU_FF_SET(pUVM->pVM, VM_FF_REQUEST, idTarget); 675 /* @todo: VMR3NotifyFFU*/ 676 AssertFailed(); 641 677 VMR3NotifyFFU(pUVM, false); 642 678 … … 735 771 * 736 772 * @param pUVM Pointer to the user mode VM structure. 737 */ 738 VMMR3DECL(int) VMR3ReqProcessU(PUVM pUVM) 739 { 740 LogFlow(("VMR3ReqProcessU: (enmVMState=%d)\n", pUVM->pVM ? pUVM->pVM->enmVMState : VMSTATE_CREATING)); 773 * @param enmDest Destination of the request packet (global or per VCPU). 774 */ 775 VMMR3DECL(int) VMR3ReqProcessU(PUVM pUVM, VMREQDEST enmDest) 776 { 777 LogFlow(("VMR3ReqProcessU: (enmVMState=%d) enmDest=%d\n", pUVM->pVM ? pUVM->pVM->enmVMState : VMSTATE_CREATING, enmDest)); 741 778 742 779 /* … … 749 786 while (rc <= VINF_SUCCESS) 750 787 { 788 void *volatile *ppReqs; 789 751 790 /* 752 791 * Get pending requests. 753 792 */ 754 if (RT_LIKELY(pUVM->pVM)) 755 VM_FF_CLEAR(pUVM->pVM, VM_FF_REQUEST); 756 PVMREQ pReqs = (PVMREQ)ASMAtomicXchgPtr((void * volatile *)&pUVM->vm.s.pReqs, NULL); 793 if (enmDest == VMREQDEST_ALL) 794 { 795 ppReqs = (void * volatile *)&pUVM->vm.s.pReqs; 796 if (RT_LIKELY(pUVM->pVM)) 797 VM_FF_CLEAR(pUVM->pVM, VM_FF_REQUEST); 798 } 799 else 800 { 801 ppReqs = (void * volatile *)&pUVM->aCpu[enmDest].vm.s.pReqs; 802 if (RT_LIKELY(pUVM->pVM)) 803 VMCPU_FF_CLEAR(pUVM->pVM, enmDest, VM_FF_REQUEST); 804 } 805 806 PVMREQ pReqs = (PVMREQ)ASMAtomicXchgPtr(ppReqs, NULL); 757 807 if (!pReqs) 758 808 break;
Note:
See TracChangeset
for help on using the changeset viewer.