Changeset 41675 in vbox for trunk/src/VBox/VMM/VMMR3
- Timestamp:
- Jun 12, 2012 8:27:37 PM (13 years ago)
- svn:sync-xref-src-repo-rev:
- 78482
- Location:
- trunk/src/VBox/VMM/VMMR3
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/VMMR3/CPUM.cpp
r41674 r41675 3631 3631 State.cbSegLimit = pCtx->csHid.u32Limit; 3632 3632 enmDisCpuMode = (State.f64Bits) 3633 ? CPUMODE_64BIT3633 ? DISCPUMODE_64BIT 3634 3634 : pCtx->csHid.Attr.n.u1DefBig 3635 ? CPUMODE_32BIT3636 : CPUMODE_16BIT;3635 ? DISCPUMODE_32BIT 3636 : DISCPUMODE_16BIT; 3637 3637 } 3638 3638 else … … 3659 3659 State.GCPtrSegEnd = SelInfo.cbLimit + 1 + (RTGCUINTPTR)SelInfo.GCPtrBase; 3660 3660 State.cbSegLimit = SelInfo.cbLimit; 3661 enmDisCpuMode = SelInfo.u.Raw.Gen.u1DefBig ? CPUMODE_32BIT :CPUMODE_16BIT;3661 enmDisCpuMode = SelInfo.u.Raw.Gen.u1DefBig ? DISCPUMODE_32BIT : DISCPUMODE_16BIT; 3662 3662 } 3663 3663 } … … 3665 3665 { 3666 3666 /* real or V86 mode */ 3667 enmDisCpuMode = CPUMODE_16BIT;3667 enmDisCpuMode = DISCPUMODE_16BIT; 3668 3668 State.GCPtrSegBase = pCtx->cs * 16; 3669 3669 State.GCPtrSegEnd = 0xFFFFFFFF; -
trunk/src/VBox/VMM/VMMR3/CSAM.cpp
r41674 r41675 870 870 Assert(VALID_PTR(pCurInstrHC)); 871 871 872 rc = CSAMR3DISInstr(pVM, pCurInstrGC, pCurInstrHC, (fCode32) ? CPUMODE_32BIT :CPUMODE_16BIT,872 rc = CSAMR3DISInstr(pVM, pCurInstrGC, pCurInstrHC, (fCode32) ? DISCPUMODE_32BIT : DISCPUMODE_16BIT, 873 873 &cpu, &opsize, NULL, 0); 874 874 } … … 1053 1053 STAM_PROFILE_START(&pVM->csam.s.StatTimeDisasm, a); 1054 1054 #ifdef DEBUG 1055 rc2 = CSAMR3DISInstr(pVM, pCurInstrGC, pCurInstrHC, (fCode32) ? CPUMODE_32BIT :CPUMODE_16BIT,1055 rc2 = CSAMR3DISInstr(pVM, pCurInstrGC, pCurInstrHC, (fCode32) ? DISCPUMODE_32BIT : DISCPUMODE_16BIT, 1056 1056 &cpu, &opsize, szOutput, sizeof(szOutput)); 1057 1057 if (RT_SUCCESS(rc2)) Log(("CSAM Call Analysis: %s", szOutput)); 1058 1058 #else 1059 rc2 = CSAMR3DISInstr(pVM, pCurInstrGC, pCurInstrHC, (fCode32) ? CPUMODE_32BIT :CPUMODE_16BIT,1059 rc2 = CSAMR3DISInstr(pVM, pCurInstrGC, pCurInstrHC, (fCode32) ? DISCPUMODE_32BIT : DISCPUMODE_16BIT, 1060 1060 &cpu, &opsize, NULL, 0); 1061 1061 #endif … … 1266 1266 STAM_PROFILE_START(&pVM->csam.s.StatTimeDisasm, a); 1267 1267 #ifdef DEBUG 1268 rc2 = CSAMR3DISInstr(pVM, pCurInstrGC, pCurInstrHC, fCode32 ? CPUMODE_32BIT :CPUMODE_16BIT,1268 rc2 = CSAMR3DISInstr(pVM, pCurInstrGC, pCurInstrHC, fCode32 ? DISCPUMODE_32BIT : DISCPUMODE_16BIT, 1269 1269 &cpu, &opsize, szOutput, sizeof(szOutput)); 1270 1270 if (RT_SUCCESS(rc2)) Log(("CSAM Analysis: %s", szOutput)); 1271 1271 #else 1272 rc2 = CSAMR3DISInstr(pVM, pCurInstrGC, pCurInstrHC, fCode32 ? CPUMODE_32BIT :CPUMODE_16BIT,1272 rc2 = CSAMR3DISInstr(pVM, pCurInstrGC, pCurInstrHC, fCode32 ? DISCPUMODE_32BIT : DISCPUMODE_16BIT, 1273 1273 &cpu, &opsize, NULL, 0); 1274 1274 #endif … … 2261 2261 { 2262 2262 /* Assuming 32 bits code for now. */ 2263 Assert(SELMGetCpuModeFromSelector(VMMGetCpu0(pVM), pCtxCore->eflags, pCtxCore->cs, &pCtxCore->csHid) == CPUMODE_32BIT);2263 Assert(SELMGetCpuModeFromSelector(VMMGetCpu0(pVM), pCtxCore->eflags, pCtxCore->cs, &pCtxCore->csHid) == DISCPUMODE_32BIT); 2264 2264 2265 2265 pInstrGC = SELMToFlat(pVM, DIS_SELREG_CS, pCtxCore, pInstrGC); -
trunk/src/VBox/VMM/VMMR3/DBGFDisas.cpp
r41674 r41675 122 122 case DBGF_DISAS_FLAGS_DEFAULT_MODE: 123 123 enmCpuMode = pState->f64Bits 124 ? CPUMODE_64BIT124 ? DISCPUMODE_64BIT 125 125 : pSelInfo->u.Raw.Gen.u1DefBig 126 ? CPUMODE_32BIT127 : CPUMODE_16BIT;126 ? DISCPUMODE_32BIT 127 : DISCPUMODE_16BIT; 128 128 break; 129 129 case DBGF_DISAS_FLAGS_16BIT_MODE: 130 130 case DBGF_DISAS_FLAGS_16BIT_REAL_MODE: 131 enmCpuMode = CPUMODE_16BIT;131 enmCpuMode = DISCPUMODE_16BIT; 132 132 break; 133 133 case DBGF_DISAS_FLAGS_32BIT_MODE: 134 enmCpuMode = CPUMODE_32BIT;134 enmCpuMode = DISCPUMODE_32BIT; 135 135 break; 136 136 case DBGF_DISAS_FLAGS_64BIT_MODE: 137 enmCpuMode = CPUMODE_64BIT;137 enmCpuMode = DISCPUMODE_64BIT; 138 138 break; 139 139 } -
trunk/src/VBox/VMM/VMMR3/EMHwaccm.cpp
r40446 r41675 307 307 rcStrict = VINF_EM_RAW_EMULATE_INSTR; 308 308 309 if (!(Cpu.prefix & ( PREFIX_REP |PREFIX_REPNE)))309 if (!(Cpu.prefix & (DISPREFIX_REP | DISPREFIX_REPNE))) 310 310 { 311 311 switch (Cpu.pCurInstr->opcode) … … 326 326 } 327 327 } 328 else if (Cpu.prefix & PREFIX_REP)328 else if (Cpu.prefix & DISPREFIX_REP) 329 329 { 330 330 switch (Cpu.pCurInstr->opcode) -
trunk/src/VBox/VMM/VMMR3/EMRaw.cpp
r40451 r41675 428 428 VBOXSTRICTRC rcStrict = VINF_EM_RAW_EMULATE_INSTR; 429 429 430 if (!(Cpu.prefix & ( PREFIX_REP |PREFIX_REPNE)))430 if (!(Cpu.prefix & (DISPREFIX_REP | DISPREFIX_REPNE))) 431 431 { 432 432 switch (Cpu.pCurInstr->opcode) … … 447 447 } 448 448 } 449 else if (Cpu.prefix & PREFIX_REP)449 else if (Cpu.prefix & DISPREFIX_REP) 450 450 { 451 451 switch (Cpu.pCurInstr->opcode) … … 684 684 { 685 685 rc = PATMR3InstallPatch(pVM, SELMToFlat(pVM, DIS_SELREG_CS, CPUMCTX2CORE(pCtx), pCtx->eip), 686 (SELMGetCpuModeFromSelector(pVCpu, pCtx->eflags, pCtx->cs, &pCtx->csHid) == CPUMODE_32BIT) ? PATMFL_CODE32 : 0);686 (SELMGetCpuModeFromSelector(pVCpu, pCtx->eflags, pCtx->cs, &pCtx->csHid) == DISCPUMODE_32BIT) ? PATMFL_CODE32 : 0); 687 687 if (RT_SUCCESS(rc)) 688 688 { … … 934 934 { 935 935 int rc = PATMR3InstallPatch(pVM, SELMToFlat(pVM, DIS_SELREG_CS, CPUMCTX2CORE(pCtx), pCtx->eip), 936 (SELMGetCpuModeFromSelector(pVCpu, pCtx->eflags, pCtx->cs, &pCtx->csHid) == CPUMODE_32BIT) ? PATMFL_CODE32 : 0);936 (SELMGetCpuModeFromSelector(pVCpu, pCtx->eflags, pCtx->cs, &pCtx->csHid) == DISCPUMODE_32BIT) ? PATMFL_CODE32 : 0); 937 937 if (RT_SUCCESS(rc)) 938 938 { … … 1041 1041 if ( (pCtx->ss & X86_SEL_RPL) == 0 1042 1042 && !pCtx->eflags.Bits.u1VM 1043 && SELMGetCpuModeFromSelector(pVCpu, pCtx->eflags, pCtx->cs, &pCtx->csHid) == CPUMODE_32BIT)1043 && SELMGetCpuModeFromSelector(pVCpu, pCtx->eflags, pCtx->cs, &pCtx->csHid) == DISCPUMODE_32BIT) 1044 1044 { 1045 1045 STAM_PROFILE_START(&pVCpu->em.s.StatPrivEmu, a); -
trunk/src/VBox/VMM/VMMR3/PATM.cpp
r41674 r41675 604 604 disinfo.fReadFlags = fReadFlags; 605 605 return RT_SUCCESS(DISInstrToStrWithReader(InstrGCPtr32, 606 (pPatch->flags & PATMFL_CODE32) ? CPUMODE_32BIT :CPUMODE_16BIT,606 (pPatch->flags & PATMFL_CODE32) ? DISCPUMODE_32BIT : DISCPUMODE_16BIT, 607 607 patmReadBytes, &disinfo, 608 608 pCpu, pcbInstr, pszOutput, cbOutput)); … … 620 620 disinfo.fReadFlags = fReadFlags; 621 621 return RT_SUCCESS(DISInstrWithReader(InstrGCPtr32, 622 (pPatch->flags & PATMFL_CODE32) ? CPUMODE_32BIT :CPUMODE_16BIT,622 (pPatch->flags & PATMFL_CODE32) ? DISCPUMODE_32BIT : DISCPUMODE_16BIT, 623 623 patmReadBytes, &disinfo, 624 624 pCpu, pcbInstr)); … … 1654 1654 */ 1655 1655 Log(("patmRecompileCallback: jump to code we've recompiled before %RRv!\n", pCurInstrGC)); 1656 return patmPatchGenRelJump(pVM, pPatch, pCurInstrGC, OP_JMP, !!(pCpu->prefix & PREFIX_OPSIZE));1656 return patmPatchGenRelJump(pVM, pPatch, pCurInstrGC, OP_JMP, !!(pCpu->prefix & DISPREFIX_OPSIZE)); 1657 1657 } 1658 1658 … … 1713 1713 } 1714 1714 else 1715 rc = patmPatchGenRelJump(pVM, pPatch, pTargetGC, pCpu->pCurInstr->opcode, !!(pCpu->prefix & PREFIX_OPSIZE));1715 rc = patmPatchGenRelJump(pVM, pPatch, pTargetGC, pCpu->pCurInstr->opcode, !!(pCpu->prefix & DISPREFIX_OPSIZE)); 1716 1716 1717 1717 if (RT_SUCCESS(rc)) … … 1855 1855 fGenerateJmpBack = false; 1856 1856 1857 rc = patmPatchGenPopf(pVM, pPatch, pCurInstrGC + pCpu->opsize, !!(pCpu->prefix & PREFIX_OPSIZE), fGenerateJmpBack);1857 rc = patmPatchGenPopf(pVM, pPatch, pCurInstrGC + pCpu->opsize, !!(pCpu->prefix & DISPREFIX_OPSIZE), fGenerateJmpBack); 1858 1858 if (RT_SUCCESS(rc)) 1859 1859 { … … 1873 1873 1874 1874 case OP_PUSHF: 1875 rc = patmPatchGenPushf(pVM, pPatch, !!(pCpu->prefix & PREFIX_OPSIZE));1875 rc = patmPatchGenPushf(pVM, pPatch, !!(pCpu->prefix & DISPREFIX_OPSIZE)); 1876 1876 if (RT_SUCCESS(rc)) 1877 1877 rc = VWRN_CONTINUE_RECOMPILE; … … 1890 1890 case OP_IRET: 1891 1891 Log(("IRET at %RRv\n", pCurInstrGC)); 1892 rc = patmPatchGenIret(pVM, pPatch, pCurInstrGC, !!(pCpu->prefix & PREFIX_OPSIZE));1892 rc = patmPatchGenIret(pVM, pPatch, pCurInstrGC, !!(pCpu->prefix & DISPREFIX_OPSIZE)); 1893 1893 if (RT_SUCCESS(rc)) 1894 1894 { … … 3217 3217 pPatch->uCurPatchOffset = 0; 3218 3218 3219 cpu.mode = (pPatch->flags & PATMFL_CODE32) ? CPUMODE_32BIT :CPUMODE_16BIT;3219 cpu.mode = (pPatch->flags & PATMFL_CODE32) ? DISCPUMODE_32BIT : DISCPUMODE_16BIT; 3220 3220 3221 3221 /* Note: Set the PATM interrupt flag here; it was cleared before the patched call. (!!!) */ … … 4212 4212 pPatchRec->patch.pPrivInstrGC = pInstrGC; 4213 4213 pPatchRec->patch.flags = flags; 4214 pPatchRec->patch.uOpMode = (flags & PATMFL_CODE32) ? CPUMODE_32BIT :CPUMODE_16BIT;4214 pPatchRec->patch.uOpMode = (flags & PATMFL_CODE32) ? DISCPUMODE_32BIT : DISCPUMODE_16BIT; 4215 4215 pPatchRec->patch.pTrampolinePatchesHead = NULL; 4216 4216 … … 6457 6457 if (disret && (cpu.pCurInstr->opcode == OP_SYSEXIT || cpu.pCurInstr->opcode == OP_HLT || cpu.pCurInstr->opcode == OP_INT3)) 6458 6458 { 6459 cpu.mode = (pPatch->patch.flags & PATMFL_CODE32) ? CPUMODE_32BIT :CPUMODE_16BIT;6459 cpu.mode = (pPatch->patch.flags & PATMFL_CODE32) ? DISCPUMODE_32BIT : DISCPUMODE_16BIT; 6460 6460 disret = patmR3DisInstr(pVM, &pPatch->patch, pNewEip, PATMGCVirtToHCVirt(pVM, &cacheRec, pNewEip), PATMREAD_RAWCODE, 6461 6461 &cpu, &opsize); -
trunk/src/VBox/VMM/VMMR3/PATMPatch.cpp
r41663 r41675 701 701 offset = 0; 702 702 /* include prefix byte to make sure we don't use the incorrect selector register. */ 703 if (pCpu->prefix & PREFIX_SEG)703 if (pCpu->prefix & DISPREFIX_SEG) 704 704 pPB[offset++] = DISQuerySegPrefixByte(pCpu); 705 705 pPB[offset++] = 0xFF; // push r/m32 706 706 pPB[offset++] = MAKE_MODRM(pCpu->ModRM.Bits.Mod, 6 /* group 5 */, pCpu->ModRM.Bits.Rm); 707 707 i = 2; /* standard offset of modrm bytes */ 708 if (pCpu->prefix & PREFIX_OPSIZE)708 if (pCpu->prefix & DISPREFIX_OPSIZE) 709 709 i++; //skip operand prefix 710 if (pCpu->prefix & PREFIX_SEG)710 if (pCpu->prefix & DISPREFIX_SEG) 711 711 i++; //skip segment prefix 712 712 … … 797 797 offset = 0; 798 798 /* include prefix byte to make sure we don't use the incorrect selector register. */ 799 if (pCpu->prefix & PREFIX_SEG)799 if (pCpu->prefix & DISPREFIX_SEG) 800 800 pPB[offset++] = DISQuerySegPrefixByte(pCpu); 801 801 … … 803 803 pPB[offset++] = MAKE_MODRM(pCpu->ModRM.Bits.Mod, 6 /* group 5 */, pCpu->ModRM.Bits.Rm); 804 804 i = 2; /* standard offset of modrm bytes */ 805 if (pCpu->prefix & PREFIX_OPSIZE)805 if (pCpu->prefix & DISPREFIX_OPSIZE) 806 806 i++; //skip operand prefix 807 if (pCpu->prefix & PREFIX_SEG)807 if (pCpu->prefix & DISPREFIX_SEG) 808 808 i++; //skip segment prefix 809 809 … … 1276 1276 PATCHGEN_PROLOG_NODEF(pVM, pPatch); 1277 1277 offset = 0; 1278 if (pCpu->prefix & PREFIX_OPSIZE)1278 if (pCpu->prefix & DISPREFIX_OPSIZE) 1279 1279 pPB[offset++] = 0x66; /* size override -> 16 bits push */ 1280 1280 pPB[offset++] = 0x16; … … 1289 1289 PATCHGEN_PROLOG_NODEF(pVM, pPatch); 1290 1290 offset = 0; 1291 if (pCpu->prefix & PREFIX_OPSIZE)1291 if (pCpu->prefix & DISPREFIX_OPSIZE) 1292 1292 pPB[offset++] = 0x66; /* size override -> 16 bits pop */ 1293 1293 pPB[offset++] = 0x58 + pCpu->param1.base.reg_gen; … … 1320 1320 1321 1321 /** @todo segment prefix (untested) */ 1322 Assert(pCpu->prefix == PREFIX_NONE || pCpu->prefix ==PREFIX_OPSIZE);1322 Assert(pCpu->prefix == DISPREFIX_NONE || pCpu->prefix == DISPREFIX_OPSIZE); 1323 1323 1324 1324 PATCHGEN_PROLOG(pVM, pPatch); … … 1329 1329 // 8B 15 [32 bits addr] mov edx, CPUMCTX.tr/ldtr 1330 1330 1331 if (pCpu->prefix == PREFIX_OPSIZE)1331 if (pCpu->prefix == DISPREFIX_OPSIZE) 1332 1332 pPB[offset++] = 0x66; 1333 1333 … … 1360 1360 pPB[offset++] = 0x52; // push edx 1361 1361 1362 if (pCpu->prefix == PREFIX_SEG)1362 if (pCpu->prefix == DISPREFIX_SEG) 1363 1363 { 1364 1364 pPB[offset++] = DISQuerySegPrefixByte(pCpu); … … 1369 1369 1370 1370 i = 3; /* standard offset of modrm bytes */ 1371 if (pCpu->prefix == PREFIX_OPSIZE)1371 if (pCpu->prefix == DISPREFIX_OPSIZE) 1372 1372 i++; //skip operand prefix 1373 if (pCpu->prefix == PREFIX_SEG)1373 if (pCpu->prefix == DISPREFIX_SEG) 1374 1374 i++; //skip segment prefix 1375 1375 … … 1420 1420 1421 1421 /* @todo segment prefix (untested) */ 1422 Assert(pCpu->prefix == PREFIX_NONE);1422 Assert(pCpu->prefix == DISPREFIX_NONE); 1423 1423 1424 1424 // sgdt %Ms … … 1455 1455 pPB[offset++] = 0x52; // push edx 1456 1456 1457 if (pCpu->prefix == PREFIX_SEG)1457 if (pCpu->prefix == DISPREFIX_SEG) 1458 1458 { 1459 1459 pPB[offset++] = DISQuerySegPrefixByte(pCpu); … … 1464 1464 1465 1465 i = 3; /* standard offset of modrm bytes */ 1466 if (pCpu->prefix == PREFIX_OPSIZE)1466 if (pCpu->prefix == DISPREFIX_OPSIZE) 1467 1467 i++; //skip operand prefix 1468 if (pCpu->prefix == PREFIX_SEG)1468 if (pCpu->prefix == DISPREFIX_SEG) 1469 1469 i++; //skip segment prefix 1470 1470 rc = patmPatchReadBytes(pVM, &pPB[offset], (RTRCPTR)((RTGCUINTPTR32)pCurInstrGC + i), pCpu->opsize - i); -
trunk/src/VBox/VMM/VMMR3/VMMSwitcher.cpp
r41674 r41675 835 835 DISCPUSTATE Cpu; 836 836 char szDisas[256]; 837 int rc = DISInstr(pu8CodeR3 + offCode, CPUMODE_32BIT, &Cpu, &cbInstr);837 int rc = DISInstr(pu8CodeR3 + offCode, DISCPUMODE_32BIT, &Cpu, &cbInstr); 838 838 if (RT_SUCCESS(rc)) 839 839 {
Note:
See TracChangeset
for help on using the changeset viewer.