Changeset 41744 in vbox for trunk/src/VBox/VMM
- Timestamp:
- Jun 15, 2012 2:29:09 AM (13 years ago)
- svn:sync-xref-src-repo-rev:
- 78552
- Location:
- trunk/src/VBox/VMM
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/VMMAll/EMAll.cpp
r41739 r41744 879 879 { 880 880 case 1: //special case for AH etc 881 rc = DISWriteReg8(pRegFrame, pDis->Param1. base.reg_gen, (uint8_t )valpar2); break;882 case 2: rc = DISWriteReg16(pRegFrame, pDis->Param1. base.reg_gen, (uint16_t)valpar2); break;883 case 4: rc = DISWriteReg32(pRegFrame, pDis->Param1. base.reg_gen, (uint32_t)valpar2); break;884 case 8: rc = DISWriteReg64(pRegFrame, pDis->Param1. base.reg_gen, valpar2); break;881 rc = DISWriteReg8(pRegFrame, pDis->Param1.Base.idxGenReg, (uint8_t )valpar2); break; 882 case 2: rc = DISWriteReg16(pRegFrame, pDis->Param1.Base.idxGenReg, (uint16_t)valpar2); break; 883 case 4: rc = DISWriteReg32(pRegFrame, pDis->Param1.Base.idxGenReg, (uint32_t)valpar2); break; 884 case 8: rc = DISWriteReg64(pRegFrame, pDis->Param1.Base.idxGenReg, valpar2); break; 885 885 default: AssertFailedReturn(VERR_EM_INTERPRETER); 886 886 } … … 905 905 { 906 906 case 1: //special case for AH etc 907 rc = DISWriteReg8(pRegFrame, pDis->Param2. base.reg_gen, (uint8_t )valpar1); break;908 case 2: rc = DISWriteReg16(pRegFrame, pDis->Param2. base.reg_gen, (uint16_t)valpar1); break;909 case 4: rc = DISWriteReg32(pRegFrame, pDis->Param2. base.reg_gen, (uint32_t)valpar1); break;910 case 8: rc = DISWriteReg64(pRegFrame, pDis->Param2. base.reg_gen, valpar1); break;907 rc = DISWriteReg8(pRegFrame, pDis->Param2.Base.idxGenReg, (uint8_t )valpar1); break; 908 case 2: rc = DISWriteReg16(pRegFrame, pDis->Param2.Base.idxGenReg, (uint16_t)valpar1); break; 909 case 4: rc = DISWriteReg32(pRegFrame, pDis->Param2.Base.idxGenReg, (uint32_t)valpar1); break; 910 case 8: rc = DISWriteReg64(pRegFrame, pDis->Param2.Base.idxGenReg, valpar1); break; 911 911 default: AssertFailedReturn(VERR_EM_INTERPRETER); 912 912 } … … 1051 1051 if ( (pDis->Param1.fUse & DISUSE_BASE) 1052 1052 && (pDis->Param1.fUse & (DISUSE_REG_GEN16|DISUSE_REG_GEN32)) 1053 && pDis->Param1. base.reg_gen== DISGREG_ESP1053 && pDis->Param1.Base.idxGenReg == DISGREG_ESP 1054 1054 ) 1055 1055 pParam1 = (RTGCPTR)((RTGCUINTPTR)pParam1 + param1.size); … … 1609 1609 switch(param1.size) 1610 1610 { 1611 case 1: rc = DISWriteReg8(pRegFrame, pDis->Param1. base.reg_gen, (uint8_t) val64); break;1612 case 2: rc = DISWriteReg16(pRegFrame, pDis->Param1. base.reg_gen, (uint16_t)val64); break;1613 case 4: rc = DISWriteReg32(pRegFrame, pDis->Param1. base.reg_gen, (uint32_t)val64); break;1614 case 8: rc = DISWriteReg64(pRegFrame, pDis->Param1. base.reg_gen, val64); break;1611 case 1: rc = DISWriteReg8(pRegFrame, pDis->Param1.Base.idxGenReg, (uint8_t) val64); break; 1612 case 2: rc = DISWriteReg16(pRegFrame, pDis->Param1.Base.idxGenReg, (uint16_t)val64); break; 1613 case 4: rc = DISWriteReg32(pRegFrame, pDis->Param1.Base.idxGenReg, (uint32_t)val64); break; 1614 case 8: rc = DISWriteReg64(pRegFrame, pDis->Param1.Base.idxGenReg, val64); break; 1615 1615 default: 1616 1616 return VERR_EM_INTERPRETER; … … 2428 2428 if(param1.size != sizeof(uint16_t)) 2429 2429 return VERR_EM_INTERPRETER; 2430 LogFlow(("emInterpretSmsw %d <- cr0 (%x)\n", pDis->Param1. base.reg_gen, cr0));2431 rc = DISWriteReg16(pRegFrame, pDis->Param1. base.reg_gen, cr0);2430 LogFlow(("emInterpretSmsw %d <- cr0 (%x)\n", pDis->Param1.Base.idxGenReg, cr0)); 2431 rc = DISWriteReg16(pRegFrame, pDis->Param1.Base.idxGenReg, cr0); 2432 2432 break; 2433 2433 … … 2469 2469 NOREF(pvFault); NOREF(pcbSize); 2470 2470 if ((pDis->Param1.fUse == DISUSE_REG_GEN32 || pDis->Param1.fUse == DISUSE_REG_GEN64) && pDis->Param2.fUse == DISUSE_REG_CR) 2471 return EMInterpretCRxRead(pVM, pVCpu, pRegFrame, pDis->Param1. base.reg_gen, pDis->Param2.base.reg_ctrl);2471 return EMInterpretCRxRead(pVM, pVCpu, pRegFrame, pDis->Param1.Base.idxGenReg, pDis->Param2.Base.idxCtrlReg); 2472 2472 2473 2473 if (pDis->Param1.fUse == DISUSE_REG_CR && (pDis->Param2.fUse == DISUSE_REG_GEN32 || pDis->Param2.fUse == DISUSE_REG_GEN64)) 2474 return EMInterpretCRxWrite(pVM, pVCpu, pRegFrame, pDis->Param1. base.reg_ctrl, pDis->Param2.base.reg_gen);2474 return EMInterpretCRxWrite(pVM, pVCpu, pRegFrame, pDis->Param1.Base.idxCtrlReg, pDis->Param2.Base.idxGenReg); 2475 2475 2476 2476 AssertMsgFailedReturn(("Unexpected control register move\n"), VERR_EM_INTERPRETER); … … 2560 2560 if((pDis->Param1.fUse == DISUSE_REG_GEN32 || pDis->Param1.fUse == DISUSE_REG_GEN64) && pDis->Param2.fUse == DISUSE_REG_DBG) 2561 2561 { 2562 rc = EMInterpretDRxRead(pVM, pVCpu, pRegFrame, pDis->Param1. base.reg_gen, pDis->Param2.base.reg_dbg);2562 rc = EMInterpretDRxRead(pVM, pVCpu, pRegFrame, pDis->Param1.Base.idxGenReg, pDis->Param2.Base.idxDbgReg); 2563 2563 } 2564 2564 else 2565 2565 if(pDis->Param1.fUse == DISUSE_REG_DBG && (pDis->Param2.fUse == DISUSE_REG_GEN32 || pDis->Param2.fUse == DISUSE_REG_GEN64)) 2566 2566 { 2567 rc = EMInterpretDRxWrite(pVM, pVCpu, pRegFrame, pDis->Param1. base.reg_dbg, pDis->Param2.base.reg_gen);2567 rc = EMInterpretDRxWrite(pVM, pVCpu, pRegFrame, pDis->Param1.Base.idxDbgReg, pDis->Param2.Base.idxGenReg); 2568 2568 } 2569 2569 else -
trunk/src/VBox/VMM/VMMAll/IOMAll.cpp
r41741 r41744 81 81 { 82 82 *pcbSize = 4; 83 DISFetchReg32(pRegFrame, pParam-> base.reg_gen, (uint32_t *)pu64Data);83 DISFetchReg32(pRegFrame, pParam->Base.idxGenReg, (uint32_t *)pu64Data); 84 84 return true; 85 85 } … … 88 88 { 89 89 *pcbSize = 2; 90 DISFetchReg16(pRegFrame, pParam-> base.reg_gen, (uint16_t *)pu64Data);90 DISFetchReg16(pRegFrame, pParam->Base.idxGenReg, (uint16_t *)pu64Data); 91 91 return true; 92 92 } … … 95 95 { 96 96 *pcbSize = 1; 97 DISFetchReg8(pRegFrame, pParam-> base.reg_gen, (uint8_t *)pu64Data);97 DISFetchReg8(pRegFrame, pParam->Base.idxGenReg, (uint8_t *)pu64Data); 98 98 return true; 99 99 } … … 101 101 Assert(pParam->fUse & DISUSE_REG_GEN64); 102 102 *pcbSize = 8; 103 DISFetchReg64(pRegFrame, pParam-> base.reg_gen, pu64Data);103 DISFetchReg64(pRegFrame, pParam->Base.idxGenReg, pu64Data); 104 104 return true; 105 105 } … … 137 137 { 138 138 *pcbSize = 2; 139 DISFetchRegSeg(pRegFrame, (DISSELREG)pParam-> base.reg_seg, (RTSEL *)pu64Data);139 DISFetchRegSeg(pRegFrame, (DISSELREG)pParam->Base.idxSegReg, (RTSEL *)pu64Data); 140 140 return true; 141 141 } /* Else - error. */ … … 169 169 if (pParam->fUse & DISUSE_REG_GEN32) 170 170 { 171 DISWriteReg32(pRegFrame, pParam-> base.reg_gen, (uint32_t)u64Data);171 DISWriteReg32(pRegFrame, pParam->Base.idxGenReg, (uint32_t)u64Data); 172 172 return true; 173 173 } … … 175 175 if (pParam->fUse & DISUSE_REG_GEN64) 176 176 { 177 DISWriteReg64(pRegFrame, pParam-> base.reg_gen, u64Data);177 DISWriteReg64(pRegFrame, pParam->Base.idxGenReg, u64Data); 178 178 return true; 179 179 } … … 181 181 if (pParam->fUse & DISUSE_REG_GEN16) 182 182 { 183 DISWriteReg16(pRegFrame, pParam-> base.reg_gen, (uint16_t)u64Data);183 DISWriteReg16(pRegFrame, pParam->Base.idxGenReg, (uint16_t)u64Data); 184 184 return true; 185 185 } … … 187 187 if (pParam->fUse & DISUSE_REG_GEN8) 188 188 { 189 DISWriteReg8(pRegFrame, pParam-> base.reg_gen, (uint8_t)u64Data);189 DISWriteReg8(pRegFrame, pParam->Base.idxGenReg, (uint8_t)u64Data); 190 190 return true; 191 191 } … … 193 193 if (pParam->fUse & DISUSE_REG_SEG) 194 194 { 195 DISWriteRegSeg(pRegFrame, (DISSELREG)pParam-> base.reg_seg, (RTSEL)u64Data);195 DISWriteRegSeg(pRegFrame, (DISSELREG)pParam->Base.idxSegReg, (RTSEL)u64Data); 196 196 return true; 197 197 } -
trunk/src/VBox/VMM/VMMAll/PGMAllPool.cpp
r41739 r41744 761 761 #endif 762 762 763 LogFlow(("Reused instr %RGv %d at %RGv param1.fUse=%llx param1.reg=%d\n", pRegFrame->rip, pDis->pCurInstr->uOpcode, pvFault, pDis->Param1.fUse, pDis->Param1. base.reg_gen));763 LogFlow(("Reused instr %RGv %d at %RGv param1.fUse=%llx param1.reg=%d\n", pRegFrame->rip, pDis->pCurInstr->uOpcode, pvFault, pDis->Param1.fUse, pDis->Param1.Base.idxGenReg)); 764 764 765 765 /* Non-supervisor mode write means it's used for something else. */ … … 806 806 if ( ( (pDis->Param1.fUse & DISUSE_REG_GEN32) 807 807 || (pDis->Param1.fUse & DISUSE_REG_GEN64)) 808 && (pDis->Param1. base.reg_gen== DISGREG_ESP))808 && (pDis->Param1.Base.idxGenReg == DISGREG_ESP)) 809 809 { 810 810 Log4(("pgmPoolMonitorIsReused: ESP\n")); -
trunk/src/VBox/VMM/VMMR3/EMRaw.cpp
r41739 r41744 994 994 //read 995 995 Assert(Cpu.Param2.fUse & DISUSE_REG_CR); 996 Assert(Cpu.Param2. base.reg_ctrl<= DISCREG_CR4);997 STAM_COUNTER_INC(&pStats->StatMovReadCR[Cpu.Param2. base.reg_ctrl]);996 Assert(Cpu.Param2.Base.idxCtrlReg <= DISCREG_CR4); 997 STAM_COUNTER_INC(&pStats->StatMovReadCR[Cpu.Param2.Base.idxCtrlReg]); 998 998 } 999 999 else … … 1001 1001 //write 1002 1002 Assert(Cpu.Param1.fUse & DISUSE_REG_CR); 1003 Assert(Cpu.Param1. base.reg_ctrl<= DISCREG_CR4);1004 STAM_COUNTER_INC(&pStats->StatMovWriteCR[Cpu.Param1. base.reg_ctrl]);1003 Assert(Cpu.Param1.Base.idxCtrlReg <= DISCREG_CR4); 1004 STAM_COUNTER_INC(&pStats->StatMovWriteCR[Cpu.Param1.Base.idxCtrlReg]); 1005 1005 } 1006 1006 break; -
trunk/src/VBox/VMM/VMMR3/HWACCM.cpp
r41741 r41744 1839 1839 { 1840 1840 pPatch->enmType = HWACCMTPRINSTR_WRITE_REG; 1841 pPatch->uSrcOperand = pDis->Param2. base.reg_gen;1841 pPatch->uSrcOperand = pDis->Param2.Base.idxGenReg; 1842 1842 } 1843 1843 else … … 1857 1857 RTGCPTR oldrip = pCtx->rip; 1858 1858 uint32_t oldcbOp = cbOp; 1859 uint32_t uMmioReg = pDis->Param1. base.reg_gen;1859 uint32_t uMmioReg = pDis->Param1.Base.idxGenReg; 1860 1860 1861 1861 /* read */ … … 1873 1873 && pDis->pCurInstr->uOpcode == OP_SHR 1874 1874 && pDis->Param1.fUse == DISUSE_REG_GEN32 1875 && pDis->Param1. base.reg_gen== uMmioReg1875 && pDis->Param1.Base.idxGenReg == uMmioReg 1876 1876 && pDis->Param2.fUse == DISUSE_IMMEDIATE8 1877 1877 && pDis->Param2.uValue == 4 … … 1890 1890 szInstr[1] = 0x0F; 1891 1891 szInstr[2] = 0x20; 1892 szInstr[3] = 0xC0 | pDis->Param1. base.reg_gen;1892 szInstr[3] = 0xC0 | pDis->Param1.Base.idxGenReg; 1893 1893 for (unsigned i = 4; i < pPatch->cbOp; i++) 1894 1894 szInstr[i] = 0x90; /* nop */ … … 1906 1906 { 1907 1907 pPatch->enmType = HWACCMTPRINSTR_READ; 1908 pPatch->uDstOperand = pDis->Param1. base.reg_gen;1908 pPatch->uDstOperand = pDis->Param1.Base.idxGenReg; 1909 1909 1910 1910 rc = PGMPhysSimpleWriteGCPtr(pVCpu, pCtx->rip, aVMMCall, sizeof(aVMMCall)); … … 2028 2028 * 2029 2029 */ 2030 bool fUsesEax = (pDis->Param2.fUse == DISUSE_REG_GEN32 && pDis->Param2. base.reg_gen== DISGREG_EAX);2030 bool fUsesEax = (pDis->Param2.fUse == DISUSE_REG_GEN32 && pDis->Param2.Base.idxGenReg == DISGREG_EAX); 2031 2031 2032 2032 aPatch[off++] = 0x51; /* push ecx */ … … 2041 2041 { 2042 2042 aPatch[off++] = 0x89; /* mov eax, src_reg */ 2043 aPatch[off++] = MAKE_MODRM(3, pDis->Param2. base.reg_gen, DISGREG_EAX);2043 aPatch[off++] = MAKE_MODRM(3, pDis->Param2.Base.idxGenReg, DISGREG_EAX); 2044 2044 } 2045 2045 } … … 2081 2081 Assert(pDis->Param1.fUse == DISUSE_REG_GEN32); 2082 2082 2083 if (pDis->Param1. base.reg_gen!= DISGREG_ECX)2083 if (pDis->Param1.Base.idxGenReg != DISGREG_ECX) 2084 2084 aPatch[off++] = 0x51; /* push ecx */ 2085 if (pDis->Param1. base.reg_gen!= DISGREG_EDX )2085 if (pDis->Param1.Base.idxGenReg != DISGREG_EDX ) 2086 2086 aPatch[off++] = 0x52; /* push edx */ 2087 if (pDis->Param1. base.reg_gen!= DISGREG_EAX)2087 if (pDis->Param1.Base.idxGenReg != DISGREG_EAX) 2088 2088 aPatch[off++] = 0x50; /* push eax */ 2089 2089 … … 2098 2098 aPatch[off++] = 0x32; 2099 2099 2100 if (pDis->Param1. base.reg_gen!= DISGREG_EAX)2100 if (pDis->Param1.Base.idxGenReg != DISGREG_EAX) 2101 2101 { 2102 2102 aPatch[off++] = 0x89; /* mov dst_reg, eax */ 2103 aPatch[off++] = MAKE_MODRM(3, DISGREG_EAX, pDis->Param1. base.reg_gen);2103 aPatch[off++] = MAKE_MODRM(3, DISGREG_EAX, pDis->Param1.Base.idxGenReg); 2104 2104 } 2105 2105 2106 if (pDis->Param1. base.reg_gen!= DISGREG_EAX)2106 if (pDis->Param1.Base.idxGenReg != DISGREG_EAX) 2107 2107 aPatch[off++] = 0x58; /* pop eax */ 2108 if (pDis->Param1. base.reg_gen!= DISGREG_EDX )2108 if (pDis->Param1.Base.idxGenReg != DISGREG_EDX ) 2109 2109 aPatch[off++] = 0x5A; /* pop edx */ 2110 if (pDis->Param1. base.reg_gen!= DISGREG_ECX)2110 if (pDis->Param1.Base.idxGenReg != DISGREG_ECX) 2111 2111 aPatch[off++] = 0x59; /* pop ecx */ 2112 2112 } -
trunk/src/VBox/VMM/VMMR3/PATM.cpp
r41741 r41744 1749 1749 /* mov ss, src? */ 1750 1750 if ( (pCpu->Param1.fUse & DISUSE_REG_SEG) 1751 && (pCpu->Param1. base.reg_seg == DISSELREG_SS))1751 && (pCpu->Param1.Base.idxSegReg == DISSELREG_SS)) 1752 1752 { 1753 1753 Log(("Force recompilation of next instruction for OP_MOV at %RRv\n", pCurInstrGC)); … … 1758 1758 else 1759 1759 if ( (pCpu->Param2.fUse & DISUSE_REG_SEG) 1760 && (pCpu->Param2. base.reg_seg == USE_REG_SS)1760 && (pCpu->Param2.Base.idxSegReg == USE_REG_SS) 1761 1761 && (pCpu->Param1.fUse & (DISUSE_REG_GEN32|DISUSE_REG_GEN16))) /** @todo memory operand must in theory be handled too */ 1762 1762 { -
trunk/src/VBox/VMM/VMMR3/PATMPatch.cpp
r41741 r41744 1167 1167 Assert(pCpu->Param2.fUse & DISUSE_REG_GEN32); 1168 1168 1169 dbgreg = pCpu->Param1. base.reg_dbg;1170 reg = pCpu->Param2. base.reg_gen;1169 dbgreg = pCpu->Param1.Base.idxDbgReg; 1170 reg = pCpu->Param2.Base.idxGenReg; 1171 1171 } 1172 1172 else … … 1177 1177 1178 1178 pPB[0] = 0x8B; // mov GPR, disp32 1179 reg = pCpu->Param1. base.reg_gen;1180 dbgreg = pCpu->Param2. base.reg_dbg;1179 reg = pCpu->Param1.Base.idxGenReg; 1180 dbgreg = pCpu->Param2.Base.idxDbgReg; 1181 1181 } 1182 1182 … … 1214 1214 // mov CRx, GPR 1215 1215 pPB[0] = 0x89; //mov disp32, GPR 1216 ctrlreg = pCpu->Param1. base.reg_ctrl;1217 reg = pCpu->Param2. base.reg_gen;1216 ctrlreg = pCpu->Param1.Base.idxCtrlReg; 1217 reg = pCpu->Param2.Base.idxGenReg; 1218 1218 Assert(pCpu->Param1.fUse & DISUSE_REG_CR); 1219 1219 Assert(pCpu->Param2.fUse & DISUSE_REG_GEN32); … … 1226 1226 1227 1227 pPB[0] = 0x8B; // mov GPR, disp32 1228 reg = pCpu->Param1. base.reg_gen;1229 ctrlreg = pCpu->Param2. base.reg_ctrl;1228 reg = pCpu->Param1.Base.idxGenReg; 1229 ctrlreg = pCpu->Param2.Base.idxCtrlReg; 1230 1230 } 1231 1231 … … 1292 1292 if (pCpu->fPrefix & DISPREFIX_OPSIZE) 1293 1293 pPB[offset++] = 0x66; /* size override -> 16 bits pop */ 1294 pPB[offset++] = 0x58 + pCpu->Param1. base.reg_gen;1294 pPB[offset++] = 0x58 + pCpu->Param1.Base.idxGenReg; 1295 1295 PATCHGEN_EPILOG(pPatch, offset); 1296 1296 … … 1335 1335 pPB[offset++] = 0x8B; // mov destreg, CPUMCTX.tr/ldtr 1336 1336 /* Modify REG part according to destination of original instruction */ 1337 pPB[offset++] = MAKE_MODRM(0, pCpu->Param1. base.reg_gen, 5);1337 pPB[offset++] = MAKE_MODRM(0, pCpu->Param1.Base.idxGenReg, 5); 1338 1338 if (pCpu->pCurInstr->uOpcode == OP_STR) 1339 1339 {
Note:
See TracChangeset
for help on using the changeset viewer.