- Timestamp:
- Jul 2, 2009 3:45:46 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/VMMAll/EMAll.cpp
r20682 r21174 70 70 typedef struct 71 71 { 72 PVM pVM; 73 PVMCPU pVCpu; 72 PVM pVM; 73 PVMCPU pVCpu; 74 RTGCPTR GCPtr; 75 uint8_t aOpcode[8]; 74 76 } EMDISSTATE, *PEMDISSTATE; 75 77 … … 125 127 126 128 # ifdef IN_RING0 127 int rc = PGMPhysSimpleReadGCPtr(pVCpu, pDest, pSrc, cb); 129 int rc; 130 131 if ( pState->GCPtr 132 && pSrc + cb <= pState->GCPtr + sizeof(pState->aOpcode)) 133 { 134 unsigned offset = pSrc - pState->GCPtr; 135 136 Assert(pSrc >= pState->GCPtr); 137 138 for (unsigned i=0; i<cb; i++) 139 { 140 pDest[i] = pState->aOpcode[offset + i]; 141 } 142 return VINF_SUCCESS; 143 } 144 145 rc = PGMPhysSimpleReadGCPtr(pVCpu, pDest, pSrc, cb); 128 146 AssertMsgRC(rc, ("PGMPhysSimpleReadGCPtr failed for pSrc=%RGv cb=%x rc=%d\n", pSrc, cb, rc)); 129 147 # else /* IN_RING3 */ … … 135 153 else 136 154 { 137 for (u int32_ti = 0; i < cb; i++)155 for (unsigned i = 0; i < cb; i++) 138 156 { 139 157 uint8_t opcode; … … 153 171 State.pVM = pVM; 154 172 State.pVCpu = pVCpu; 173 int rc = PGMPhysSimpleReadGCPtr(pVCpu, &State.aOpcode, InstrGC, sizeof(State.aOpcode)); 174 if (RT_SUCCESS(rc)) 175 State.GCPtr = InstrGC; 176 else 177 State.GCPtr = NULL; 155 178 156 179 return DISCoreOneEx(InstrGC, pDis->mode, EMReadBytes, &State, pDis, pOpsize); … … 213 236 VMMDECL(int) EMInterpretDisasOneEx(PVM pVM, PVMCPU pVCpu, RTGCUINTPTR GCPtrInstr, PCCPUMCTXCORE pCtxCore, PDISCPUSTATE pDis, unsigned *pcbInstr) 214 237 { 238 int rc; 239 215 240 #ifndef IN_RC 216 241 EMDISSTATE State; … … 218 243 State.pVM = pVM; 219 244 State.pVCpu = pVCpu; 220 #endif 221 222 int rc = DISCoreOneEx(GCPtrInstr, SELMGetCpuModeFromSelector(pVM, pCtxCore->eflags, pCtxCore->cs, (PCPUMSELREGHID)&pCtxCore->csHid), 245 246 rc = PGMPhysSimpleReadGCPtr(pVCpu, &State.aOpcode, GCPtrInstr, sizeof(State.aOpcode)); 247 if (RT_SUCCESS(rc)) 248 State.GCPtr = GCPtrInstr; 249 else 250 State.GCPtr = NULL; 251 #endif 252 253 rc = DISCoreOneEx(GCPtrInstr, SELMGetCpuModeFromSelector(pVM, pCtxCore->eflags, pCtxCore->cs, (PCPUMSELREGHID)&pCtxCore->csHid), 223 254 #ifdef IN_RC 224 255 NULL, NULL,
Note:
See TracChangeset
for help on using the changeset viewer.