- Timestamp:
- Jun 12, 2008 3:00:47 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/VMMAll/EMAll.cpp
r9661 r9663 429 429 #endif 430 430 RTGCPTR pParam1 = 0, pParam2 = 0; 431 uint 32_t valpar1, valpar2;431 uint64_t valpar1, valpar2; 432 432 433 433 AssertReturn(pCpu->param1.size == pCpu->param2.size, VERR_EM_INTERPRETER); … … 435 435 { 436 436 case PARMTYPE_IMMEDIATE: /* register type is translated to this one too */ 437 valpar1 = param1.val.val 32;437 valpar1 = param1.val.val64; 438 438 break; 439 439 440 440 case PARMTYPE_ADDRESS: 441 pParam1 = (RTGCPTR)param1.val.val 32;441 pParam1 = (RTGCPTR)param1.val.val64; 442 442 pParam1 = emConvertToFlatAddr(pVM, pRegFrame, pCpu, &pCpu->param1, pParam1); 443 443 #ifdef IN_GC … … 461 461 { 462 462 case PARMTYPE_ADDRESS: 463 pParam2 = (RTGCPTR)param2.val.val 32;463 pParam2 = (RTGCPTR)param2.val.val64; 464 464 pParam2 = emConvertToFlatAddr(pVM, pRegFrame, pCpu, &pCpu->param2, pParam2); 465 465 #ifdef IN_GC … … 475 475 476 476 case PARMTYPE_IMMEDIATE: 477 valpar2 = param2.val.val 32;477 valpar2 = param2.val.val64; 478 478 break; 479 479 … … 490 490 { 491 491 case 1: //special case for AH etc 492 rc = DISWriteReg8(pRegFrame, pCpu->param1.base.reg_gen, (uint8_t)valpar2); break;492 rc = DISWriteReg8(pRegFrame, pCpu->param1.base.reg_gen, (uint8_t )valpar2); break; 493 493 case 2: rc = DISWriteReg16(pRegFrame, pCpu->param1.base.reg_gen, (uint16_t)valpar2); break; 494 case 4: rc = DISWriteReg32(pRegFrame, pCpu->param1.base.reg_gen, valpar2); break; 494 case 4: rc = DISWriteReg32(pRegFrame, pCpu->param1.base.reg_gen, (uint32_t)valpar2); break; 495 case 8: rc = DISWriteReg64(pRegFrame, pCpu->param1.base.reg_gen, valpar2); break; 495 496 default: AssertFailedReturn(VERR_EM_INTERPRETER); 496 497 } … … 515 516 { 516 517 case 1: //special case for AH etc 517 rc = DISWriteReg8(pRegFrame, pCpu->param2.base.reg_gen, (uint8_t)valpar1); break; 518 case 2: rc = DISWriteReg16(pRegFrame, pCpu->param2.base.reg_gen, (uint16_t)valpar1); break; 519 case 4: rc = DISWriteReg32(pRegFrame, pCpu->param2.base.reg_gen, valpar1); break; 518 rc = DISWriteReg8(pRegFrame, pCpu->param2.base.reg_gen, (uint8_t )valpar1); break; 519 case 2: rc = DISWriteReg16(pRegFrame, pCpu->param2.base.reg_gen, (uint16_t)valpar1); break; 520 case 4: rc = DISWriteReg32(pRegFrame, pCpu->param2.base.reg_gen, (uint32_t)valpar1); break; 521 case 8: rc = DISWriteReg64(pRegFrame, pCpu->param2.base.reg_gen, valpar1); break; 520 522 default: AssertFailedReturn(VERR_EM_INTERPRETER); 521 523 } … … 548 550 PFN_EMULATE_PARAM2 pfnEmulate) 549 551 { 552 Assert(pCpu->mode != CPUMODE_64BIT); /** @todo check */ 550 553 OP_PARAMVAL param1; 551 554 … … 565 568 if (param1.type == PARMTYPE_ADDRESS) 566 569 { 567 pParam1 = (RTGCPTR)param1.val.val 32;570 pParam1 = (RTGCPTR)param1.val.val64; 568 571 pParam1 = emConvertToFlatAddr(pVM, pRegFrame, pCpu, &pCpu->param1, pParam1); 569 572 #ifdef IN_GC … … 615 618 static int emInterpretPop(PVM pVM, PDISCPUSTATE pCpu, PCPUMCTXCORE pRegFrame, RTGCPTR pvFault, uint32_t *pcbSize) 616 619 { 620 Assert(pCpu->mode != CPUMODE_64BIT); /** @todo check */ 617 621 OP_PARAMVAL param1; 618 622 int rc = DISQueryParamVal(pRegFrame, pCpu, &pCpu->param1, ¶m1, PARAM_DEST); … … 648 652 if (param1.type == PARMTYPE_ADDRESS) 649 653 { 650 pParam1 = (RTGCPTR)param1.val.val 32;654 pParam1 = (RTGCPTR)param1.val.val64; 651 655 652 656 /* pop [esp+xx] uses esp after the actual pop! */ … … 699 703 PFN_EMULATE_PARAM3 pfnEmulate) 700 704 { 705 Assert(pCpu->mode != CPUMODE_64BIT); /** @todo check */ 701 706 OP_PARAMVAL param1, param2; 702 707 int rc = DISQueryParamVal(pRegFrame, pCpu, &pCpu->param1, ¶m1, PARAM_DEST); … … 745 750 if (param1.type == PARMTYPE_ADDRESS) 746 751 { 747 pParam1 = (RTGCPTR)param1.val.val 32;752 pParam1 = (RTGCPTR)param1.val.val64; 748 753 pParam1 = emConvertToFlatAddr(pVM, pRegFrame, pCpu, &pCpu->param1, pParam1); 749 754 … … 806 811 uint32_t *pcbSize, PFNEMULATELOCKPARAM3 pfnEmulate) 807 812 { 813 Assert(pCpu->mode != CPUMODE_64BIT); /** @todo check */ 808 814 OP_PARAMVAL param1, param2; 809 815 int rc = DISQueryParamVal(pRegFrame, pCpu, &pCpu->param1, ¶m1, PARAM_DEST); … … 871 877 PFN_EMULATE_PARAM3 pfnEmulate) 872 878 { 879 Assert(pCpu->mode != CPUMODE_64BIT); /** @todo check */ 873 880 OP_PARAMVAL param1, param2; 874 881 int rc = DISQueryParamVal(pRegFrame, pCpu, &pCpu->param1, ¶m1, PARAM_DEST); … … 917 924 if (param1.type == PARMTYPE_ADDRESS) 918 925 { 919 pParam1 = (RTGCPTR)param1.val.val 32;926 pParam1 = (RTGCPTR)param1.val.val64; 920 927 pParam1 = emConvertToFlatAddr(pVM, pRegFrame, pCpu, &pCpu->param1, pParam1); 921 928 … … 1026 1033 return VERR_EM_INTERPRETER; 1027 1034 1028 pParam1 = (RTGCPTR)param1.val.val 32;1035 pParam1 = (RTGCPTR)param1.val.val64; 1029 1036 pParam1 = emConvertToFlatAddr(pVM, pRegFrame, pCpu, &pCpu->param1, pParam1); 1030 1037 … … 1086 1093 uint32_t *pcbSize, PFNEMULATELOCKPARAM2 pfnEmulate) 1087 1094 { 1095 Assert(pCpu->mode != CPUMODE_64BIT); /** @todo check */ 1088 1096 OP_PARAMVAL param1, param2; 1089 1097 int rc = DISQueryParamVal(pRegFrame, pCpu, &pCpu->param1, ¶m1, PARAM_DEST); … … 1099 1107 return VERR_EM_INTERPRETER; 1100 1108 1101 RTGCPTR GCPtrPar1 = (RTGCPTR)param1.val.val 32;1109 RTGCPTR GCPtrPar1 = (RTGCPTR)param1.val.val64; 1102 1110 GCPtrPar1 = emConvertToFlatAddr(pVM, pRegFrame, pCpu, &pCpu->param1, GCPtrPar1); 1103 1111 … … 1147 1155 static int emInterpretMov(PVM pVM, PDISCPUSTATE pCpu, PCPUMCTXCORE pRegFrame, RTGCPTR pvFault, uint32_t *pcbSize) 1148 1156 { 1157 Assert(pCpu->mode != CPUMODE_64BIT); /** @todo check */ 1149 1158 OP_PARAMVAL param1, param2; 1150 1159 int rc = DISQueryParamVal(pRegFrame, pCpu, &pCpu->param1, ¶m1, PARAM_DEST); … … 1167 1176 #endif 1168 1177 RTGCPTR pDest; 1169 uint 32_t val32;1178 uint64_t val64; 1170 1179 1171 1180 switch(param1.type) … … 1177 1186 1178 1187 case PARMTYPE_ADDRESS: 1179 pDest = (RTGCPTR)param1.val.val 32;1188 pDest = (RTGCPTR)param1.val.val64; 1180 1189 pDest = emConvertToFlatAddr(pVM, pRegFrame, pCpu, &pCpu->param1, pDest); 1181 1190 break; … … 1189 1198 { 1190 1199 case PARMTYPE_IMMEDIATE: /* register type is translated to this one too */ 1191 val 32 = param2.val.val32;1200 val64 = param2.val.val64; 1192 1201 break; 1193 1202 … … 1196 1205 return VERR_EM_INTERPRETER; 1197 1206 } 1198 LogFlow(("EMInterpretInstruction at %08x: OP_MOV %VGv <- %08X (%d) &val32=%08x\n", pRegFrame->eip, pDest, val32, param2.size, &val32)); 1199 1200 Assert(param2.size <= 4 && param2.size > 0); 1207 #ifdef LOG_ENABLED 1208 if (pCpu->mode == CPUMODE_64BIT) 1209 LogFlow(("EMInterpretInstruction at %08x: OP_MOV %VGv <- %RX64 (%d) &val32=%08x\n", pRegFrame->eip, pDest, val64, param2.size, &val64)); 1210 else 1211 LogFlow(("EMInterpretInstruction at %08x: OP_MOV %VGv <- %08X (%d) &val32=%08x\n", pRegFrame->eip, pDest, (uint32_t)val64, param2.size, &val64)); 1212 #endif 1213 1214 Assert(param2.size <= 8 && param2.size > 0); 1201 1215 1202 1216 #if 0 /* CSAM/PATM translates aliases which causes this to incorrectly trigger. See #2609 and #1498. */ … … 1206 1220 #endif 1207 1221 #endif 1208 rc = emRamWrite(pVM, pDest, &val 32, param2.size);1222 rc = emRamWrite(pVM, pDest, &val64, param2.size); 1209 1223 if (VBOX_FAILURE(rc)) 1210 1224 return VERR_EM_INTERPRETER; … … 1215 1229 { /* read fault */ 1216 1230 RTGCPTR pSrc; 1217 uint 32_t val32;1231 uint64_t val64; 1218 1232 1219 1233 /* Source */ … … 1226 1240 1227 1241 case PARMTYPE_ADDRESS: 1228 pSrc = (RTGCPTR)param2.val.val 32;1242 pSrc = (RTGCPTR)param2.val.val64; 1229 1243 pSrc = emConvertToFlatAddr(pVM, pRegFrame, pCpu, &pCpu->param2, pSrc); 1230 1244 break; … … 1234 1248 } 1235 1249 1236 Assert(param1.size <= 4&& param1.size > 0);1250 Assert(param1.size <= 8 && param1.size > 0); 1237 1251 #ifdef IN_GC 1238 1252 /* Safety check (in theory it could cross a page boundary and fault there though) */ 1239 1253 AssertReturn(pSrc == pvFault, VERR_EM_INTERPRETER); 1240 1254 #endif 1241 rc = emRamRead(pVM, &val 32, pSrc, param1.size);1255 rc = emRamRead(pVM, &val64, pSrc, param1.size); 1242 1256 if (VBOX_FAILURE(rc)) 1243 1257 return VERR_EM_INTERPRETER; … … 1249 1263 switch(param1.size) 1250 1264 { 1251 case 1: rc = DISWriteReg8(pRegFrame, pCpu->param1.base.reg_gen, (uint8_t)val32); break; 1252 case 2: rc = DISWriteReg16(pRegFrame, pCpu->param1.base.reg_gen, (uint16_t)val32); break; 1253 case 4: rc = DISWriteReg32(pRegFrame, pCpu->param1.base.reg_gen, val32); break; 1265 case 1: rc = DISWriteReg8(pRegFrame, pCpu->param1.base.reg_gen, (uint8_t) val64); break; 1266 case 2: rc = DISWriteReg16(pRegFrame, pCpu->param1.base.reg_gen, (uint16_t)val64); break; 1267 case 4: rc = DISWriteReg32(pRegFrame, pCpu->param1.base.reg_gen, (uint32_t)val64); break; 1268 case 8: rc = DISWriteReg64(pRegFrame, pCpu->param1.base.reg_gen, val64); break; 1254 1269 default: 1255 1270 return VERR_EM_INTERPRETER; … … 1262 1277 return VERR_EM_INTERPRETER; 1263 1278 } 1264 LogFlow(("EMInterpretInstruction: OP_MOV %VGv -> %08X (%d)\n", pSrc, val32, param1.size)); 1279 #ifdef LOG_ENABLED 1280 if (pCpu->mode == CPUMODE_64BIT) 1281 LogFlow(("EMInterpretInstruction: OP_MOV %VGv -> %RX64 (%d)\n", pSrc, val64, param1.size)); 1282 else 1283 LogFlow(("EMInterpretInstruction: OP_MOV %VGv -> %08X (%d)\n", pSrc, (uint32_t)val64, param1.size)); 1284 #endif 1265 1285 } 1266 1286 return VINF_SUCCESS; … … 1277 1297 static int emInterpretCmpXchg(PVM pVM, PDISCPUSTATE pCpu, PCPUMCTXCORE pRegFrame, RTGCPTR pvFault, uint32_t *pcbSize) 1278 1298 { 1299 Assert(pCpu->mode != CPUMODE_64BIT); /** @todo check */ 1279 1300 OP_PARAMVAL param1, param2; 1280 1301 … … 1311 1332 { 1312 1333 case PARMTYPE_ADDRESS: 1313 pParam1 = (RTRCPTR)param1.val.val 32;1334 pParam1 = (RTRCPTR)param1.val.val64; 1314 1335 pParam1 = (RTRCPTR)emConvertToFlatAddr(pVM, pRegFrame, pCpu, &pCpu->param1, (RTGCPTR)(RTRCUINTPTR)pParam1); 1315 1336 … … 1365 1386 static int emInterpretCmpXchg8b(PVM pVM, PDISCPUSTATE pCpu, PCPUMCTXCORE pRegFrame, RTGCPTR pvFault, uint32_t *pcbSize) 1366 1387 { 1388 Assert(pCpu->mode != CPUMODE_64BIT); /** @todo check */ 1367 1389 OP_PARAMVAL param1; 1368 1390 … … 1392 1414 { 1393 1415 case PARMTYPE_ADDRESS: 1394 pParam1 = (RTRCPTR)param1.val.val 32;1416 pParam1 = (RTRCPTR)param1.val.val64; 1395 1417 pParam1 = (RTRCPTR)emConvertToFlatAddr(pVM, pRegFrame, pCpu, &pCpu->param1, (RTGCPTR)(RTRCUINTPTR)pParam1); 1396 1418 … … 1438 1460 static int emInterpretXAdd(PVM pVM, PDISCPUSTATE pCpu, PCPUMCTXCORE pRegFrame, RTGCPTR pvFault, uint32_t *pcbSize) 1439 1461 { 1462 Assert(pCpu->mode != CPUMODE_64BIT); /** @todo check */ 1440 1463 OP_PARAMVAL param1; 1441 1464 uint32_t *pParamReg2; … … 1466 1489 { 1467 1490 case PARMTYPE_ADDRESS: 1468 pParam1 = (RTRCPTR)param1.val.val 32;1491 pParam1 = (RTRCPTR)param1.val.val64; 1469 1492 pParam1 = (RTRCPTR)emConvertToFlatAddr(pVM, pRegFrame, pCpu, &pCpu->param1, (RTGCPTR)(RTRCUINTPTR)pParam1); 1470 1493 … … 1519 1542 RTGCUINTPTR eip, cs, esp, ss, eflags, ds, es, fs, gs, uMask; 1520 1543 int rc; 1544 1545 Assert(!CPUMIsGuestIn64BitCode(pVM, pRegFrame)); 1521 1546 1522 1547 rc = emRamRead(pVM, &eip, (RTGCPTR)pIretStack , 4); … … 1614 1639 case PARMTYPE_IMMEDIATE: 1615 1640 case PARMTYPE_ADDRESS: 1616 if(!(param1.flags & PARAM_VAL32))1641 if(!(param1.flags & (PARAM_VAL32|PARAM_VAL64))) 1617 1642 return VERR_EM_INTERPRETER; 1618 addr = (RTGCPTR)param1.val.val 32;1643 addr = (RTGCPTR)param1.val.val64; 1619 1644 break; 1620 1645 … … 1653 1678 EMDECL(int) EMInterpretCpuId(PVM pVM, PCPUMCTXCORE pRegFrame) 1654 1679 { 1680 /* Note: operates the same in 64 and non-64 bits mode. */ 1655 1681 CPUMGetGuestCpuId(pVM, pRegFrame->eax, &pRegFrame->eax, &pRegFrame->ebx, &pRegFrame->ecx, &pRegFrame->edx); 1656 1682 return VINF_SUCCESS; … … 1686 1712 int rc = CPUMGetGuestCRx(pVM, SrcRegCrx, &val64); 1687 1713 AssertMsgRCReturn(rc, ("CPUMGetGuestCRx %d failed\n", SrcRegCrx), VERR_EM_INTERPRETER); 1688 /** @todo AMD64 */ 1689 rc = DISWriteReg32(pRegFrame, DestRegGen, val64); 1714 1715 if (CPUMIsGuestIn64BitCode(pVM, pRegFrame)) 1716 rc = DISWriteReg64(pRegFrame, DestRegGen, val64); 1717 else 1718 rc = DISWriteReg32(pRegFrame, DestRegGen, val64); 1719 1690 1720 if(VBOX_SUCCESS(rc)) 1691 1721 { … … 1707 1737 EMDECL(int) EMInterpretLMSW(PVM pVM, uint16_t u16Data) 1708 1738 { 1709 uint 32_t OldCr0 = CPUMGetGuestCR0(pVM);1739 uint64_t OldCr0 = CPUMGetGuestCR0(pVM); 1710 1740 1711 1741 /* don't use this path to go into protected mode! */ … … 1715 1745 1716 1746 /* Only PE, MP, EM and TS can be changed; note that PE can't be cleared by this instruction. */ 1717 uint 32_t NewCr0 = ( OldCr0 & ~( X86_CR0_MP | X86_CR0_EM | X86_CR0_TS))1747 uint64_t NewCr0 = ( OldCr0 & ~( X86_CR0_MP | X86_CR0_EM | X86_CR0_TS)) 1718 1748 | (u16Data & (X86_CR0_PE | X86_CR0_MP | X86_CR0_EM | X86_CR0_TS)); 1719 1749 … … 1741 1771 EMDECL(int) EMInterpretCLTS(PVM pVM) 1742 1772 { 1743 uint 32_t cr0 = CPUMGetGuestCR0(pVM);1773 uint64_t cr0 = CPUMGetGuestCR0(pVM); 1744 1774 if (!(cr0 & X86_CR0_TS)) 1745 1775 return VINF_SUCCESS; … … 1764 1794 EMDECL(int) EMInterpretCRxWrite(PVM pVM, PCPUMCTXCORE pRegFrame, uint32_t DestRegCrx, uint32_t SrcRegGen) 1765 1795 { 1766 uint32_t val32; 1767 uint32_t oldval; 1796 uint64_t val; 1797 uint64_t oldval; 1798 int rc; 1799 1768 1800 /** @todo Clean up this mess. */ 1769 1801 1770 /** @todo AMD64 */ 1771 int rc = DISFetchReg32(pRegFrame, SrcRegGen, &val32); 1802 if (CPUMIsGuestIn64BitCode(pVM, pRegFrame)) 1803 { 1804 rc = DISFetchReg64(pRegFrame, SrcRegGen, &val); 1805 } 1806 else 1807 { 1808 uint32_t val32; 1809 rc = DISFetchReg32(pRegFrame, SrcRegGen, &val32); 1810 val = val32; 1811 } 1812 1772 1813 if (VBOX_SUCCESS(rc)) 1773 1814 { … … 1778 1819 #ifdef IN_GC 1779 1820 /* CR0.WP and CR0.AM changes require a reschedule run in ring 3. */ 1780 if ( (val 32& (X86_CR0_WP | X86_CR0_AM))1821 if ( (val & (X86_CR0_WP | X86_CR0_AM)) 1781 1822 != (oldval & (X86_CR0_WP | X86_CR0_AM))) 1782 1823 return VERR_EM_INTERPRETER; 1783 1824 #endif 1784 CPUMSetGuestCR0(pVM, val 32);1785 val 32= CPUMGetGuestCR0(pVM);1825 CPUMSetGuestCR0(pVM, val); 1826 val = CPUMGetGuestCR0(pVM); 1786 1827 if ( (oldval & (X86_CR0_PG | X86_CR0_WP | X86_CR0_PE)) 1787 != (val 32& (X86_CR0_PG | X86_CR0_WP | X86_CR0_PE)))1828 != (val & (X86_CR0_PG | X86_CR0_WP | X86_CR0_PE))) 1788 1829 { 1789 1830 /* global flush */ … … 1794 1835 1795 1836 case USE_REG_CR2: 1796 rc = CPUMSetGuestCR2(pVM, val 32); AssertRC(rc);1837 rc = CPUMSetGuestCR2(pVM, val); AssertRC(rc); 1797 1838 return VINF_SUCCESS; 1798 1839 1799 1840 case USE_REG_CR3: 1800 1841 /* Reloading the current CR3 means the guest just wants to flush the TLBs */ 1801 rc = CPUMSetGuestCR3(pVM, val 32); AssertRC(rc);1842 rc = CPUMSetGuestCR3(pVM, val); AssertRC(rc); 1802 1843 if (CPUMGetGuestCR0(pVM) & X86_CR0_PG) 1803 1844 { 1804 1845 /* flush */ 1805 rc = PGMFlushTLB(pVM, val 32, !(CPUMGetGuestCR4(pVM) & X86_CR4_PGE));1846 rc = PGMFlushTLB(pVM, val, !(CPUMGetGuestCR4(pVM) & X86_CR4_PGE)); 1806 1847 AssertRCReturn(rc, rc); 1807 1848 } … … 1810 1851 case USE_REG_CR4: 1811 1852 oldval = CPUMGetGuestCR4(pVM); 1812 rc = CPUMSetGuestCR4(pVM, val 32); AssertRC(rc);1813 val 32= CPUMGetGuestCR4(pVM);1853 rc = CPUMSetGuestCR4(pVM, val); AssertRC(rc); 1854 val = CPUMGetGuestCR4(pVM); 1814 1855 if ( (oldval & (X86_CR4_PGE|X86_CR4_PAE|X86_CR4_PSE)) 1815 != (val 32& (X86_CR4_PGE|X86_CR4_PAE|X86_CR4_PSE)))1856 != (val & (X86_CR4_PGE|X86_CR4_PAE|X86_CR4_PSE))) 1816 1857 { 1817 1858 /* global flush */ … … 1822 1863 /* Feeling extremely lazy. */ 1823 1864 if ( (oldval & (X86_CR4_OSFSXR|X86_CR4_OSXMMEEXCPT|X86_CR4_PCE|X86_CR4_MCE|X86_CR4_PAE|X86_CR4_DE|X86_CR4_TSD|X86_CR4_PVI|X86_CR4_VME)) 1824 != (val 32& (X86_CR4_OSFSXR|X86_CR4_OSXMMEEXCPT|X86_CR4_PCE|X86_CR4_MCE|X86_CR4_PAE|X86_CR4_DE|X86_CR4_TSD|X86_CR4_PVI|X86_CR4_VME)))1825 { 1826 Log(("emInterpretMovCRx: CR4: %# x->%#x => R3\n", oldval, val32));1865 != (val & (X86_CR4_OSFSXR|X86_CR4_OSXMMEEXCPT|X86_CR4_PCE|X86_CR4_MCE|X86_CR4_PAE|X86_CR4_DE|X86_CR4_TSD|X86_CR4_PVI|X86_CR4_VME))) 1866 { 1867 Log(("emInterpretMovCRx: CR4: %#RX64->%#RX64 => R3\n", oldval, val)); 1827 1868 VM_FF_SET(pVM, VM_FF_TO_R3); 1828 1869 } … … 1841 1882 static int emInterpretMovCRx(PVM pVM, PDISCPUSTATE pCpu, PCPUMCTXCORE pRegFrame, RTGCPTR pvFault, uint32_t *pcbSize) 1842 1883 { 1843 if ( pCpu->param1.flags == USE_REG_GEN32&& pCpu->param2.flags == USE_REG_CR)1884 if ((pCpu->param1.flags == USE_REG_GEN32 || pCpu->param1.flags == USE_REG_GEN64) && pCpu->param2.flags == USE_REG_CR) 1844 1885 return EMInterpretCRxRead(pVM, pRegFrame, pCpu->param1.base.reg_gen, pCpu->param2.base.reg_ctrl); 1845 if (pCpu->param1.flags == USE_REG_CR && pCpu->param2.flags == USE_REG_GEN32) 1886 1887 if (pCpu->param1.flags == USE_REG_CR && (pCpu->param2.flags == USE_REG_GEN32 || pCpu->param2.flags == USE_REG_GEN64)) 1846 1888 return EMInterpretCRxWrite(pVM, pRegFrame, pCpu->param1.base.reg_ctrl, pCpu->param2.base.reg_gen); 1889 1847 1890 AssertMsgFailedReturn(("Unexpected control register move\n"), VERR_EM_INTERPRETER); 1848 1891 return VERR_EM_INTERPRETER; … … 2053 2096 uint32_t u32Dummy, u32ExtFeatures, cpl; 2054 2097 2098 Assert(pCpu->mode != CPUMODE_64BIT); /** @todo check */ 2055 2099 if (pRegFrame->ecx != 0) 2056 2100 return VERR_EM_INTERPRETER; /* illegal value. */ … … 2076 2120 uint32_t u32Dummy, u32ExtFeatures, cpl; 2077 2121 2122 Assert(pCpu->mode != CPUMODE_64BIT); /** @todo check */ 2078 2123 if (pRegFrame->ecx != 0) 2079 2124 return VERR_EM_INTERPRETER; /* illegal value. */ … … 2107 2152 int rc; 2108 2153 2154 /* Note: works the same in 32 and 64 bits modes. */ 2109 2155 rc = CPUMQueryGuestCtxPtr(pVM, &pCtx); 2110 2156 AssertRC(rc); … … 2208 2254 int rc; 2209 2255 2256 /* Note: works the same in 32 and 64 bits modes. */ 2210 2257 rc = CPUMQueryGuestCtxPtr(pVM, &pCtx); 2211 2258 AssertRC(rc);
Note:
See TracChangeset
for help on using the changeset viewer.