Changeset 41739 in vbox for trunk/src/VBox/VMM
- Timestamp:
- Jun 15, 2012 1:31:29 AM (13 years ago)
- Location:
- trunk/src/VBox/VMM
- Files:
-
- 15 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/VMMAll/EMAll.cpp
r41737 r41739 809 809 810 810 /* Source to make DISQueryParamVal read the register value - ugly hack */ 811 int rc = DISQueryParamVal(pRegFrame, pDis, &pDis-> param1, ¶m1, DISQPVWHICH_SRC);811 int rc = DISQueryParamVal(pRegFrame, pDis, &pDis->Param1, ¶m1, DISQPVWHICH_SRC); 812 812 if(RT_FAILURE(rc)) 813 813 return VERR_EM_INTERPRETER; 814 814 815 rc = DISQueryParamVal(pRegFrame, pDis, &pDis-> param2, ¶m2, DISQPVWHICH_SRC);815 rc = DISQueryParamVal(pRegFrame, pDis, &pDis->Param2, ¶m2, DISQPVWHICH_SRC); 816 816 if(RT_FAILURE(rc)) 817 817 return VERR_EM_INTERPRETER; … … 826 826 uint64_t valpar1, valpar2; 827 827 828 AssertReturn(pDis-> param1.cb == pDis->param2.cb, VERR_EM_INTERPRETER);828 AssertReturn(pDis->Param1.cb == pDis->Param2.cb, VERR_EM_INTERPRETER); 829 829 switch(param1.type) 830 830 { … … 835 835 case DISQPV_TYPE_ADDRESS: 836 836 pParam1 = (RTGCPTR)param1.val.val64; 837 pParam1 = emConvertToFlatAddr(pVM, pRegFrame, pDis, &pDis-> param1, pParam1);837 pParam1 = emConvertToFlatAddr(pVM, pRegFrame, pDis, &pDis->Param1, pParam1); 838 838 EM_ASSERT_FAULT_RETURN(pParam1 == pvFault, VERR_EM_INTERPRETER); 839 839 rc = emRamRead(pVM, pVCpu, pRegFrame, &valpar1, pParam1, param1.size); … … 854 854 case DISQPV_TYPE_ADDRESS: 855 855 pParam2 = (RTGCPTR)param2.val.val64; 856 pParam2 = emConvertToFlatAddr(pVM, pRegFrame, pDis, &pDis-> param2, pParam2);856 pParam2 = emConvertToFlatAddr(pVM, pRegFrame, pDis, &pDis->Param2, pParam2); 857 857 EM_ASSERT_FAULT_RETURN(pParam2 == pvFault, VERR_EM_INTERPRETER); 858 858 rc = emRamRead(pVM, pVCpu, pRegFrame, &valpar2, pParam2, param2.size); … … 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.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; 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.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; 911 911 default: AssertFailedReturn(VERR_EM_INTERPRETER); 912 912 } … … 943 943 NOREF(pvFault); 944 944 945 int rc = DISQueryParamVal(pRegFrame, pDis, &pDis-> param1, ¶m1, DISQPVWHICH_DST);945 int rc = DISQueryParamVal(pRegFrame, pDis, &pDis->Param1, ¶m1, DISQPVWHICH_DST); 946 946 if(RT_FAILURE(rc)) 947 947 return VERR_EM_INTERPRETER; … … 959 959 { 960 960 pParam1 = (RTGCPTR)param1.val.val64; 961 pParam1 = emConvertToFlatAddr(pVM, pRegFrame, pDis, &pDis-> param1, pParam1);961 pParam1 = emConvertToFlatAddr(pVM, pRegFrame, pDis, &pDis->Param1, pParam1); 962 962 #ifdef IN_RC 963 963 /* Safety check (in theory it could cross a page boundary and fault there though) */ … … 1013 1013 NOREF(pvFault); 1014 1014 1015 int rc = DISQueryParamVal(pRegFrame, pDis, &pDis-> param1, ¶m1, DISQPVWHICH_DST);1015 int rc = DISQueryParamVal(pRegFrame, pDis, &pDis->Param1, ¶m1, DISQPVWHICH_DST); 1016 1016 if(RT_FAILURE(rc)) 1017 1017 return VERR_EM_INTERPRETER; … … 1049 1049 /* pop [esp+xx] uses esp after the actual pop! */ 1050 1050 AssertCompile(DISGREG_ESP == DISGREG_SP); 1051 if ( (pDis-> param1.fUse & DISUSE_BASE)1052 && (pDis-> param1.fUse & (DISUSE_REG_GEN16|DISUSE_REG_GEN32))1053 && pDis-> param1.base.reg_gen == DISGREG_ESP1051 if ( (pDis->Param1.fUse & DISUSE_BASE) 1052 && (pDis->Param1.fUse & (DISUSE_REG_GEN16|DISUSE_REG_GEN32)) 1053 && pDis->Param1.base.reg_gen == DISGREG_ESP 1054 1054 ) 1055 1055 pParam1 = (RTGCPTR)((RTGCUINTPTR)pParam1 + param1.size); 1056 1056 1057 pParam1 = emConvertToFlatAddr(pVM, pRegFrame, pDis, &pDis-> param1, pParam1);1057 pParam1 = emConvertToFlatAddr(pVM, pRegFrame, pDis, &pDis->Param1, pParam1); 1058 1058 EM_ASSERT_FAULT_RETURN(pParam1 == pvFault || (RTGCPTR)pRegFrame->esp == pvFault, VERR_EM_INTERPRETER); 1059 1059 rc = emRamWrite(pVM, pVCpu, pRegFrame, pParam1, &valpar1, param1.size); … … 1095 1095 NOREF(pvFault); 1096 1096 1097 int rc = DISQueryParamVal(pRegFrame, pDis, &pDis-> param1, ¶m1, DISQPVWHICH_DST);1097 int rc = DISQueryParamVal(pRegFrame, pDis, &pDis->Param1, ¶m1, DISQPVWHICH_DST); 1098 1098 if(RT_FAILURE(rc)) 1099 1099 return VERR_EM_INTERPRETER; 1100 1100 1101 rc = DISQueryParamVal(pRegFrame, pDis, &pDis-> param2, ¶m2, DISQPVWHICH_SRC);1101 rc = DISQueryParamVal(pRegFrame, pDis, &pDis->Param2, ¶m2, DISQPVWHICH_SRC); 1102 1102 if(RT_FAILURE(rc)) 1103 1103 return VERR_EM_INTERPRETER; … … 1112 1112 uint64_t valpar1, valpar2; 1113 1113 1114 if (pDis-> param1.cb != pDis->param2.cb)1114 if (pDis->Param1.cb != pDis->Param2.cb) 1115 1115 { 1116 if (pDis-> param1.cb < pDis->param2.cb)1116 if (pDis->Param1.cb < pDis->Param2.cb) 1117 1117 { 1118 AssertMsgFailed(("%s at %RGv parameter mismatch %d vs %d!!\n", emGetMnemonic(pDis), (RTGCPTR)pRegFrame->rip, pDis-> param1.cb, pDis->param2.cb)); /* should never happen! */1118 AssertMsgFailed(("%s at %RGv parameter mismatch %d vs %d!!\n", emGetMnemonic(pDis), (RTGCPTR)pRegFrame->rip, pDis->Param1.cb, pDis->Param2.cb)); /* should never happen! */ 1119 1119 return VERR_EM_INTERPRETER; 1120 1120 } 1121 1121 /* Or %Ev, Ib -> just a hack to save some space; the data width of the 1st parameter determines the real width */ 1122 pDis-> param2.cb = pDis->param1.cb;1122 pDis->Param2.cb = pDis->Param1.cb; 1123 1123 param2.size = param1.size; 1124 1124 } … … 1128 1128 { 1129 1129 pParam1 = (RTGCPTR)param1.val.val64; 1130 pParam1 = emConvertToFlatAddr(pVM, pRegFrame, pDis, &pDis-> param1, pParam1);1130 pParam1 = emConvertToFlatAddr(pVM, pRegFrame, pDis, &pDis->Param1, pParam1); 1131 1131 EM_ASSERT_FAULT_RETURN(pParam1 == pvFault, VERR_EM_INTERPRETER); 1132 1132 rc = emRamRead(pVM, pVCpu, pRegFrame, &valpar1, pParam1, param1.size); … … 1193 1193 1194 1194 #if HC_ARCH_BITS == 32 && !defined(VBOX_WITH_HYBRID_32BIT_KERNEL_IN_R0) 1195 Assert(pDis-> param1.cb <= 4);1196 #endif 1197 1198 int rc = DISQueryParamVal(pRegFrame, pDis, &pDis-> param1, ¶m1, DISQPVWHICH_DST);1195 Assert(pDis->Param1.cb <= 4); 1196 #endif 1197 1198 int rc = DISQueryParamVal(pRegFrame, pDis, &pDis->Param1, ¶m1, DISQPVWHICH_DST); 1199 1199 if(RT_FAILURE(rc)) 1200 1200 return VERR_EM_INTERPRETER; 1201 1201 1202 rc = DISQueryParamVal(pRegFrame, pDis, &pDis-> param2, ¶m2, DISQPVWHICH_SRC);1202 rc = DISQueryParamVal(pRegFrame, pDis, &pDis->Param2, ¶m2, DISQPVWHICH_SRC); 1203 1203 if(RT_FAILURE(rc)) 1204 1204 return VERR_EM_INTERPRETER; 1205 1205 1206 if (pDis-> param1.cb != pDis->param2.cb)1207 { 1208 AssertMsgReturn(pDis-> param1.cb >= pDis->param2.cb, /* should never happen! */1209 ("%s at %RGv parameter mismatch %d vs %d!!\n", emGetMnemonic(pDis), (RTGCPTR)pRegFrame->rip, pDis-> param1.cb, pDis->param2.cb),1206 if (pDis->Param1.cb != pDis->Param2.cb) 1207 { 1208 AssertMsgReturn(pDis->Param1.cb >= pDis->Param2.cb, /* should never happen! */ 1209 ("%s at %RGv parameter mismatch %d vs %d!!\n", emGetMnemonic(pDis), (RTGCPTR)pRegFrame->rip, pDis->Param1.cb, pDis->Param2.cb), 1210 1210 VERR_EM_INTERPRETER); 1211 1211 1212 1212 /* Or %Ev, Ib -> just a hack to save some space; the data width of the 1st parameter determines the real width */ 1213 pDis-> param2.cb = pDis->param1.cb;1213 pDis->Param2.cb = pDis->Param1.cb; 1214 1214 param2.size = param1.size; 1215 1215 } … … 1230 1230 1231 1231 RTGCPTR GCPtrPar1 = param1.val.val64; 1232 GCPtrPar1 = emConvertToFlatAddr(pVM, pRegFrame, pDis, &pDis-> param1, GCPtrPar1);1232 GCPtrPar1 = emConvertToFlatAddr(pVM, pRegFrame, pDis, &pDis->Param1, GCPtrPar1); 1233 1233 PGMPAGEMAPLOCK Lock; 1234 1234 rc = PGMPhysGCPtr2CCPtr(pVCpu, GCPtrPar1, &pvParam1, &Lock); … … 1236 1236 1237 1237 /* Try emulate it with a one-shot #PF handler in place. (RC) */ 1238 Log2(("%s %RGv imm%d=%RX64\n", emGetMnemonic(pDis), GCPtrPar1, pDis-> param2.cb*8, ValPar2));1238 Log2(("%s %RGv imm%d=%RX64\n", emGetMnemonic(pDis), GCPtrPar1, pDis->Param2.cb*8, ValPar2)); 1239 1239 1240 1240 RTGCUINTREG32 eflags = 0; 1241 rc = pfnEmulate(pvParam1, ValPar2, pDis-> param2.cb, &eflags);1241 rc = pfnEmulate(pvParam1, ValPar2, pDis->Param2.cb, &eflags); 1242 1242 PGMPhysReleasePageMappingLock(pVM, &Lock); 1243 1243 if (RT_FAILURE(rc)) 1244 1244 { 1245 Log(("%s %RGv imm%d=%RX64-> emulation failed due to page fault!\n", emGetMnemonic(pDis), GCPtrPar1, pDis-> param2.cb*8, ValPar2));1245 Log(("%s %RGv imm%d=%RX64-> emulation failed due to page fault!\n", emGetMnemonic(pDis), GCPtrPar1, pDis->Param2.cb*8, ValPar2)); 1246 1246 return VERR_EM_INTERPRETER; 1247 1247 } … … 1264 1264 NOREF(pvFault); 1265 1265 DISQPVPARAMVAL param1, param2; 1266 int rc = DISQueryParamVal(pRegFrame, pDis, &pDis-> param1, ¶m1, DISQPVWHICH_DST);1266 int rc = DISQueryParamVal(pRegFrame, pDis, &pDis->Param1, ¶m1, DISQPVWHICH_DST); 1267 1267 if(RT_FAILURE(rc)) 1268 1268 return VERR_EM_INTERPRETER; 1269 1269 1270 rc = DISQueryParamVal(pRegFrame, pDis, &pDis-> param2, ¶m2, DISQPVWHICH_SRC);1270 rc = DISQueryParamVal(pRegFrame, pDis, &pDis->Param2, ¶m2, DISQPVWHICH_SRC); 1271 1271 if(RT_FAILURE(rc)) 1272 1272 return VERR_EM_INTERPRETER; … … 1281 1281 uint64_t valpar1, valpar2; 1282 1282 1283 if (pDis-> param1.cb != pDis->param2.cb)1283 if (pDis->Param1.cb != pDis->Param2.cb) 1284 1284 { 1285 if (pDis-> param1.cb < pDis->param2.cb)1285 if (pDis->Param1.cb < pDis->Param2.cb) 1286 1286 { 1287 AssertMsgFailed(("%s at %RGv parameter mismatch %d vs %d!!\n", emGetMnemonic(pDis), (RTGCPTR)pRegFrame->rip, pDis-> param1.cb, pDis->param2.cb)); /* should never happen! */1287 AssertMsgFailed(("%s at %RGv parameter mismatch %d vs %d!!\n", emGetMnemonic(pDis), (RTGCPTR)pRegFrame->rip, pDis->Param1.cb, pDis->Param2.cb)); /* should never happen! */ 1288 1288 return VERR_EM_INTERPRETER; 1289 1289 } 1290 1290 /* Or %Ev, Ib -> just a hack to save some space; the data width of the 1st parameter determines the real width */ 1291 pDis-> param2.cb = pDis->param1.cb;1291 pDis->Param2.cb = pDis->Param1.cb; 1292 1292 param2.size = param1.size; 1293 1293 } … … 1297 1297 { 1298 1298 pParam1 = (RTGCPTR)param1.val.val64; 1299 pParam1 = emConvertToFlatAddr(pVM, pRegFrame, pDis, &pDis-> param1, pParam1);1299 pParam1 = emConvertToFlatAddr(pVM, pRegFrame, pDis, &pDis->Param1, pParam1); 1300 1300 EM_ASSERT_FAULT_RETURN(pParam1 == pvFault, VERR_EM_INTERPRETER); 1301 1301 rc = emRamRead(pVM, pVCpu, pRegFrame, &valpar1, pParam1, param1.size); … … 1368 1368 { 1369 1369 DISQPVPARAMVAL param1, param2; 1370 int rc = DISQueryParamVal(pRegFrame, pDis, &pDis-> param1, ¶m1, DISQPVWHICH_DST);1370 int rc = DISQueryParamVal(pRegFrame, pDis, &pDis->Param1, ¶m1, DISQPVWHICH_DST); 1371 1371 if(RT_FAILURE(rc)) 1372 1372 return VERR_EM_INTERPRETER; 1373 1373 1374 rc = DISQueryParamVal(pRegFrame, pDis, &pDis-> param2, ¶m2, DISQPVWHICH_SRC);1374 rc = DISQueryParamVal(pRegFrame, pDis, &pDis->Param2, ¶m2, DISQPVWHICH_SRC); 1375 1375 if(RT_FAILURE(rc)) 1376 1376 return VERR_EM_INTERPRETER; … … 1391 1391 1392 1392 pParam1 = (RTGCPTR)param1.val.val64; 1393 pParam1 = emConvertToFlatAddr(pVM, pRegFrame, pDis, &pDis-> param1, pParam1);1393 pParam1 = emConvertToFlatAddr(pVM, pRegFrame, pDis, &pDis->Param1, pParam1); 1394 1394 1395 1395 /* Register or immediate data */ … … 1450 1450 1451 1451 DISQPVPARAMVAL param1, param2; 1452 int rc = DISQueryParamVal(pRegFrame, pDis, &pDis-> param1, ¶m1, DISQPVWHICH_DST);1452 int rc = DISQueryParamVal(pRegFrame, pDis, &pDis->Param1, ¶m1, DISQPVWHICH_DST); 1453 1453 if(RT_FAILURE(rc)) 1454 1454 return VERR_EM_INTERPRETER; 1455 1455 1456 rc = DISQueryParamVal(pRegFrame, pDis, &pDis-> param2, ¶m2, DISQPVWHICH_SRC);1456 rc = DISQueryParamVal(pRegFrame, pDis, &pDis->Param2, ¶m2, DISQPVWHICH_SRC); 1457 1457 if(RT_FAILURE(rc)) 1458 1458 return VERR_EM_INTERPRETER; … … 1471 1471 ValPar2 &= 7; 1472 1472 1473 GCPtrPar1 = emConvertToFlatAddr(pVM, pRegFrame, pDis, &pDis-> param1, GCPtrPar1);1473 GCPtrPar1 = emConvertToFlatAddr(pVM, pRegFrame, pDis, &pDis->Param1, GCPtrPar1); 1474 1474 #ifdef IN_RC 1475 1475 Assert(TRPMHasTrap(pVCpu)); … … 1490 1490 { 1491 1491 Log(("emInterpretLockBitTest %s: %RGv imm%d=%RX64 -> emulation failed due to page fault!\n", 1492 emGetMnemonic(pDis), GCPtrPar1, pDis-> param2.cb*8, ValPar2));1492 emGetMnemonic(pDis), GCPtrPar1, pDis->Param2.cb*8, ValPar2)); 1493 1493 return VERR_EM_INTERPRETER; 1494 1494 } … … 1512 1512 NOREF(pvFault); 1513 1513 DISQPVPARAMVAL param1, param2; 1514 int rc = DISQueryParamVal(pRegFrame, pDis, &pDis-> param1, ¶m1, DISQPVWHICH_DST);1514 int rc = DISQueryParamVal(pRegFrame, pDis, &pDis->Param1, ¶m1, DISQPVWHICH_DST); 1515 1515 if(RT_FAILURE(rc)) 1516 1516 return VERR_EM_INTERPRETER; 1517 1517 1518 rc = DISQueryParamVal(pRegFrame, pDis, &pDis-> param2, ¶m2, DISQPVWHICH_SRC);1518 rc = DISQueryParamVal(pRegFrame, pDis, &pDis->Param2, ¶m2, DISQPVWHICH_SRC); 1519 1519 if(RT_FAILURE(rc)) 1520 1520 return VERR_EM_INTERPRETER; … … 1542 1542 case DISQPV_TYPE_ADDRESS: 1543 1543 pDest = (RTGCPTR)param1.val.val64; 1544 pDest = emConvertToFlatAddr(pVM, pRegFrame, pDis, &pDis-> param1, pDest);1544 pDest = emConvertToFlatAddr(pVM, pRegFrame, pDis, &pDis->Param1, pDest); 1545 1545 break; 1546 1546 … … 1590 1590 case DISQPV_TYPE_ADDRESS: 1591 1591 pSrc = (RTGCPTR)param2.val.val64; 1592 pSrc = emConvertToFlatAddr(pVM, pRegFrame, pDis, &pDis-> param2, pSrc);1592 pSrc = emConvertToFlatAddr(pVM, pRegFrame, pDis, &pDis->Param2, pSrc); 1593 1593 break; 1594 1594 … … 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.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; 1615 1615 default: 1616 1616 return VERR_EM_INTERPRETER; … … 1803 1803 1804 1804 #if HC_ARCH_BITS == 32 && !defined(VBOX_WITH_HYBRID_32BIT_KERNEL_IN_R0) 1805 Assert(pDis-> param1.cb <= 4);1805 Assert(pDis->Param1.cb <= 4); 1806 1806 #endif 1807 1807 1808 1808 /* Source to make DISQueryParamVal read the register value - ugly hack */ 1809 int rc = DISQueryParamVal(pRegFrame, pDis, &pDis-> param1, ¶m1, DISQPVWHICH_SRC);1809 int rc = DISQueryParamVal(pRegFrame, pDis, &pDis->Param1, ¶m1, DISQPVWHICH_SRC); 1810 1810 if(RT_FAILURE(rc)) 1811 1811 return VERR_EM_INTERPRETER; 1812 1812 1813 rc = DISQueryParamVal(pRegFrame, pDis, &pDis-> param2, ¶m2, DISQPVWHICH_SRC);1813 rc = DISQueryParamVal(pRegFrame, pDis, &pDis->Param2, ¶m2, DISQPVWHICH_SRC); 1814 1814 if(RT_FAILURE(rc)) 1815 1815 return VERR_EM_INTERPRETER; … … 1831 1831 uint64_t eflags; 1832 1832 1833 AssertReturn(pDis-> param1.cb == pDis->param2.cb, VERR_EM_INTERPRETER);1833 AssertReturn(pDis->Param1.cb == pDis->Param2.cb, VERR_EM_INTERPRETER); 1834 1834 switch(param1.type) 1835 1835 { 1836 1836 case DISQPV_TYPE_ADDRESS: 1837 1837 GCPtrPar1 = param1.val.val64; 1838 GCPtrPar1 = emConvertToFlatAddr(pVM, pRegFrame, pDis, &pDis-> param1, GCPtrPar1);1838 GCPtrPar1 = emConvertToFlatAddr(pVM, pRegFrame, pDis, &pDis->Param1, GCPtrPar1); 1839 1839 1840 1840 rc = PGMPhysGCPtr2CCPtr(pVCpu, GCPtrPar1, &pvParam1, &Lock); … … 1849 1849 1850 1850 if (pDis->fPrefix & DISPREFIX_LOCK) 1851 eflags = EMEmulateLockCmpXchg(pvParam1, &pRegFrame->rax, valpar, pDis-> param2.cb);1851 eflags = EMEmulateLockCmpXchg(pvParam1, &pRegFrame->rax, valpar, pDis->Param2.cb); 1852 1852 else 1853 eflags = EMEmulateCmpXchg(pvParam1, &pRegFrame->rax, valpar, pDis-> param2.cb);1853 eflags = EMEmulateCmpXchg(pvParam1, &pRegFrame->rax, valpar, pDis->Param2.cb); 1854 1854 1855 1855 LogFlow(("%s %RGv rax=%RX64 %RX64 ZF=%d\n", emGetMnemonic(pDis), GCPtrPar1, pRegFrame->rax, valpar, !!(eflags & X86_EFL_ZF))); … … 1875 1875 1876 1876 /* Source to make DISQueryParamVal read the register value - ugly hack */ 1877 int rc = DISQueryParamVal(pRegFrame, pDis, &pDis-> param1, ¶m1, DISQPVWHICH_SRC);1877 int rc = DISQueryParamVal(pRegFrame, pDis, &pDis->Param1, ¶m1, DISQPVWHICH_SRC); 1878 1878 if(RT_FAILURE(rc)) 1879 1879 return VERR_EM_INTERPRETER; … … 1884 1884 PGMPAGEMAPLOCK Lock; 1885 1885 1886 AssertReturn(pDis-> param1.cb == 8, VERR_EM_INTERPRETER);1886 AssertReturn(pDis->Param1.cb == 8, VERR_EM_INTERPRETER); 1887 1887 switch(param1.type) 1888 1888 { 1889 1889 case DISQPV_TYPE_ADDRESS: 1890 1890 GCPtrPar1 = param1.val.val64; 1891 GCPtrPar1 = emConvertToFlatAddr(pVM, pRegFrame, pDis, &pDis-> param1, GCPtrPar1);1891 GCPtrPar1 = emConvertToFlatAddr(pVM, pRegFrame, pDis, &pDis->Param1, GCPtrPar1); 1892 1892 1893 1893 rc = PGMPhysGCPtr2CCPtr(pVCpu, GCPtrPar1, &pvParam1, &Lock); … … 1931 1931 1932 1932 /* Source to make DISQueryParamVal read the register value - ugly hack */ 1933 int rc = DISQueryParamVal(pRegFrame, pDis, &pDis-> param1, ¶m1, DISQPVWHICH_SRC);1933 int rc = DISQueryParamVal(pRegFrame, pDis, &pDis->Param1, ¶m1, DISQPVWHICH_SRC); 1934 1934 if(RT_FAILURE(rc)) 1935 1935 return VERR_EM_INTERPRETER; 1936 1936 1937 rc = DISQueryParamRegPtr(pRegFrame, pDis, &pDis-> param2, &pvParamReg2, &cbParamReg2);1937 rc = DISQueryParamRegPtr(pRegFrame, pDis, &pDis->Param2, &pvParamReg2, &cbParamReg2); 1938 1938 Assert(cbParamReg2 <= 4); 1939 1939 if(RT_FAILURE(rc)) … … 1951 1951 PGMPAGEMAPLOCK Lock; 1952 1952 1953 AssertReturn(pDis-> param1.cb == pDis->param2.cb, VERR_EM_INTERPRETER);1953 AssertReturn(pDis->Param1.cb == pDis->Param2.cb, VERR_EM_INTERPRETER); 1954 1954 switch(param1.type) 1955 1955 { 1956 1956 case DISQPV_TYPE_ADDRESS: 1957 GCPtrPar1 = emConvertToFlatAddr(pVM, pRegFrame, pDis, &pDis-> param1, (RTRCUINTPTR)param1.val.val64);1957 GCPtrPar1 = emConvertToFlatAddr(pVM, pRegFrame, pDis, &pDis->Param1, (RTRCUINTPTR)param1.val.val64); 1958 1958 #ifdef IN_RC 1959 1959 EM_ASSERT_FAULT_RETURN(GCPtrPar1 == pvFault, VERR_EM_INTERPRETER); … … 2054 2054 NOREF(pvFault); NOREF(pVM); NOREF(pcbSize); 2055 2055 2056 VBOXSTRICTRC rc = DISQueryParamVal(pRegFrame, pDis, &pDis-> param1, ¶m1, DISQPVWHICH_SRC);2056 VBOXSTRICTRC rc = DISQueryParamVal(pRegFrame, pDis, &pDis->Param1, ¶m1, DISQPVWHICH_SRC); 2057 2057 if(RT_FAILURE(rc)) 2058 2058 return VERR_EM_INTERPRETER; … … 2389 2389 NOREF(pvFault); NOREF(pcbSize); 2390 2390 2391 int rc = DISQueryParamVal(pRegFrame, pDis, &pDis-> param1, ¶m1, DISQPVWHICH_SRC);2391 int rc = DISQueryParamVal(pRegFrame, pDis, &pDis->Param1, ¶m1, DISQPVWHICH_SRC); 2392 2392 if(RT_FAILURE(rc)) 2393 2393 return VERR_EM_INTERPRETER; … … 2419 2419 uint64_t cr0 = CPUMGetGuestCR0(pVCpu); 2420 2420 2421 int rc = DISQueryParamVal(pRegFrame, pDis, &pDis-> param1, ¶m1, DISQPVWHICH_SRC);2421 int rc = DISQueryParamVal(pRegFrame, pDis, &pDis->Param1, ¶m1, DISQPVWHICH_SRC); 2422 2422 if(RT_FAILURE(rc)) 2423 2423 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.reg_gen, cr0)); 2431 rc = DISWriteReg16(pRegFrame, pDis->Param1.base.reg_gen, cr0); 2432 2432 break; 2433 2433 … … 2441 2441 2442 2442 pParam1 = (RTGCPTR)param1.val.val64; 2443 pParam1 = emConvertToFlatAddr(pVM, pRegFrame, pDis, &pDis-> param1, pParam1);2443 pParam1 = emConvertToFlatAddr(pVM, pRegFrame, pDis, &pDis->Param1, pParam1); 2444 2444 LogFlow(("emInterpretSmsw %RGv <- cr0 (%x)\n", pParam1, cr0)); 2445 2445 … … 2468 2468 { 2469 2469 NOREF(pvFault); NOREF(pcbSize); 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);2472 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);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); 2472 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); 2475 2475 2476 2476 AssertMsgFailedReturn(("Unexpected control register move\n"), VERR_EM_INTERPRETER); … … 2558 2558 NOREF(pvFault); NOREF(pcbSize); 2559 2559 2560 if((pDis-> param1.fUse == DISUSE_REG_GEN32 || pDis->param1.fUse == DISUSE_REG_GEN64) && pDis->param2.fUse == DISUSE_REG_DBG)2561 { 2562 rc = EMInterpretDRxRead(pVM, pVCpu, pRegFrame, pDis-> param1.base.reg_gen, pDis->param2.base.reg_dbg);2560 if((pDis->Param1.fUse == DISUSE_REG_GEN32 || pDis->Param1.fUse == DISUSE_REG_GEN64) && pDis->Param2.fUse == DISUSE_REG_DBG) 2561 { 2562 rc = EMInterpretDRxRead(pVM, pVCpu, pRegFrame, pDis->Param1.base.reg_gen, pDis->Param2.base.reg_dbg); 2563 2563 } 2564 2564 else 2565 if(pDis-> param1.fUse == DISUSE_REG_DBG && (pDis->param2.fUse == DISUSE_REG_GEN32 || pDis->param2.fUse == DISUSE_REG_GEN64))2566 { 2567 rc = EMInterpretDRxWrite(pVM, pVCpu, pRegFrame, pDis-> param1.base.reg_dbg, pDis->param2.base.reg_gen);2565 if(pDis->Param1.fUse == DISUSE_REG_DBG && (pDis->Param2.fUse == DISUSE_REG_GEN32 || pDis->Param2.fUse == DISUSE_REG_GEN64)) 2566 { 2567 rc = EMInterpretDRxWrite(pVM, pVCpu, pRegFrame, pDis->Param1.base.reg_dbg, pDis->Param2.base.reg_gen); 2568 2568 } 2569 2569 else … … 2583 2583 NOREF(pVM); NOREF(pvFault); NOREF(pcbSize); 2584 2584 2585 int rc = DISQueryParamVal(pRegFrame, pDis, &pDis-> param1, ¶m1, DISQPVWHICH_SRC);2585 int rc = DISQueryParamVal(pRegFrame, pDis, &pDis->Param1, ¶m1, DISQPVWHICH_SRC); 2586 2586 if(RT_FAILURE(rc)) 2587 2587 return VERR_EM_INTERPRETER; … … 2637 2637 AssertReturn(CPUMIsGuestInRealMode(pVCpu), VERR_EM_INTERPRETER); 2638 2638 2639 int rc = DISQueryParamVal(pRegFrame, pDis, &pDis-> param1, ¶m1, DISQPVWHICH_SRC);2639 int rc = DISQueryParamVal(pRegFrame, pDis, &pDis->Param1, ¶m1, DISQPVWHICH_SRC); 2640 2640 if(RT_FAILURE(rc)) 2641 2641 return VERR_EM_INTERPRETER; … … 2644 2644 { 2645 2645 case DISQPV_TYPE_ADDRESS: 2646 pParam1 = emConvertToFlatAddr(pVM, pRegFrame, pDis, &pDis-> param1, param1.val.val16);2646 pParam1 = emConvertToFlatAddr(pVM, pRegFrame, pDis, &pDis->Param1, param1.val.val16); 2647 2647 break; 2648 2648 … … 3141 3141 * Whitelisted instructions are safe. 3142 3142 */ 3143 if ( pDis-> param1.cb > 43143 if ( pDis->Param1.cb > 4 3144 3144 && CPUMIsGuestIn64BitCode(pVCpu, pRegFrame)) 3145 3145 { -
trunk/src/VBox/VMM/VMMAll/IOMAll.cpp
r41730 r41739 958 958 uint64_t uPort = 0; 959 959 unsigned cbSize = 0; 960 bool fRc = iomGetRegImmData(pCpu, &pCpu-> param2, pRegFrame, &uPort, &cbSize);960 bool fRc = iomGetRegImmData(pCpu, &pCpu->Param2, pRegFrame, &uPort, &cbSize); 961 961 AssertMsg(fRc, ("Failed to get reg/imm port number!\n")); NOREF(fRc); 962 962 963 cbSize = DISGetParamSize(pCpu, &pCpu-> param1);963 cbSize = DISGetParamSize(pCpu, &pCpu->Param1); 964 964 Assert(cbSize > 0); 965 965 VBOXSTRICTRC rcStrict = IOMInterpretCheckPortIOAccess(pVM, pRegFrame, uPort, cbSize); … … 976 976 * Store the result in the AL|AX|EAX register. 977 977 */ 978 fRc = iomSaveDataToReg(pCpu, &pCpu-> param1, pRegFrame, u32Data);978 fRc = iomSaveDataToReg(pCpu, &pCpu->Param1, pRegFrame, u32Data); 979 979 AssertMsg(fRc, ("Failed to store register value!\n")); NOREF(fRc); 980 980 } … … 1018 1018 uint64_t uPort = 0; 1019 1019 unsigned cbSize = 0; 1020 bool fRc = iomGetRegImmData(pCpu, &pCpu-> param1, pRegFrame, &uPort, &cbSize);1020 bool fRc = iomGetRegImmData(pCpu, &pCpu->Param1, pRegFrame, &uPort, &cbSize); 1021 1021 AssertMsg(fRc, ("Failed to get reg/imm port number!\n")); NOREF(fRc); 1022 1022 … … 1025 1025 { 1026 1026 uint64_t u64Data = 0; 1027 fRc = iomGetRegImmData(pCpu, &pCpu-> param2, pRegFrame, &u64Data, &cbSize);1027 fRc = iomGetRegImmData(pCpu, &pCpu->Param2, pRegFrame, &u64Data, &cbSize); 1028 1028 AssertMsg(fRc, ("Failed to get reg value!\n")); NOREF(fRc); 1029 1029 -
trunk/src/VBox/VMM/VMMAll/IOMAllMMIO.cpp
r41737 r41739 538 538 * and call the handler function to get the data. 539 539 */ 540 unsigned cb = DISGetParamSize(pCpu, &pCpu-> param2);540 unsigned cb = DISGetParamSize(pCpu, &pCpu->Param2); 541 541 AssertMsg(cb > 0 && cb <= sizeof(uint64_t), ("cb=%d\n", cb)); 542 542 … … 568 568 * Store the result to register (parameter 1). 569 569 */ 570 bool fRc = iomSaveDataToReg(pCpu, &pCpu-> param1, pRegFrame, u64Data);570 bool fRc = iomSaveDataToReg(pCpu, &pCpu->Param1, pRegFrame, u64Data); 571 571 AssertMsg(fRc, ("Failed to store register value!\n")); NOREF(fRc); 572 572 } … … 599 599 unsigned cb = 0; 600 600 uint64_t u64Data = 0; 601 bool fRc = iomGetRegImmData(pCpu, &pCpu-> param2, pRegFrame, &u64Data, &cb);601 bool fRc = iomGetRegImmData(pCpu, &pCpu->Param2, pRegFrame, &u64Data, &cb); 602 602 AssertMsg(fRc, ("Failed to get reg/imm port number!\n")); NOREF(fRc); 603 603 … … 701 701 * Get data size. 702 702 */ 703 unsigned cb = DISGetParamSize(pCpu, &pCpu-> param1);703 unsigned cb = DISGetParamSize(pCpu, &pCpu->Param1); 704 704 AssertMsg(cb > 0 && cb <= sizeof(uint64_t), ("cb=%d\n", cb)); 705 705 int offIncrement = pRegFrame->eflags.Bits.u1DF ? -(signed)cb : (signed)cb; … … 954 954 * Get data size. 955 955 */ 956 unsigned cb = DISGetParamSize(pCpu, &pCpu-> param1);956 unsigned cb = DISGetParamSize(pCpu, &pCpu->Param1); 957 957 AssertMsg(cb > 0 && cb <= sizeof(uint64_t), ("cb=%d\n", cb)); 958 958 int offIncrement = pRegFrame->eflags.Bits.u1DF ? -(signed)cb : (signed)cb; … … 1068 1068 * Get data size. 1069 1069 */ 1070 unsigned cb = DISGetParamSize(pCpu, &pCpu-> param2);1070 unsigned cb = DISGetParamSize(pCpu, &pCpu->Param2); 1071 1071 AssertMsg(cb > 0 && cb <= sizeof(uint64_t), ("cb=%d\n", cb)); 1072 1072 int offIncrement = pRegFrame->eflags.Bits.u1DF ? -(signed)cb : (signed)cb; … … 1118 1118 uint64_t uData2 = 0; 1119 1119 int rc; 1120 if (iomGetRegImmData(pCpu, &pCpu-> param1, pRegFrame, &uData1, &cb))1120 if (iomGetRegImmData(pCpu, &pCpu->Param1, pRegFrame, &uData1, &cb)) 1121 1121 /* cmp reg, [MMIO]. */ 1122 1122 rc = iomMMIODoRead(pVM, pRange, GCPhysFault, &uData2, cb); 1123 else if (iomGetRegImmData(pCpu, &pCpu-> param2, pRegFrame, &uData2, &cb))1123 else if (iomGetRegImmData(pCpu, &pCpu->Param2, pRegFrame, &uData2, &cb)) 1124 1124 /* cmp [MMIO], reg|imm. */ 1125 1125 rc = iomMMIODoRead(pVM, pRange, GCPhysFault, &uData1, cb); … … 1187 1187 #endif 1188 1188 1189 if (iomGetRegImmData(pCpu, &pCpu-> param1, pRegFrame, &uData1, &cb))1189 if (iomGetRegImmData(pCpu, &pCpu->Param1, pRegFrame, &uData1, &cb)) 1190 1190 { 1191 1191 #if HC_ARCH_BITS == 32 … … 1199 1199 rc = iomMMIODoRead(pVM, pRange, GCPhysFault, &uData2, cb); 1200 1200 } 1201 else if (iomGetRegImmData(pCpu, &pCpu-> param2, pRegFrame, &uData2, &cb))1201 else if (iomGetRegImmData(pCpu, &pCpu->Param2, pRegFrame, &uData2, &cb)) 1202 1202 { 1203 1203 #if HC_ARCH_BITS == 32 … … 1233 1233 { 1234 1234 /* Store result to register. */ 1235 bool fRc = iomSaveDataToReg(pCpu, &pCpu-> param1, pRegFrame, uData1);1235 bool fRc = iomSaveDataToReg(pCpu, &pCpu->Param1, pRegFrame, uData1); 1236 1236 AssertMsg(fRc, ("Failed to store register value!\n")); NOREF(fRc); 1237 1237 } … … 1273 1273 int rc; 1274 1274 1275 if (iomGetRegImmData(pCpu, &pCpu-> param1, pRegFrame, &uData1, &cb))1275 if (iomGetRegImmData(pCpu, &pCpu->Param1, pRegFrame, &uData1, &cb)) 1276 1276 { 1277 1277 /* and test, [MMIO]. */ 1278 1278 rc = iomMMIODoRead(pVM, pRange, GCPhysFault, &uData2, cb); 1279 1279 } 1280 else if (iomGetRegImmData(pCpu, &pCpu-> param2, pRegFrame, &uData2, &cb))1280 else if (iomGetRegImmData(pCpu, &pCpu->Param2, pRegFrame, &uData2, &cb)) 1281 1281 { 1282 1282 /* test [MMIO], reg|imm. */ … … 1330 1330 unsigned cbIgnored; 1331 1331 1332 if (!iomGetRegImmData(pCpu, &pCpu-> param2, pRegFrame, &uBit, &cbIgnored))1332 if (!iomGetRegImmData(pCpu, &pCpu->Param2, pRegFrame, &uBit, &cbIgnored)) 1333 1333 { 1334 1334 AssertMsgFailed(("Disassember BT problem..\n")); … … 1336 1336 } 1337 1337 /* The size of the memory operand only matters here. */ 1338 unsigned cbData = DISGetParamSize(pCpu, &pCpu-> param1);1338 unsigned cbData = DISGetParamSize(pCpu, &pCpu->Param1); 1339 1339 1340 1340 /* bt [MMIO], reg|imm. */ … … 1376 1376 uint64_t uData1 = 0; 1377 1377 uint64_t uData2 = 0; 1378 if (iomGetRegImmData(pCpu, &pCpu-> param1, pRegFrame, &uData1, &cb))1378 if (iomGetRegImmData(pCpu, &pCpu->Param1, pRegFrame, &uData1, &cb)) 1379 1379 { 1380 1380 /* xchg reg, [MMIO]. */ … … 1388 1388 { 1389 1389 /* Store result to register. */ 1390 bool fRc = iomSaveDataToReg(pCpu, &pCpu-> param1, pRegFrame, uData2);1390 bool fRc = iomSaveDataToReg(pCpu, &pCpu->Param1, pRegFrame, uData2); 1391 1391 AssertMsg(fRc, ("Failed to store register value!\n")); NOREF(fRc); 1392 1392 } … … 1397 1397 Assert(rc == VINF_IOM_R3_MMIO_READ || rc == VINF_PATM_HC_MMIO_PATCH_READ); 1398 1398 } 1399 else if (iomGetRegImmData(pCpu, &pCpu-> param2, pRegFrame, &uData2, &cb))1399 else if (iomGetRegImmData(pCpu, &pCpu->Param2, pRegFrame, &uData2, &cb)) 1400 1400 { 1401 1401 /* xchg [MMIO], reg. */ … … 1408 1408 { 1409 1409 /* Store result to register. */ 1410 bool fRc = iomSaveDataToReg(pCpu, &pCpu-> param2, pRegFrame, uData1);1410 bool fRc = iomSaveDataToReg(pCpu, &pCpu->Param2, pRegFrame, uData1); 1411 1411 AssertMsg(fRc, ("Failed to store register value!\n")); NOREF(fRc); 1412 1412 } … … 1535 1535 { 1536 1536 STAM_PROFILE_START(&pVM->iom.s.StatRZInstMov, b); 1537 AssertMsg(uErrorCode == UINT32_MAX || DISUSE_IS_EFFECTIVE_ADDR(pDis-> param1.fUse) == !!(uErrorCode & X86_TRAP_PF_RW), ("flags1=%#llx/%RTbool flags2=%#llx/%RTbool ErrCd=%#x\n", pDis->param1.fUse, DISUSE_IS_EFFECTIVE_ADDR(pDis->param1.fUse), pDis->param2.fUse, DISUSE_IS_EFFECTIVE_ADDR(pDis->param2.fUse), uErrorCode));1537 AssertMsg(uErrorCode == UINT32_MAX || DISUSE_IS_EFFECTIVE_ADDR(pDis->Param1.fUse) == !!(uErrorCode & X86_TRAP_PF_RW), ("flags1=%#llx/%RTbool flags2=%#llx/%RTbool ErrCd=%#x\n", pDis->Param1.fUse, DISUSE_IS_EFFECTIVE_ADDR(pDis->Param1.fUse), pDis->Param2.fUse, DISUSE_IS_EFFECTIVE_ADDR(pDis->Param2.fUse), uErrorCode)); 1538 1538 if (uErrorCode != UINT32_MAX /* EPT+MMIO optimization */ 1539 1539 ? uErrorCode & X86_TRAP_PF_RW 1540 : DISUSE_IS_EFFECTIVE_ADDR(pDis-> param1.fUse))1540 : DISUSE_IS_EFFECTIVE_ADDR(pDis->Param1.fUse)) 1541 1541 rc = iomInterpretMOVxXWrite(pVM, pCtxCore, pDis, pRange, GCPhysFault); 1542 1542 else … … 2311 2311 uint64_t Port = 0; 2312 2312 unsigned cb = 0; 2313 bool fRc = iomGetRegImmData(pCpu, &pCpu-> param1, pRegFrame, &Port, &cb);2313 bool fRc = iomGetRegImmData(pCpu, &pCpu->Param1, pRegFrame, &Port, &cb); 2314 2314 AssertMsg(fRc, ("Failed to get reg/imm port number!\n")); NOREF(fRc); 2315 2315 if (pCpu->pCurInstr->uOpcode == OP_OUTSB) -
trunk/src/VBox/VMM/VMMAll/PGMAllPool.cpp
r41737 r41739 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.reg_gen)); 764 764 765 765 /* Non-supervisor mode write means it's used for something else. */ … … 804 804 return false; 805 805 } 806 if ( ( (pDis-> param1.fUse & DISUSE_REG_GEN32)807 || (pDis-> param1.fUse & DISUSE_REG_GEN64))808 && (pDis-> param1.base.reg_gen == DISGREG_ESP))806 if ( ( (pDis->Param1.fUse & DISUSE_REG_GEN32) 807 || (pDis->Param1.fUse & DISUSE_REG_GEN64)) 808 && (pDis->Param1.base.reg_gen == DISGREG_ESP)) 809 809 { 810 810 Log4(("pgmPoolMonitorIsReused: ESP\n")); … … 887 887 PCPUMCTXCORE pRegFrame, RTGCPHYS GCPhysFault, RTGCPTR pvFault) 888 888 { 889 unsigned uIncrement = pDis-> param1.cb;889 unsigned uIncrement = pDis->Param1.cb; 890 890 NOREF(pVM); 891 891 … … 975 975 #if defined(VBOX_WITH_2X_4GB_ADDR_SPACE_IN_R0) || defined(IN_RC) 976 976 uint32_t iPrevSubset = PGMRZDynMapPushAutoSubset(pVCpu); 977 pgmPoolMonitorChainChanging(pVCpu, pPool, pPage, GCPhysFault, pvFault, DISGetParamSize(pDis, &pDis-> param1));977 pgmPoolMonitorChainChanging(pVCpu, pPool, pPage, GCPhysFault, pvFault, DISGetParamSize(pDis, &pDis->Param1)); 978 978 PGMRZDynMapPopAutoSubset(pVCpu, iPrevSubset); 979 979 #else 980 pgmPoolMonitorChainChanging(pVCpu, pPool, pPage, GCPhysFault, pvFault, DISGetParamSize(pDis, &pDis-> param1));980 pgmPoolMonitorChainChanging(pVCpu, pPool, pPage, GCPhysFault, pvFault, DISGetParamSize(pDis, &pDis->Param1)); 981 981 #endif 982 982 … … 1123 1123 if ( pPage->GCPtrLastAccessHandlerRip >= pRegFrame->rip - 0x40 /* observed loops in Windows 7 x64 */ 1124 1124 && pPage->GCPtrLastAccessHandlerRip < pRegFrame->rip + 0x40 1125 && pvFault == (pPage->GCPtrLastAccessHandlerFault + pDis-> param1.cb)1125 && pvFault == (pPage->GCPtrLastAccessHandlerFault + pDis->Param1.cb) 1126 1126 && pVCpu->pgm.s.cPoolAccessHandler == pPage->cLastAccessHandler + 1) 1127 1127 { -
trunk/src/VBox/VMM/VMMR0/HWSVMR0.cpp
r41737 r41739 2923 2923 NOREF(uASID); 2924 2924 2925 int rc = DISQueryParamVal(pRegFrame, pCpu, &pCpu-> param1, ¶m1, DISQPVWHICH_SRC);2925 int rc = DISQueryParamVal(pRegFrame, pCpu, &pCpu->Param1, ¶m1, DISQPVWHICH_SRC); 2926 2926 if (RT_FAILURE(rc)) 2927 2927 return VERR_EM_INTERPRETER; -
trunk/src/VBox/VMM/VMMR0/HWVMXR0.cpp
r41737 r41739 3704 3704 uint32_t intInfo2; 3705 3705 3706 LogFlow(("Realmode: INT %x\n", pDis-> param1.parval & 0xff));3707 intInfo2 = pDis-> param1.parval & 0xff;3706 LogFlow(("Realmode: INT %x\n", pDis->Param1.parval & 0xff)); 3707 intInfo2 = pDis->Param1.parval & 0xff; 3708 3708 intInfo2 |= (1 << VMX_EXIT_INTERRUPTION_INFO_VALID_SHIFT); 3709 3709 intInfo2 |= (VMX_EXIT_INTERRUPTION_INFO_TYPE_SW << VMX_EXIT_INTERRUPTION_INFO_TYPE_SHIFT); -
trunk/src/VBox/VMM/VMMR3/CSAM.cpp
r41738 r41739 800 800 { 801 801 case OP_INT: 802 Assert(pCpu-> param1.fUse & DISUSE_IMMEDIATE8);803 if (pCpu-> param1.parval == 3)802 Assert(pCpu->Param1.fUse & DISUSE_IMMEDIATE8); 803 if (pCpu->Param1.parval == 3) 804 804 { 805 805 //two byte int 3 … … 1097 1097 * Any register is allowed as long as source and destination are identical. 1098 1098 */ 1099 if ( cpu. param1.fUse != DISUSE_REG_GEN321100 || ( cpu. param2.flags != DISUSE_REG_GEN321101 && ( !(cpu. param2.flags & DISUSE_REG_GEN32)1102 || !(cpu. param2.flags & (DISUSE_DISPLACEMENT8|DISUSE_DISPLACEMENT16|DISUSE_DISPLACEMENT32))1103 || cpu. param2.parval != 01099 if ( cpu.Param1.fUse != DISUSE_REG_GEN32 1100 || ( cpu.Param2.flags != DISUSE_REG_GEN32 1101 && ( !(cpu.Param2.flags & DISUSE_REG_GEN32) 1102 || !(cpu.Param2.flags & (DISUSE_DISPLACEMENT8|DISUSE_DISPLACEMENT16|DISUSE_DISPLACEMENT32)) 1103 || cpu.Param2.parval != 0 1104 1104 ) 1105 1105 ) 1106 || cpu. param1.base.reg_gen32 != cpu.param2.base.reg_gen321106 || cpu.Param1.base.reg_gen32 != cpu.Param2.base.reg_gen32 1107 1107 ) 1108 1108 { … … 1115 1115 { 1116 1116 if ( (pCurInstrGC & 0x3) != 0 1117 || cpu. param1.fUse != DISUSE_REG_GEN321118 || cpu. param1.base.reg_gen32 != USE_REG_EBP1117 || cpu.Param1.fUse != DISUSE_REG_GEN32 1118 || cpu.Param1.base.reg_gen32 != USE_REG_EBP 1119 1119 ) 1120 1120 { … … 1141 1141 { 1142 1142 if ( (pCurInstrGC & 0x3) != 0 1143 || cpu. param1.fUse != DISUSE_REG_GEN321144 || cpu. param1.base.reg_gen32 != USE_REG_ESP1143 || cpu.Param1.fUse != DISUSE_REG_GEN32 1144 || cpu.Param1.base.reg_gen32 != USE_REG_ESP 1145 1145 ) 1146 1146 { … … 1328 1328 // For our first attempt, we'll handle only simple relative jumps and calls (immediate offset coded in instruction) 1329 1329 if ( ((cpu.pCurInstr->fOpType & DISOPTYPE_CONTROLFLOW) && (OP_PARM_VTYPE(cpu.pCurInstr->fParam1) == OP_PARM_J)) 1330 || (cpu.pCurInstr->uOpcode == OP_CALL && cpu. param1.fUse == DISUSE_DISPLACEMENT32)) /* simple indirect call (call dword ptr [address]) */1330 || (cpu.pCurInstr->uOpcode == OP_CALL && cpu.Param1.fUse == DISUSE_DISPLACEMENT32)) /* simple indirect call (call dword ptr [address]) */ 1331 1331 { 1332 1332 /* We need to parse 'call dword ptr [address]' type of calls to catch cpuid instructions in some recent Linux distributions (e.g. OpenSuse 10.3) */ 1333 1333 if ( cpu.pCurInstr->uOpcode == OP_CALL 1334 && cpu. param1.fUse == DISUSE_DISPLACEMENT32)1334 && cpu.Param1.fUse == DISUSE_DISPLACEMENT32) 1335 1335 { 1336 1336 addr = 0; 1337 PGMPhysSimpleReadGCPtr(pVCpu, &addr, (RTRCUINTPTR)cpu. param1.uDisp.i32, sizeof(addr));1337 PGMPhysSimpleReadGCPtr(pVCpu, &addr, (RTRCUINTPTR)cpu.Param1.uDisp.i32, sizeof(addr)); 1338 1338 } 1339 1339 else … … 1342 1342 if (addr == 0) 1343 1343 { 1344 Log(("We don't support far jumps here!! (%08X)\n", cpu. param1.fUse));1344 Log(("We don't support far jumps here!! (%08X)\n", cpu.Param1.fUse)); 1345 1345 rc = VINF_SUCCESS; 1346 1346 break; … … 1399 1399 else 1400 1400 if ( cpu.pCurInstr->uOpcode == OP_JMP 1401 && (cpu. param1.fUse & (DISUSE_DISPLACEMENT32|DISUSE_INDEX|DISUSE_SCALE)) == (DISUSE_DISPLACEMENT32|DISUSE_INDEX|DISUSE_SCALE)1401 && (cpu.Param1.fUse & (DISUSE_DISPLACEMENT32|DISUSE_INDEX|DISUSE_SCALE)) == (DISUSE_DISPLACEMENT32|DISUSE_INDEX|DISUSE_SCALE) 1402 1402 ) 1403 1403 { 1404 RTRCPTR pJumpTableGC = (RTRCPTR)cpu. param1.disp32;1404 RTRCPTR pJumpTableGC = (RTRCPTR)cpu.Param1.disp32; 1405 1405 uint8_t *pJumpTableHC; 1406 1406 int rc2; … … 1415 1415 uint64_t fFlags; 1416 1416 1417 addr = pJumpTableGC + cpu. param1.scale * i;1417 addr = pJumpTableGC + cpu.Param1.scale * i; 1418 1418 /* Same page? */ 1419 1419 if (PAGE_ADDRESS(addr) != PAGE_ADDRESS(pJumpTableGC)) 1420 1420 break; 1421 1421 1422 addr = *(RTRCPTR *)(pJumpTableHC + cpu. param1.scale * i);1422 addr = *(RTRCPTR *)(pJumpTableHC + cpu.Param1.scale * i); 1423 1423 1424 1424 rc2 = PGMGstGetPage(pVCpu, addr, &fFlags, NULL); -
trunk/src/VBox/VMM/VMMR3/EMRaw.cpp
r41738 r41739 990 990 991 991 case OP_MOV_CR: 992 if (Cpu. param1.fUse & DISUSE_REG_GEN32)992 if (Cpu.Param1.fUse & DISUSE_REG_GEN32) 993 993 { 994 994 //read 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]);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]); 998 998 } 999 999 else 1000 1000 { 1001 1001 //write 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]);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]); 1005 1005 } 1006 1006 break; … … 1100 1100 1101 1101 if ( Cpu.pCurInstr->uOpcode == OP_MOV_CR 1102 && Cpu. param1.fUse == DISUSE_REG_CR /* write */1102 && Cpu.Param1.fUse == DISUSE_REG_CR /* write */ 1103 1103 ) 1104 1104 { -
trunk/src/VBox/VMM/VMMR3/HWACCM.cpp
r41737 r41739 1833 1833 pPatch->cbOp = cbOp; 1834 1834 1835 if (pDis-> param1.fUse == DISUSE_DISPLACEMENT32)1835 if (pDis->Param1.fUse == DISUSE_DISPLACEMENT32) 1836 1836 { 1837 1837 /* write. */ 1838 if (pDis-> param2.fUse == DISUSE_REG_GEN32)1838 if (pDis->Param2.fUse == DISUSE_REG_GEN32) 1839 1839 { 1840 1840 pPatch->enmType = HWACCMTPRINSTR_WRITE_REG; 1841 pPatch->uSrcOperand = pDis-> param2.base.reg_gen;1841 pPatch->uSrcOperand = pDis->Param2.base.reg_gen; 1842 1842 } 1843 1843 else 1844 1844 { 1845 Assert(pDis-> param2.fUse == DISUSE_IMMEDIATE32);1845 Assert(pDis->Param2.fUse == DISUSE_IMMEDIATE32); 1846 1846 pPatch->enmType = HWACCMTPRINSTR_WRITE_IMM; 1847 pPatch->uSrcOperand = pDis-> param2.parval;1847 pPatch->uSrcOperand = pDis->Param2.parval; 1848 1848 } 1849 1849 rc = PGMPhysSimpleWriteGCPtr(pVCpu, pCtx->rip, aVMMCall, sizeof(aVMMCall)); … … 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.reg_gen; 1860 1860 1861 1861 /* read */ 1862 Assert(pDis-> param1.fUse == DISUSE_REG_GEN32);1862 Assert(pDis->Param1.fUse == DISUSE_REG_GEN32); 1863 1863 1864 1864 /* Found: … … 1872 1872 if ( rc == VINF_SUCCESS 1873 1873 && pDis->pCurInstr->uOpcode == OP_SHR 1874 && pDis-> param1.fUse == DISUSE_REG_GEN321875 && pDis-> param1.base.reg_gen == uMmioReg1876 && pDis-> param2.fUse == DISUSE_IMMEDIATE81877 && pDis-> param2.parval == 41874 && pDis->Param1.fUse == DISUSE_REG_GEN32 1875 && pDis->Param1.base.reg_gen == uMmioReg 1876 && pDis->Param2.fUse == DISUSE_IMMEDIATE8 1877 && pDis->Param2.parval == 4 1878 1878 && oldcbOp + cbOp < sizeof(pVM->hwaccm.s.aPatches[idx].aOpcode)) 1879 1879 { … … 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.reg_gen; 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.reg_gen; 1909 1909 1910 1910 rc = PGMPhysSimpleWriteGCPtr(pVCpu, pCtx->rip, aVMMCall, sizeof(aVMMCall)); … … 2008 2008 pPatch->enmType = HWACCMTPRINSTR_JUMP_REPLACEMENT; 2009 2009 2010 if (pDis-> param1.fUse == DISUSE_DISPLACEMENT32)2010 if (pDis->Param1.fUse == DISUSE_DISPLACEMENT32) 2011 2011 { 2012 2012 /* … … 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.reg_gen == DISGREG_EAX); 2031 2031 2032 2032 aPatch[off++] = 0x51; /* push ecx */ … … 2036 2036 aPatch[off++] = 0x31; /* xor edx, edx */ 2037 2037 aPatch[off++] = 0xD2; 2038 if (pDis-> param2.fUse == DISUSE_REG_GEN32)2038 if (pDis->Param2.fUse == DISUSE_REG_GEN32) 2039 2039 { 2040 2040 if (!fUsesEax) 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.reg_gen, DISGREG_EAX); 2044 2044 } 2045 2045 } 2046 2046 else 2047 2047 { 2048 Assert(pDis-> param2.fUse == DISUSE_IMMEDIATE32);2048 Assert(pDis->Param2.fUse == DISUSE_IMMEDIATE32); 2049 2049 aPatch[off++] = 0xB8; /* mov eax, immediate */ 2050 *(uint32_t *)&aPatch[off] = pDis-> param2.parval;2050 *(uint32_t *)&aPatch[off] = pDis->Param2.parval; 2051 2051 off += sizeof(uint32_t); 2052 2052 } … … 2079 2079 * 2080 2080 */ 2081 Assert(pDis-> param1.fUse == DISUSE_REG_GEN32);2082 2083 if (pDis-> param1.base.reg_gen != DISGREG_ECX)2081 Assert(pDis->Param1.fUse == DISUSE_REG_GEN32); 2082 2083 if (pDis->Param1.base.reg_gen != DISGREG_ECX) 2084 2084 aPatch[off++] = 0x51; /* push ecx */ 2085 if (pDis-> param1.base.reg_gen != DISGREG_EDX )2085 if (pDis->Param1.base.reg_gen != DISGREG_EDX ) 2086 2086 aPatch[off++] = 0x52; /* push edx */ 2087 if (pDis-> param1.base.reg_gen != DISGREG_EAX)2087 if (pDis->Param1.base.reg_gen != 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.reg_gen != 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.reg_gen); 2104 2104 } 2105 2105 2106 if (pDis-> param1.base.reg_gen != DISGREG_EAX)2106 if (pDis->Param1.base.reg_gen != DISGREG_EAX) 2107 2107 aPatch[off++] = 0x58; /* pop eax */ 2108 if (pDis-> param1.base.reg_gen != DISGREG_EDX )2108 if (pDis->Param1.base.reg_gen != DISGREG_EDX ) 2109 2109 aPatch[off++] = 0x5A; /* pop edx */ 2110 if (pDis-> param1.base.reg_gen != DISGREG_ECX)2110 if (pDis->Param1.base.reg_gen != DISGREG_ECX) 2111 2111 aPatch[off++] = 0x59; /* pop ecx */ 2112 2112 } -
trunk/src/VBox/VMM/VMMR3/PATM.cpp
r41738 r41739 1399 1399 ) 1400 1400 { 1401 Assert(pCpu-> param1.cb <= 4 || pCpu->param1.cb == 6);1402 if ( pCpu-> param1.cb == 6 /* far call/jmp */1401 Assert(pCpu->Param1.cb <= 4 || pCpu->Param1.cb == 6); 1402 if ( pCpu->Param1.cb == 6 /* far call/jmp */ 1403 1403 || (pCpu->pCurInstr->uOpcode == OP_CALL && !(pPatch->flags & PATMFL_SUPPORT_CALLS)) 1404 1404 || (OP_PARM_VTYPE(pCpu->pCurInstr->fParam1) != OP_PARM_J && !(pPatch->flags & PATMFL_SUPPORT_INDIRECT_CALLS)) … … 1558 1558 ) 1559 1559 { 1560 Assert(pCpu-> param1.cb <= 4 || pCpu->param1.cb == 6);1561 if ( pCpu-> param1.cb == 6 /* far call/jmp */1560 Assert(pCpu->Param1.cb <= 4 || pCpu->Param1.cb == 6); 1561 if ( pCpu->Param1.cb == 6 /* far call/jmp */ 1562 1562 || (pCpu->pCurInstr->uOpcode == OP_CALL && !(pPatch->flags & PATMFL_SUPPORT_CALLS)) 1563 1563 || (OP_PARM_VTYPE(pCpu->pCurInstr->fParam1) != OP_PARM_J && !(pPatch->flags & PATMFL_SUPPORT_INDIRECT_CALLS)) … … 1701 1701 if (pTargetGC == 0) 1702 1702 { 1703 Log(("We don't support far jumps here!! (%08X)\n", pCpu-> param1.fUse));1703 Log(("We don't support far jumps here!! (%08X)\n", pCpu->Param1.fUse)); 1704 1704 return VERR_PATCHING_REFUSED; 1705 1705 } … … 1748 1748 { 1749 1749 /* mov ss, src? */ 1750 if ( (pCpu-> param1.fUse & DISUSE_REG_SEG)1751 && (pCpu-> param1.base.reg_seg == DISSELREG_SS))1750 if ( (pCpu->Param1.fUse & DISUSE_REG_SEG) 1751 && (pCpu->Param1.base.reg_seg == DISSELREG_SS)) 1752 1752 { 1753 1753 Log(("Force recompilation of next instruction for OP_MOV at %RRv\n", pCurInstrGC)); … … 1757 1757 #if 0 /* necessary for Haiku */ 1758 1758 else 1759 if ( (pCpu-> param2.fUse & DISUSE_REG_SEG)1760 && (pCpu-> param2.base.reg_seg == USE_REG_SS)1761 && (pCpu-> param1.fUse & (DISUSE_REG_GEN32|DISUSE_REG_GEN16))) /** @todo memory operand must in theory be handled too */1759 if ( (pCpu->Param2.fUse & DISUSE_REG_SEG) 1760 && (pCpu->Param2.base.reg_seg == USE_REG_SS) 1761 && (pCpu->Param1.fUse & (DISUSE_REG_GEN32|DISUSE_REG_GEN16))) /** @todo memory operand must in theory be handled too */ 1762 1762 { 1763 1763 /* mov GPR, ss */ … … 1945 1945 * In that case we'll jump to the original instruction and continue from there. Otherwise an int 3 is executed. 1946 1946 */ 1947 Assert(pCpu-> param1.cb == 4 || pCpu->param1.cb == 6);1948 if (pPatch->flags & PATMFL_SUPPORT_INDIRECT_CALLS && pCpu-> param1.cb == 4 /* no far calls! */)1947 Assert(pCpu->Param1.cb == 4 || pCpu->Param1.cb == 6); 1948 if (pPatch->flags & PATMFL_SUPPORT_INDIRECT_CALLS && pCpu->Param1.cb == 4 /* no far calls! */) 1949 1949 { 1950 1950 rc = patmPatchGenCall(pVM, pPatch, pCpu, pCurInstrGC, (RTRCPTR)0xDEADBEEF, true); … … 1962 1962 * In that case we'll jump to the original instruction and continue from there. Otherwise an int 3 is executed. 1963 1963 */ 1964 Assert(pCpu-> param1.cb == 4 || pCpu->param1.cb == 6);1965 if (pPatch->flags & PATMFL_SUPPORT_INDIRECT_CALLS && pCpu-> param1.cb == 4 /* no far jumps! */)1964 Assert(pCpu->Param1.cb == 4 || pCpu->Param1.cb == 6); 1965 if (pPatch->flags & PATMFL_SUPPORT_INDIRECT_CALLS && pCpu->Param1.cb == 4 /* no far jumps! */) 1966 1966 { 1967 1967 rc = patmPatchGenJump(pVM, pPatch, pCpu, pCurInstrGC); … … 2133 2133 2134 2134 bool disret = patmR3DisInstr(pVM, pPatch, pOrgJumpGC, pOrgJumpHC, PATMREAD_ORGCODE, &cpu, NULL); 2135 if (!disret || cpu.pCurInstr->uOpcode != OP_CALL || cpu. param1.cb != 4 /* only near calls */)2135 if (!disret || cpu.pCurInstr->uOpcode != OP_CALL || cpu.Param1.cb != 4 /* only near calls */) 2136 2136 return VINF_SUCCESS; 2137 2137 } … … 2242 2242 if (pTargetGC == 0) 2243 2243 { 2244 Log(("We don't support far jumps here!! (%08X)\n", cpu. param1.fUse));2244 Log(("We don't support far jumps here!! (%08X)\n", cpu.Param1.fUse)); 2245 2245 rc = VERR_PATCHING_REFUSED; 2246 2246 break; … … 2461 2461 if (addr == 0) 2462 2462 { 2463 Log(("We don't support far jumps here!! (%08X)\n", cpu. param1.fUse));2463 Log(("We don't support far jumps here!! (%08X)\n", cpu.Param1.fUse)); 2464 2464 rc = VERR_PATCHING_REFUSED; 2465 2465 break; … … 3581 3581 if (pTargetGC == 0) 3582 3582 { 3583 Log(("We don't support far jumps here!! (%08X)\n", pCpu-> param1.fUse));3583 Log(("We don't support far jumps here!! (%08X)\n", pCpu->Param1.fUse)); 3584 3584 rc = VERR_PATCHING_REFUSED; 3585 3585 goto failure; … … 3673 3673 goto failure; 3674 3674 3675 if (pCpu-> param2.fUse != DISUSE_DISPLACEMENT32)3675 if (pCpu->Param2.fUse != DISUSE_DISPLACEMENT32) 3676 3676 goto failure; 3677 3677 … … 3752 3752 if (cbInstr > MAX_INSTR_SIZE) 3753 3753 return VERR_PATCHING_REFUSED; 3754 if (cpu. param2.fUse != DISUSE_DISPLACEMENT32)3754 if (cpu.Param2.fUse != DISUSE_DISPLACEMENT32) 3755 3755 return VERR_PATCHING_REFUSED; 3756 3756 … … 3914 3914 case OP_JMP: 3915 3915 Assert(pPatch->flags & PATMFL_JUMP_CONFLICT); 3916 Assert(pCpu-> param1.fUse & DISUSE_IMMEDIATE32_REL);3917 if (!(pCpu-> param1.fUse & DISUSE_IMMEDIATE32_REL))3916 Assert(pCpu->Param1.fUse & DISUSE_IMMEDIATE32_REL); 3917 if (!(pCpu->Param1.fUse & DISUSE_IMMEDIATE32_REL)) 3918 3918 goto failure; 3919 3919 … … 3949 3949 * references the target instruction in the conflict patch. 3950 3950 */ 3951 RTRCPTR pJmpDest = PATMR3GuestGCPtrToPatchGCPtr(pVM, pInstrGC + pCpu->cbInstr + (int32_t)pCpu-> param1.parval);3952 3953 AssertMsg(pJmpDest, ("PATMR3GuestGCPtrToPatchGCPtr failed for %RRv\n", pInstrGC + pCpu->cbInstr + (int32_t)pCpu-> param1.parval));3951 RTRCPTR pJmpDest = PATMR3GuestGCPtrToPatchGCPtr(pVM, pInstrGC + pCpu->cbInstr + (int32_t)pCpu->Param1.parval); 3952 3953 AssertMsg(pJmpDest, ("PATMR3GuestGCPtrToPatchGCPtr failed for %RRv\n", pInstrGC + pCpu->cbInstr + (int32_t)pCpu->Param1.parval)); 3954 3954 pPatch->pPatchJumpDestGC = pJmpDest; 3955 3955 … … 5199 5199 && (pConflictPatch->flags & PATMFL_CODE32) 5200 5200 && (cpu.pCurInstr->uOpcode == OP_JMP || (cpu.pCurInstr->fOpType & DISOPTYPE_COND_CONTROLFLOW)) 5201 && (cpu. param1.fUse & DISUSE_IMMEDIATE32_REL))5201 && (cpu.Param1.fUse & DISUSE_IMMEDIATE32_REL)) 5202 5202 { 5203 5203 /* Hint patches must be enabled first. */ -
trunk/src/VBox/VMM/VMMR3/PATMPatch.cpp
r41738 r41739 694 694 { 695 695 Log(("patmPatchGenIndirectCall\n")); 696 Assert(pCpu-> param1.cb == 4);696 Assert(pCpu->Param1.cb == 4); 697 697 Assert(OP_PARM_VTYPE(pCpu->pCurInstr->fParam1) != OP_PARM_J); 698 698 … … 790 790 791 791 Log(("patmPatchGenIndirectJump\n")); 792 Assert(pCpu-> param1.cb == 4);792 Assert(pCpu->Param1.cb == 4); 793 793 Assert(OP_PARM_VTYPE(pCpu->pCurInstr->fParam1) != OP_PARM_J); 794 794 … … 857 857 /** @note optimization: multiple identical ret instruction in a single patch can share a single patched ret. */ 858 858 if ( pPatch->pTempInfo->pPatchRetInstrGC 859 && pPatch->pTempInfo->uPatchRetParam1 == (uint32_t)pCpu-> param1.parval) /* nr of bytes popped off the stack should be identical of course! */859 && pPatch->pTempInfo->uPatchRetParam1 == (uint32_t)pCpu->Param1.parval) /* nr of bytes popped off the stack should be identical of course! */ 860 860 { 861 861 Assert(pCpu->pCurInstr->uOpcode == OP_RETN); … … 891 891 { 892 892 pPatch->pTempInfo->pPatchRetInstrGC = pPatchRetInstrGC; 893 pPatch->pTempInfo->uPatchRetParam1 = pCpu-> param1.parval;893 pPatch->pTempInfo->uPatchRetParam1 = pCpu->Param1.parval; 894 894 } 895 895 return rc; … … 1164 1164 // mov DRx, GPR 1165 1165 pPB[0] = 0x89; //mov disp32, GPR 1166 Assert(pCpu-> param1.fUse & DISUSE_REG_DBG);1167 Assert(pCpu-> param2.fUse & DISUSE_REG_GEN32);1168 1169 dbgreg = pCpu-> param1.base.reg_dbg;1170 reg = pCpu-> param2.base.reg_gen;1166 Assert(pCpu->Param1.fUse & DISUSE_REG_DBG); 1167 Assert(pCpu->Param2.fUse & DISUSE_REG_GEN32); 1168 1169 dbgreg = pCpu->Param1.base.reg_dbg; 1170 reg = pCpu->Param2.base.reg_gen; 1171 1171 } 1172 1172 else 1173 1173 { 1174 1174 // mov GPR, DRx 1175 Assert(pCpu-> param1.fUse & DISUSE_REG_GEN32);1176 Assert(pCpu-> param2.fUse & DISUSE_REG_DBG);1175 Assert(pCpu->Param1.fUse & DISUSE_REG_GEN32); 1176 Assert(pCpu->Param2.fUse & DISUSE_REG_DBG); 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.reg_gen; 1180 dbgreg = pCpu->Param2.base.reg_dbg; 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;1218 Assert(pCpu-> param1.fUse & DISUSE_REG_CR);1219 Assert(pCpu-> param2.fUse & DISUSE_REG_GEN32);1216 ctrlreg = pCpu->Param1.base.reg_ctrl; 1217 reg = pCpu->Param2.base.reg_gen; 1218 Assert(pCpu->Param1.fUse & DISUSE_REG_CR); 1219 Assert(pCpu->Param2.fUse & DISUSE_REG_GEN32); 1220 1220 } 1221 1221 else 1222 1222 { 1223 1223 // mov GPR, DRx 1224 Assert(pCpu-> param1.fUse & DISUSE_REG_GEN32);1225 Assert(pCpu-> param2.fUse & DISUSE_REG_CR);1224 Assert(pCpu->Param1.fUse & DISUSE_REG_GEN32); 1225 Assert(pCpu->Param2.fUse & DISUSE_REG_CR); 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.reg_gen; 1229 ctrlreg = pCpu->Param2.base.reg_ctrl; 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.reg_gen; 1295 1295 PATCHGEN_EPILOG(pPatch, offset); 1296 1296 … … 1325 1325 PATCHGEN_PROLOG(pVM, pPatch); 1326 1326 1327 if (pCpu-> param1.fUse == DISUSE_REG_GEN32 || pCpu->param1.fUse == DISUSE_REG_GEN16)1327 if (pCpu->Param1.fUse == DISUSE_REG_GEN32 || pCpu->Param1.fUse == DISUSE_REG_GEN16) 1328 1328 { 1329 1329 /* Register operand */ … … 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.reg_gen, 5); 1338 1338 if (pCpu->pCurInstr->uOpcode == OP_STR) 1339 1339 { -
trunk/src/VBox/VMM/VMMRC/TRPMRCHandlers.cpp
r41738 r41739 738 738 * Little hack to make the code below not fail 739 739 */ 740 pCpu-> param1.fUse = DISUSE_IMMEDIATE8;741 pCpu-> param1.parval = 3;740 pCpu->Param1.fUse = DISUSE_IMMEDIATE8; 741 pCpu->Param1.parval = 3; 742 742 /* fallthru */ 743 743 case OP_INT: 744 744 { 745 Assert(pCpu-> param1.fUse & DISUSE_IMMEDIATE8);745 Assert(pCpu->Param1.fUse & DISUSE_IMMEDIATE8); 746 746 Assert(!(PATMIsPatchGCAddr(pVM, PC))); 747 if (pCpu-> param1.parval == 3)747 if (pCpu->Param1.parval == 3) 748 748 { 749 749 /* Int 3 replacement patch? */ … … 754 754 } 755 755 } 756 rc = TRPMForwardTrap(pVCpu, pRegFrame, (uint32_t)pCpu-> param1.parval, pCpu->cbInstr, TRPM_TRAP_NO_ERRORCODE, TRPM_SOFTWARE_INT, 0xd);756 rc = TRPMForwardTrap(pVCpu, pRegFrame, (uint32_t)pCpu->Param1.parval, pCpu->cbInstr, TRPM_TRAP_NO_ERRORCODE, TRPM_SOFTWARE_INT, 0xd); 757 757 if (RT_SUCCESS(rc) && rc != VINF_EM_RAW_GUEST_TRAP) 758 758 return trpmGCExitTrap(pVM, pVCpu, VINF_SUCCESS, pRegFrame); … … 840 840 * Little hack to make the code below not fail 841 841 */ 842 pCpu-> param1.fUse = DISUSE_IMMEDIATE8;843 pCpu-> param1.parval = 3;842 pCpu->Param1.fUse = DISUSE_IMMEDIATE8; 843 pCpu->Param1.parval = 3; 844 844 /* fall thru */ 845 845 case OP_INT: 846 846 { 847 Assert(pCpu-> param1.fUse & DISUSE_IMMEDIATE8);848 rc = TRPMForwardTrap(pVCpu, pRegFrame, (uint32_t)pCpu-> param1.parval, pCpu->cbInstr, TRPM_TRAP_NO_ERRORCODE, TRPM_SOFTWARE_INT, 0xd);847 Assert(pCpu->Param1.fUse & DISUSE_IMMEDIATE8); 848 rc = TRPMForwardTrap(pVCpu, pRegFrame, (uint32_t)pCpu->Param1.parval, pCpu->cbInstr, TRPM_TRAP_NO_ERRORCODE, TRPM_SOFTWARE_INT, 0xd); 849 849 if (RT_SUCCESS(rc) && rc != VINF_EM_RAW_GUEST_TRAP) 850 850 return trpmGCExitTrap(pVM, pVCpu, VINF_SUCCESS, pRegFrame); -
trunk/src/VBox/VMM/include/CSAMInternal.h
r41732 r41739 251 251 { 252 252 uint32_t disp; 253 if (pCpu-> param1.fUse & DISUSE_IMMEDIATE8_REL)254 { 255 disp = (int32_t)(char)pCpu-> param1.parval;253 if (pCpu->Param1.fUse & DISUSE_IMMEDIATE8_REL) 254 { 255 disp = (int32_t)(char)pCpu->Param1.parval; 256 256 } 257 257 else 258 if (pCpu-> param1.fUse & DISUSE_IMMEDIATE16_REL)259 { 260 disp = (int32_t)(uint16_t)pCpu-> param1.parval;258 if (pCpu->Param1.fUse & DISUSE_IMMEDIATE16_REL) 259 { 260 disp = (int32_t)(uint16_t)pCpu->Param1.parval; 261 261 } 262 262 else 263 if (pCpu-> param1.fUse & DISUSE_IMMEDIATE32_REL)264 { 265 disp = (int32_t)pCpu-> param1.parval;263 if (pCpu->Param1.fUse & DISUSE_IMMEDIATE32_REL) 264 { 265 disp = (int32_t)pCpu->Param1.parval; 266 266 } 267 267 else 268 268 { 269 Log(("We don't support far jumps here!! (%08X)\n", pCpu-> param1.fUse));269 Log(("We don't support far jumps here!! (%08X)\n", pCpu->Param1.fUse)); 270 270 return 0; 271 271 } -
trunk/src/VBox/VMM/include/PATMInternal.h
r41732 r41739 761 761 { 762 762 uint32_t disp; 763 if (pCpu-> param1.fUse & DISUSE_IMMEDIATE8_REL)763 if (pCpu->Param1.fUse & DISUSE_IMMEDIATE8_REL) 764 764 { 765 disp = (int32_t)(char)pCpu-> param1.parval;765 disp = (int32_t)(char)pCpu->Param1.parval; 766 766 } 767 767 else 768 if (pCpu-> param1.fUse & DISUSE_IMMEDIATE16_REL)768 if (pCpu->Param1.fUse & DISUSE_IMMEDIATE16_REL) 769 769 { 770 disp = (int32_t)(uint16_t)pCpu-> param1.parval;770 disp = (int32_t)(uint16_t)pCpu->Param1.parval; 771 771 } 772 772 else 773 if (pCpu-> param1.fUse & DISUSE_IMMEDIATE32_REL)773 if (pCpu->Param1.fUse & DISUSE_IMMEDIATE32_REL) 774 774 { 775 disp = (int32_t)pCpu-> param1.parval;775 disp = (int32_t)pCpu->Param1.parval; 776 776 } 777 777 else 778 778 { 779 Log(("We don't support far jumps here!! (%08X)\n", pCpu-> param1.fUse));779 Log(("We don't support far jumps here!! (%08X)\n", pCpu->Param1.fUse)); 780 780 return 0; 781 781 } -
trunk/src/VBox/VMM/testcase/tstVMStruct.h
r41732 r41739 1398 1398 #ifndef VBOX_FOR_DTRACE_LIB 1399 1399 GEN_CHECK_SIZE(DISCPUSTATE); 1400 GEN_CHECK_OFF(DISCPUSTATE, param1);1401 GEN_CHECK_OFF(DISCPUSTATE, param2);1402 GEN_CHECK_OFF(DISCPUSTATE, param3);1400 GEN_CHECK_OFF(DISCPUSTATE, Param1); 1401 GEN_CHECK_OFF(DISCPUSTATE, Param2); 1402 GEN_CHECK_OFF(DISCPUSTATE, Param3); 1403 1403 GEN_CHECK_OFF(DISCPUSTATE, i32SibDisp); 1404 1404 GEN_CHECK_OFF(DISCPUSTATE, fFilter);
Note:
See TracChangeset
for help on using the changeset viewer.