Changeset 20871 in vbox for trunk/src/VBox/VMM/VMMAll/REMAll.cpp
- Timestamp:
- Jun 24, 2009 1:56:19 AM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/VMMAll/REMAll.cpp
r20869 r20871 22 22 23 23 /******************************************************************************* 24 * Global Variables*24 * Header Files * 25 25 *******************************************************************************/ 26 26 #define LOG_GROUP LOG_GROUP_REM … … 80 80 81 81 /** 82 * Flushes the handler notifications by calling the host.83 *84 * @param pVM The VM handle.85 */86 static void remFlushHandlerNotifications(PVM pVM)87 {88 #ifdef IN_RC89 VMMGCCallHost(pVM, VMMCALLHOST_REM_REPLAY_HANDLER_NOTIFICATIONS, 0);90 #elif defined(IN_RING0)91 /** @todo necessary? */92 VMMR0CallHost(pVM, VMMCALLHOST_REM_REPLAY_HANDLER_NOTIFICATIONS, 0);93 #else94 AssertReleaseMsgFailed(("Ring 3 call????.\n"));95 #endif96 }97 98 99 /**100 82 * Insert pending notification 101 83 * … … 120 102 Assert(cFlushes++ != 128); 121 103 AssertFatal(cFlushes < _1M); 122 remFlushHandlerNotifications(pVM);104 VMMRZCallRing3NoCpu(pVM, VMMCALLHOST_REM_REPLAY_HANDLER_NOTIFICATIONS, 0); 123 105 idxFree = ASMAtomicUoReadU32(&pVM->rem.s.idxFreeList); 124 106 } while (idxFree == (uint32_t)-1); … … 145 127 146 128 VM_FF_SET(pVM, VM_FF_REM_HANDLER_NOTIFY); 147 148 #if 0 /* Enable this to trigger odd flush bugs. */149 remFlushHandlerNotifications(pVM);150 #endif151 129 } 152 130 … … 222 200 #endif /* !IN_RING3 */ 223 201 202 #ifdef IN_RC 203 /** 204 * Flushes the physical handler notifications if the queue is almost full. 205 * 206 * This is for avoiding trouble in RC when changing CR3. 207 * 208 * @param pVM The VM handle. 209 * @param pVCpu The virtual CPU handle of the calling EMT. 210 */ 211 VMMDECL(void) REMNotifyHandlerPhysicalFlushIfAlmostFull(PVM pVM, PVMCPU pVCpu) 212 { 213 Assert(pVM->cCPUs == 1); 214 215 /* 216 * Less than 10 items means we should flush. 217 */ 218 uint32_t cFree = 0; 219 for (uint32_t idx = pVM->rem.s.idxFreeList; 220 idx != UINT32_MAX; 221 idx = pVM->rem.s.aHandlerNotifications[idx].idxNext) 222 { 223 Assert(idx < RT_ELEMENTS(pVM->rem.s.aHandlerNotifications)); 224 if (++cFree > 10) 225 return; 226 } 227 228 /* Ok, we gotta flush them. */ 229 VMMRZCallRing3NoCpu(pVM, VMMCALLHOST_REM_REPLAY_HANDLER_NOTIFICATIONS, 0); 230 } 231 #endif /* IN_RC */ 232 233 224 234 /** 225 235 * Make REM flush all translation block upon the next call to REMR3State().
Note:
See TracChangeset
for help on using the changeset viewer.