- Timestamp:
- May 31, 2010 12:56:31 PM (15 years ago)
- Location:
- trunk/src/VBox/VMM
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/PDMQueue.cpp
r28800 r29902 666 666 667 667 /* 668 * Only let one EMT flushing queues at any one time to queue preserve order668 * Only let one EMT flushing queues at any one time to preserve the order 669 669 * and to avoid wasting time. The FF is always cleared here, because it's 670 670 * only used to get someones attention. Queue inserts occuring during the 671 671 * flush are caught using the pending bit. 672 672 * 673 * Note. The order in which the FF and pending bit are set and cleared is important. 673 * Note! The order in which the FF and pending bit are set and cleared is 674 * important. 674 675 */ 675 676 VM_FF_CLEAR(pVM, VM_FF_PDM_QUEUES); … … 856 857 857 858 /** 858 * This is a worker function used by PDMQueueFlush to perform the859 * flush in ring-3.860 *861 * The queue which should be flushed is pointed to by either pQueueFlushRC,862 * pQueueFlushR0, or pQueue. This function will flush that queue and recalc863 * the queue FF.864 *865 * @param pVM The VM handle.866 * @param pQueue The queue to flush. Only used in Ring-3.867 */868 VMMR3DECL(void) PDMR3QueueFlushWorker(PVM pVM, PPDMQUEUE pQueue)869 {870 Assert(pVM->pdm.s.pQueueFlushR0 || pVM->pdm.s.pQueueFlushRC || pQueue);871 VM_ASSERT_EMT(pVM);872 873 /** @todo This will clash with PDMR3QueueFlushAll (guest SMP)! */874 Assert(!(pVM->pdm.s.fQueueFlushing & PDM_QUEUE_FLUSH_FLAG_ACTIVE));875 876 /*877 * Flush the queue.878 */879 if (!pQueue && pVM->pdm.s.pQueueFlushRC)880 {881 pQueue = (PPDMQUEUE)MMHyperRCToR3(pVM, pVM->pdm.s.pQueueFlushRC);882 pVM->pdm.s.pQueueFlushRC = NIL_RTRCPTR;883 }884 else if (!pQueue && pVM->pdm.s.pQueueFlushR0)885 {886 pQueue = (PPDMQUEUE)MMHyperR0ToR3(pVM, pVM->pdm.s.pQueueFlushR0);887 pVM->pdm.s.pQueueFlushR0 = NIL_RTR0PTR;888 }889 Assert(!pVM->pdm.s.pQueueFlushR0 && !pVM->pdm.s.pQueueFlushRC);890 891 if ( !pQueue892 || pdmR3QueueFlush(pQueue))893 {894 /*895 * Recalc the FF (for the queues using force action).896 */897 VM_FF_CLEAR(pVM, VM_FF_PDM_QUEUES);898 for (pQueue = pVM->pUVM->pdm.s.pQueuesForced; pQueue; pQueue = pQueue->pNext)899 if ( pQueue->pPendingRC900 || pQueue->pPendingR0901 || pQueue->pPendingR3)902 {903 VM_FF_SET(pVM, VM_FF_PDM_QUEUES);904 break;905 }906 }907 }908 909 910 /**911 859 * Free an item. 912 860 * -
trunk/src/VBox/VMM/VMM.cpp
r28800 r29902 403 403 STAM_REG(pVM, &pVM->vmm.s.StatRZRetCallRing3, STAMTYPE_COUNTER, "/VMM/RZCallR3/Misc", STAMUNIT_OCCURENCES, "Number of Other ring-3 calls."); 404 404 STAM_REG(pVM, &pVM->vmm.s.StatRZCallPDMLock, STAMTYPE_COUNTER, "/VMM/RZCallR3/PDMLock", STAMUNIT_OCCURENCES, "Number of VMMCALLRING3_PDM_LOCK calls."); 405 STAM_REG(pVM, &pVM->vmm.s.StatRZCallPDMQueueFlush, STAMTYPE_COUNTER, "/VMM/RZCallR3/PDMQueueFlush", STAMUNIT_OCCURENCES, "Number of VMMCALLRING3_PDM_QUEUE_FLUSH calls.");406 405 STAM_REG(pVM, &pVM->vmm.s.StatRZCallPGMLock, STAMTYPE_COUNTER, "/VMM/RZCallR3/PGMLock", STAMUNIT_OCCURENCES, "Number of VMMCALLRING3_PGM_LOCK calls."); 407 406 STAM_REG(pVM, &pVM->vmm.s.StatRZCallPGMPoolGrow, STAMTYPE_COUNTER, "/VMM/RZCallR3/PGMPoolGrow", STAMUNIT_OCCURENCES, "Number of VMMCALLRING3_PGM_POOL_GROW calls."); … … 2026 2025 { 2027 2026 pVCpu->vmm.s.rcCallRing3 = PDMR3LockCall(pVM); 2028 break;2029 }2030 2031 /*2032 * Flush a PDM queue.2033 */2034 case VMMCALLRING3_PDM_QUEUE_FLUSH:2035 {2036 PDMR3QueueFlushWorker(pVM, NULL);2037 pVCpu->vmm.s.rcCallRing3 = VINF_SUCCESS;2038 2027 break; 2039 2028 } -
trunk/src/VBox/VMM/VMMAll/PDMAllQueue.cpp
r28800 r29902 79 79 Assert(VALID_PTR(pItem)); 80 80 81 #if 0 /* the paranoid android version: */ 82 void *pvNext; 83 do 84 { 85 pvNext = ASMAtomicUoReadPtr((void * volatile *)&pQueue->CTX_SUFF(pPending)); 86 ASMAtomicUoWritePtr((void * volatile *)&pItem->CTX_SUFF(pNext), pvNext); 87 } while (!ASMAtomicCmpXchgPtr((void * volatile *)&pQueue->CTX_SUFF(pPending), pItem, pvNext)); 88 #else 81 89 PPDMQUEUEITEMCORE pNext; 82 90 do … … 85 93 pItem->CTX_SUFF(pNext) = pNext; 86 94 } while (!ASMAtomicCmpXchgPtr((void * volatile *)&pQueue->CTX_SUFF(pPending), pItem, pNext)); 95 #endif 87 96 88 97 if (!pQueue->pTimer) … … 170 179 } 171 180 172 173 /**174 * Flushes a PDM queue.175 *176 * @param pQueue The queue handle.177 */178 VMMDECL(void) PDMQueueFlush(PPDMQUEUE pQueue)179 {180 Assert(VALID_PTR(pQueue));181 Assert(pQueue->pVMR3);182 PVM pVM = pQueue->CTX_SUFF(pVM);183 184 #if defined(IN_RC) || defined(IN_RING0)185 Assert(pQueue->CTX_SUFF(pVM));186 pVM->pdm.s.CTX_SUFF(pQueueFlush) = pQueue;187 VMMRZCallRing3NoCpu(pVM, VMMCALLRING3_PDM_QUEUE_FLUSH, (uintptr_t)pQueue);188 189 #else /* IN_RING3: */190 VMR3ReqCallWait(pVM, VMCPUID_ANY, (PFNRT)PDMR3QueueFlushWorker, 2, pVM, pQueue);191 #endif192 } -
trunk/src/VBox/VMM/VMMGC/VMMGC.def
r28800 r29902 27 27 PDMCritSectIsOwner 28 28 PDMQueueAlloc 29 PDMQueueFlush30 29 PDMQueueInsert 31 30 PGMHandlerPhysicalPageTempOff -
trunk/src/VBox/VMM/VMMInternal.h
r28800 r29902 371 371 STAMCOUNTER StatRZCallPDMLock; 372 372 STAMCOUNTER StatRZCallLogFlush; 373 STAMCOUNTER StatRZCallPDMQueueFlush;374 373 STAMCOUNTER StatRZCallPGMPoolGrow; 375 374 STAMCOUNTER StatRZCallPGMMapChunk; -
trunk/src/VBox/VMM/VMMR0/VMMR0.def
r29573 r29902 27 27 PDMCritSectTryEnterDebug 28 28 PDMQueueAlloc 29 PDMQueueFlush30 29 PDMQueueInsert 31 30 PGMHandlerPhysicalPageTempOff
Note:
See TracChangeset
for help on using the changeset viewer.