Changeset 11424
- Timestamp:
- 08/14/08 15:46:06 (3 months ago)
- Files:
-
- trunk/include/VBox/cpum.h (modified) (18 diffs)
- trunk/src/VBox/VMM/EM.cpp (modified) (1 diff)
- trunk/src/VBox/VMM/EMInternal.h (modified) (1 diff)
- trunk/src/VBox/VMM/VMMAll/EMAll.cpp (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/include/VBox/cpum.h
r10630 r11424 90 90 union 91 91 { 92 uint16_t di; 92 93 uint32_t edi; 93 94 uint64_t rdi; … … 95 96 union 96 97 { 98 uint16_t si; 97 99 uint32_t esi; 98 100 uint64_t rsi; … … 100 102 union 101 103 { 104 uint16_t bp; 102 105 uint32_t ebp; 103 106 uint64_t rbp; … … 105 108 union 106 109 { 110 uint16_t ax; 107 111 uint32_t eax; 108 112 uint64_t rax; … … 110 114 union 111 115 { 116 uint16_t bx; 112 117 uint32_t ebx; 113 118 uint64_t rbx; … … 115 120 union 116 121 { 122 uint16_t dx; 117 123 uint32_t edx; 118 124 uint64_t rdx; … … 120 126 union 121 127 { 128 uint16_t cx; 122 129 uint32_t ecx; 123 130 uint64_t rcx; … … 125 132 union 126 133 { 134 uint16_t sp; 127 135 uint32_t esp; 128 136 uint64_t rsp; … … 151 159 union 152 160 { 161 uint16_t ip; 153 162 uint32_t eip; 154 163 uint64_t rip; … … 193 202 union 194 203 { 204 uint16_t di; 195 205 uint32_t edi; 196 206 uint64_t rdi; … … 198 208 union 199 209 { 210 uint16_t si; 200 211 uint32_t esi; 201 212 uint64_t rsi; … … 203 214 union 204 215 { 216 uint16_t bp; 205 217 uint32_t ebp; 206 218 uint64_t rbp; … … 208 220 union 209 221 { 222 uint16_t ax; 210 223 uint32_t eax; 211 224 uint64_t rax; … … 213 226 union 214 227 { 228 uint16_t bx; 215 229 uint32_t ebx; 216 230 uint64_t rbx; … … 218 232 union 219 233 { 234 uint16_t dx; 220 235 uint32_t edx; 221 236 uint64_t rdx; … … 223 238 union 224 239 { 240 uint16_t cx; 225 241 uint32_t ecx; 226 242 uint64_t rcx; … … 228 244 union 229 245 { 246 uint16_t sp; 230 247 uint32_t esp; 231 248 uint64_t rsp; … … 254 271 union 255 272 { 273 uint16_t ip; 256 274 uint32_t eip; 257 275 uint64_t rip; trunk/src/VBox/VMM/EM.cpp
r10706 r11424 213 213 STAM_REG_USED(pVM, &pStats->StatHCWrmsr, STAMTYPE_COUNTER, "/EM/HC/Interpret/Success/Wrmsr", STAMUNIT_OCCURENCES, "The number of times WRMSR was not interpreted."); 214 214 STAM_REG_USED(pVM, &pStats->StatGCWrmsr, STAMTYPE_COUNTER, "/EM/GC/Interpret/Success/Wrmsr", STAMUNIT_OCCURENCES, "The number of times WRMSR was not interpreted."); 215 STAM_REG_USED(pVM, &pStats->StatHCStosWD, STAMTYPE_COUNTER, "/EM/HC/Interpret/Success/Stoswd", STAMUNIT_OCCURENCES, "The number of times STOSWD was not interpreted."); 216 STAM_REG_USED(pVM, &pStats->StatGCStosWD, STAMTYPE_COUNTER, "/EM/GC/Interpret/Success/Stoswd", STAMUNIT_OCCURENCES, "The number of times STOSWD was not interpreted."); 215 217 216 218 STAM_REG(pVM, &pStats->StatGCInterpretFailed, STAMTYPE_COUNTER, "/EM/GC/Interpret/Failed", STAMUNIT_OCCURENCES, "The number of times an instruction was not interpreted."); trunk/src/VBox/VMM/EMInternal.h
r9387 r11424 141 141 STAMCOUNTER StatGCClts; 142 142 STAMCOUNTER StatHCClts; 143 STAMCOUNTER StatGCStosWD; 144 STAMCOUNTER StatHCStosWD; 143 145 STAMCOUNTER StatHCRdmsr; 144 146 STAMCOUNTER StatHCWrmsr; trunk/src/VBox/VMM/VMMAll/EMAll.cpp
r10883 r11424 1301 1301 return VERR_EM_INTERPRETER; 1302 1302 } 1303 1304 #ifndef IN_GC 1305 /* 1306 * [REP] STOSWD emulation 1307 * 1308 */ 1309 static int emInterpretStosWD(PVM pVM, PDISCPUSTATE pCpu, PCPUMCTXCORE pRegFrame, RTGCPTR pvFault, uint32_t *pcbSize) 1310 { 1311 int rc; 1312 RTGCPTR GCDest, GCOffset; 1313 uint32_t cbSize; 1314 uint64_t cTransfers; 1315 1316 /* Don't support any but these three prefix bytes. */ 1317 if ((pCpu->prefix & ~(PREFIX_ADDRSIZE|PREFIX_OPSIZE|PREFIX_REP|PREFIX_REX))) 1318 return VERR_EM_INTERPRETER; 1319 1320 switch (pCpu->addrmode) 1321 { 1322 case CPUMODE_16BIT: 1323 GCOffset = pRegFrame->di; 1324 cTransfers = pRegFrame->cx; 1325 break; 1326 case CPUMODE_32BIT: 1327 GCOffset = pRegFrame->edi; 1328 cTransfers = pRegFrame->ecx; 1329 break; 1330 case CPUMODE_64BIT: 1331 GCOffset = pRegFrame->rdi; 1332 cTransfers = pRegFrame->rcx; 1333 break; 1334 default: 1335 AssertFailed(); 1336 return VERR_EM_INTERPRETER; 1337 } 1338 1339 GCDest = SELMToFlat(pVM, DIS_SELREG_ES, pRegFrame, GCOffset); 1340 switch (pCpu->opmode) 1341 { 1342 case CPUMODE_16BIT: 1343 cbSize = 2; 1344 break; 1345 case CPUMODE_32BIT: 1346 cbSize = 4; 1347 break; 1348 case CPUMODE_64BIT: 1349 cbSize = 8; 1350 break; 1351 default: 1352 AssertFailed(); 1353 return VERR_EM_INTERPRETER; 1354 } 1355 1356 LogFlow(("emInterpretStosWD dest=%VGv cbSize=%d\n", GCDest, cbSize)); 1357 1358 if (!(pCpu->prefix & PREFIX_REP)) 1359 { 1360 rc = PGMPhysWriteGCPtrSafe(pVM, GCDest, &pRegFrame->rax, cbSize); 1361 if (VBOX_FAILURE(rc)) 1362 return VERR_EM_INTERPRETER; 1363 Assert(rc == VINF_SUCCESS); 1364 } 1365 else 1366 { 1367 /* REP case */ 1368 while (cTransfers) 1369 { 1370 rc = PGMPhysWriteGCPtrSafe(pVM, GCDest, &pRegFrame->rax, cbSize); 1371 if (VBOX_FAILURE(rc)) 1372 { 1373 rc = VERR_EM_INTERPRETER; 1374 break; 1375 } 1376 1377 Assert(rc == VINF_SUCCESS); 1378 GCOffset += cbSize; 1379 GCDest += cbSize; 1380 cTransfers--; 1381 } 1382 1383 /* Update the registers. */ 1384 switch (pCpu->addrmode) 1385 { 1386 case CPUMODE_16BIT: 1387 pRegFrame->di = GCOffset; 1388 pRegFrame->cx = cTransfers; 1389 break; 1390 case CPUMODE_32BIT: 1391 pRegFrame->edi = GCOffset; 1392 pRegFrame->ecx = cTransfers; 1393 break; 1394 case CPUMODE_64BIT: 1395 pRegFrame->rdi = GCOffset; 1396 pRegFrame->rcx = cTransfers; 1397 break; 1398 } 1399 } 1400 1401 *pcbSize = cbSize; 1402 return rc; 1403 } 1404 #endif 1405 1303 1406 1304 1407 /* … … 2531 2634 ) 2532 2635 #else 2533 if ( (pCpu->prefix & (PREFIX_REPNE | PREFIX_REP)) 2636 if ( (pCpu->prefix & PREFIX_REPNE) 2637 || ( (pCpu->prefix & PREFIX_REP) 2638 && pCpu->pCurInstr->opcode != OP_STOSWD 2639 ) 2534 2640 || ( (pCpu->prefix & PREFIX_LOCK) 2535 2641 && pCpu->pCurInstr->opcode != OP_OR … … 2594 2700 INTERPRET_CASE_EX_PARAM3(OP_AND,And, OrXorAnd, EMEmulateAnd); 2595 2701 INTERPRET_CASE(OP_MOV,Mov); 2702 #ifndef IN_GC 2703 INTERPRET_CASE(OP_STOSWD,StosWD); 2704 #endif 2596 2705 INTERPRET_CASE(OP_INVLPG,InvlPg); 2597 2706 INTERPRET_CASE(OP_CPUID,CpuId); … … 2626 2735 #endif 2627 2736 INTERPRET_STAT_CASE(OP_MOVNTPS,MovNTPS); 2628 INTERPRET_STAT_CASE(OP_STOSWD,StosWD);2629 2737 INTERPRET_STAT_CASE(OP_WBINVD,WbInvd); 2630 2738 #endif

