Changeset 20421 in vbox for trunk/src/VBox/VMM
- Timestamp:
- Jun 9, 2009 9:34:53 AM (16 years ago)
- Location:
- trunk/src/VBox/VMM
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/REMInternal.h
r19660 r20421 107 107 uint64_t padding[5]; 108 108 } u; 109 uint32_t idxSelf; 110 uint32_t idxNext; 109 111 } REMHANDLERNOTIFICATION, *PREMHANDLERNOTIFICATION; 110 112 … … 166 168 * These instructions are replayed when entering REM. */ 167 169 RTGCPTR aGCPtrInvalidatedPages[48]; 168 /** The number of recorded handler notifications. */ 169 RTUINT volatile cHandlerNotifications; 170 RTUINT padding0; /**< Padding. */ 170 171 171 /** Array of recorded handler noticications. 172 172 * These are replayed when entering REM. */ 173 173 REMHANDLERNOTIFICATION aHandlerNotifications[32]; 174 volatile uint32_t idxPendingList; 175 volatile uint32_t idxFreeList; 174 176 175 177 /** MMIO memory type. … … 211 213 uint32_t abPadding[HC_ARCH_BITS == 32 ? 6 : 4]; 212 214 213 #if GC_ARCH_BITS == 32 214 # define REM_ENV_SIZE (HC_ARCH_BITS == 32 ? 0xff00 : 0xff00) 215 #else 216 # define REM_ENV_SIZE (HC_ARCH_BITS == 32 ? 0xff00 : 0xff00) 217 #endif 215 # define REM_ENV_SIZE 0xff00 218 216 219 217 /** Recompiler CPU state. */ -
trunk/src/VBox/VMM/VMMAll/REMAll.cpp
r20410 r20421 82 82 AssertReleaseMsgFailed(("Ring 3 call????.\n")); 83 83 #endif 84 Assert(pVM->rem.s.cHandlerNotifications == 0); 85 } 86 84 } 85 86 87 /** 88 * Insert pending notification 89 * 90 * @param pVM VM Handle. 91 * @param pRec Notification record to insert 92 */ 93 static void remNotifyHandlerInsert(PVM pVM, PREMHANDLERNOTIFICATION pRec) 94 { 95 uint32_t idxFree; 96 uint32_t idxNext; 97 PREMHANDLERNOTIFICATION pFree; 98 99 /* Fetch a free record. */ 100 do 101 { 102 idxFree = pVM->rem.s.idxFreeList; 103 if (idxFree == -1) 104 { 105 pFree = NULL; 106 break; 107 } 108 pFree = &pVM->rem.s.aHandlerNotifications[idxFree]; 109 } while (!ASMAtomicCmpXchgU32(&pVM->rem.s.idxFreeList, pFree->idxNext, idxFree)); 110 111 if (!pFree) 112 { 113 remFlushHandlerNotifications(pVM); 114 return; 115 } 116 117 /* Copy the record. */ 118 *pFree = *pRec; 119 pFree->idxSelf = idxFree; /* was trashed */ 120 121 /* Insert it into the pending list. */ 122 do 123 { 124 idxNext = pVM->rem.s.idxPendingList; 125 pFree->idxNext = idxNext; 126 } while (!ASMAtomicCmpXchgU32(&pVM->rem.s.idxPendingList, idxFree, idxNext)); 127 128 VM_FF_SET(pVM, VM_FF_REM_HANDLER_NOTIFY); 129 } 87 130 88 131 /** … … 97 140 VMMDECL(void) REMNotifyHandlerPhysicalRegister(PVM pVM, PGMPHYSHANDLERTYPE enmType, RTGCPHYS GCPhys, RTGCPHYS cb, bool fHasHCHandler) 98 141 { 99 if (pVM->rem.s.cHandlerNotifications >= RT_ELEMENTS(pVM->rem.s.aHandlerNotifications)) 100 remFlushHandlerNotifications(pVM); 101 PREMHANDLERNOTIFICATION pRec = &pVM->rem.s.aHandlerNotifications[pVM->rem.s.cHandlerNotifications++]; 102 pRec->enmKind = REMHANDLERNOTIFICATIONKIND_PHYSICAL_REGISTER; 103 pRec->u.PhysicalRegister.enmType = enmType; 104 pRec->u.PhysicalRegister.GCPhys = GCPhys; 105 pRec->u.PhysicalRegister.cb = cb; 106 pRec->u.PhysicalRegister.fHasHCHandler = fHasHCHandler; 107 VM_FF_SET(pVM, VM_FF_REM_HANDLER_NOTIFY); 142 REMHANDLERNOTIFICATION Rec; 143 Rec.enmKind = REMHANDLERNOTIFICATIONKIND_PHYSICAL_REGISTER; 144 Rec.u.PhysicalRegister.enmType = enmType; 145 Rec.u.PhysicalRegister.GCPhys = GCPhys; 146 Rec.u.PhysicalRegister.cb = cb; 147 Rec.u.PhysicalRegister.fHasHCHandler = fHasHCHandler; 148 remNotifyHandlerInsert(pVM, &Rec); 108 149 } 109 150 … … 121 162 VMMDECL(void) REMNotifyHandlerPhysicalDeregister(PVM pVM, PGMPHYSHANDLERTYPE enmType, RTGCPHYS GCPhys, RTGCPHYS cb, bool fHasHCHandler, bool fRestoreAsRAM) 122 163 { 123 if (pVM->rem.s.cHandlerNotifications >= RT_ELEMENTS(pVM->rem.s.aHandlerNotifications)) 124 remFlushHandlerNotifications(pVM); 125 PREMHANDLERNOTIFICATION pRec = &pVM->rem.s.aHandlerNotifications[pVM->rem.s.cHandlerNotifications++]; 126 pRec->enmKind = REMHANDLERNOTIFICATIONKIND_PHYSICAL_DEREGISTER; 127 pRec->u.PhysicalDeregister.enmType = enmType; 128 pRec->u.PhysicalDeregister.GCPhys = GCPhys; 129 pRec->u.PhysicalDeregister.cb = cb; 130 pRec->u.PhysicalDeregister.fHasHCHandler = fHasHCHandler; 131 pRec->u.PhysicalDeregister.fRestoreAsRAM = fRestoreAsRAM; 132 VM_FF_SET(pVM, VM_FF_REM_HANDLER_NOTIFY); 164 REMHANDLERNOTIFICATION Rec; 165 Rec.enmKind = REMHANDLERNOTIFICATIONKIND_PHYSICAL_DEREGISTER; 166 Rec.u.PhysicalDeregister.enmType = enmType; 167 Rec.u.PhysicalDeregister.GCPhys = GCPhys; 168 Rec.u.PhysicalDeregister.cb = cb; 169 Rec.u.PhysicalDeregister.fHasHCHandler = fHasHCHandler; 170 Rec.u.PhysicalDeregister.fRestoreAsRAM = fRestoreAsRAM; 171 remNotifyHandlerInsert(pVM, &Rec); 133 172 } 134 173 … … 147 186 VMMDECL(void) REMNotifyHandlerPhysicalModify(PVM pVM, PGMPHYSHANDLERTYPE enmType, RTGCPHYS GCPhysOld, RTGCPHYS GCPhysNew, RTGCPHYS cb, bool fHasHCHandler, bool fRestoreAsRAM) 148 187 { 149 if (pVM->rem.s.cHandlerNotifications >= RT_ELEMENTS(pVM->rem.s.aHandlerNotifications)) 150 remFlushHandlerNotifications(pVM); 151 PREMHANDLERNOTIFICATION pRec = &pVM->rem.s.aHandlerNotifications[pVM->rem.s.cHandlerNotifications++]; 152 pRec->enmKind = REMHANDLERNOTIFICATIONKIND_PHYSICAL_MODIFY; 153 pRec->u.PhysicalModify.enmType = enmType; 154 pRec->u.PhysicalModify.GCPhysOld = GCPhysOld; 155 pRec->u.PhysicalModify.GCPhysNew = GCPhysNew; 156 pRec->u.PhysicalModify.cb = cb; 157 pRec->u.PhysicalModify.fHasHCHandler = fHasHCHandler; 158 pRec->u.PhysicalModify.fRestoreAsRAM = fRestoreAsRAM; 159 VM_FF_SET(pVM, VM_FF_REM_HANDLER_NOTIFY); 188 REMHANDLERNOTIFICATION Rec; 189 Rec.enmKind = REMHANDLERNOTIFICATIONKIND_PHYSICAL_MODIFY; 190 Rec.u.PhysicalModify.enmType = enmType; 191 Rec.u.PhysicalModify.GCPhysOld = GCPhysOld; 192 Rec.u.PhysicalModify.GCPhysNew = GCPhysNew; 193 Rec.u.PhysicalModify.cb = cb; 194 Rec.u.PhysicalModify.fHasHCHandler = fHasHCHandler; 195 Rec.u.PhysicalModify.fRestoreAsRAM = fRestoreAsRAM; 196 remNotifyHandlerInsert(pVM, &Rec); 160 197 } 161 198 -
trunk/src/VBox/VMM/testcase/tstVMStructGC.cpp
r20151 r20421 725 725 GEN_CHECK_OFF(REM, cCanExecuteRaw); 726 726 GEN_CHECK_OFF(REM, aGCPtrInvalidatedPages); 727 GEN_CHECK_OFF(REM, cHandlerNotifications);727 GEN_CHECK_OFF(REM, idxPendingList); 728 728 GEN_CHECK_OFF(REM, aHandlerNotifications); 729 GEN_CHECK_OFF(REM, idxFreeList); 729 730 GEN_CHECK_OFF(REM, rc); 730 731 GEN_CHECK_OFF(REM, StatsInQEMU);
Note:
See TracChangeset
for help on using the changeset viewer.