vbox的更動 60384 路徑 trunk/src/VBox/VMM
- 時間撮記:
- 2016-4-8 上午12:16:58 (9 年 以前)
- 位置:
- trunk/src/VBox/VMM
- 檔案:
-
- 修改 5 筆資料
圖例:
- 未更動
- 新增
- 刪除
-
trunk/src/VBox/VMM/VMMAll/IEMAll.cpp
r60189 r60384 9344 9344 */ 9345 9345 9346 #ifdef IN_RING3 9347 # define IEMOP_HLP_MIN_CPU(a_uMinCpu, a_fOnlyIf) \ 9348 do { \ 9349 if (IEM_GET_TARGET_CPU(pIemCpu) >= (a_uMinCpu) || !(a_fOnlyIf)) { } \ 9350 else \ 9351 { \ 9352 DBGFSTOP(IEMCPU_TO_VM(pIemCpu)); \ 9353 return IEMOP_RAISE_INVALID_OPCODE(); \ 9354 } \ 9355 } while (0) 9356 #else 9357 # define IEMOP_HLP_MIN_CPU(a_uMinCpu, a_fOnlyIf) \ 9358 do { \ 9359 if (IEM_GET_TARGET_CPU(pIemCpu) >= (a_uMinCpu) || !(a_fOnlyIf)) { } \ 9360 else return IEMOP_RAISE_INVALID_OPCODE(); \ 9361 } while (0) 9362 #endif 9363 9364 /** The instruction requires a 186 or later. */ 9365 #if IEM_CFG_TARGET_CPU >= IEMTARGETCPU_186 9366 # define IEMOP_HLP_MIN_186() do { } while (0) 9367 #else 9368 # define IEMOP_HLP_MIN_186() IEMOP_HLP_MIN_CPU(IEMTARGETCPU_186, true) 9369 #endif 9370 9371 /** The instruction requires a 286 or later. */ 9372 #if IEM_CFG_TARGET_CPU >= IEMTARGETCPU_286 9373 # define IEMOP_HLP_MIN_286() do { } while (0) 9374 #else 9375 # define IEMOP_HLP_MIN_286() IEMOP_HLP_MIN_CPU(IEMTARGETCPU_286, true) 9376 #endif 9377 9378 /** The instruction requires a 386 or later. */ 9379 #if IEM_CFG_TARGET_CPU >= IEMTARGETCPU_386 9380 # define IEMOP_HLP_MIN_386() do { } while (0) 9381 #else 9382 # define IEMOP_HLP_MIN_386() IEMOP_HLP_MIN_CPU(IEMTARGETCPU_386, true) 9383 #endif 9384 9385 /** The instruction requires a 386 or later if the given expression is true. */ 9386 #if IEM_CFG_TARGET_CPU >= IEMTARGETCPU_386 9387 # define IEMOP_HLP_MIN_386_EX(a_fOnlyIf) do { } while (0) 9388 #else 9389 # define IEMOP_HLP_MIN_386_EX(a_fOnlyIf) IEMOP_HLP_MIN_CPU(IEMTARGETCPU_386, a_fOnlyIf) 9390 #endif 9391 9392 /** The instruction requires a 486 or later. */ 9393 #if IEM_CFG_TARGET_CPU >= IEMTARGETCPU_486 9394 # define IEMOP_HLP_MIN_486() do { } while (0) 9395 #else 9396 # define IEMOP_HLP_MIN_486() IEMOP_HLP_MIN_CPU(IEMTARGETCPU_486, true) 9397 #endif 9398 9399 /** The instruction requires a Pentium (586) or later. */ 9400 #if IEM_CFG_TARGET_CPU >= IEMTARGETCPU_586 9401 # define IEMOP_HLP_MIN_586() do { } while (0) 9402 #else 9403 # define IEMOP_HLP_MIN_586() IEMOP_HLP_MIN_CPU(IEMTARGETCPU_586, true) 9404 #endif 9405 9406 /** The instruction requires a PentiumPro (686) or later. */ 9407 #if IEM_CFG_TARGET_CPU >= IEMTARGETCPU_686 9408 # define IEMOP_HLP_MIN_686() do { } while (0) 9409 #else 9410 # define IEMOP_HLP_MIN_686() IEMOP_HLP_MIN_CPU(IEMTARGETCPU_686, true) 9411 #endif 9412 9413 9346 9414 /** The instruction raises an \#UD in real and V8086 mode. */ 9347 9415 #define IEMOP_HLP_NO_REAL_OR_V86_MODE() \ -
trunk/src/VBox/VMM/VMMAll/IEMAllInstructions.cpp.h
r60188 r60384 541 541 { 542 542 IEMOP_MNEMONIC("sldt Rv/Mw"); 543 IEMOP_HLP_MIN_286(); 543 544 IEMOP_HLP_NO_REAL_OR_V86_MODE(); 544 545 … … 598 599 { 599 600 IEMOP_MNEMONIC("str Rv/Mw"); 601 IEMOP_HLP_MIN_286(); 600 602 IEMOP_HLP_NO_REAL_OR_V86_MODE(); 601 603 … … 655 657 { 656 658 IEMOP_MNEMONIC("lldt Ew"); 659 IEMOP_HLP_MIN_286(); 657 660 IEMOP_HLP_NO_REAL_OR_V86_MODE(); 658 661 … … 686 689 { 687 690 IEMOP_MNEMONIC("ltr Ew"); 691 IEMOP_HLP_MIN_286(); 688 692 IEMOP_HLP_NO_REAL_OR_V86_MODE(); 689 693 … … 716 720 FNIEMOP_DEF_2(iemOpCommonGrp6VerX, uint8_t, bRm, bool, fWrite) 717 721 { 722 IEMOP_HLP_MIN_286(); 718 723 IEMOP_HLP_NO_REAL_OR_V86_MODE(); 719 724 … … 748 753 { 749 754 IEMOP_MNEMONIC("verr Ew"); 755 IEMOP_HLP_MIN_286(); 750 756 return FNIEMOP_CALL_2(iemOpCommonGrp6VerX, bRm, false); 751 757 } … … 756 762 { 757 763 IEMOP_MNEMONIC("verr Ew"); 764 IEMOP_HLP_MIN_286(); 758 765 return FNIEMOP_CALL_2(iemOpCommonGrp6VerX, bRm, true); 759 766 } … … 784 791 { 785 792 IEMOP_MNEMONIC("sgdt Ms"); 793 IEMOP_HLP_MIN_286(); 786 794 IEMOP_HLP_64BIT_OP_SIZE(); 787 795 IEM_MC_BEGIN(3, 1); … … 834 842 { 835 843 IEMOP_MNEMONIC("sidt Ms"); 844 IEMOP_HLP_MIN_286(); 836 845 IEMOP_HLP_64BIT_OP_SIZE(); 837 846 IEM_MC_BEGIN(3, 1); … … 957 966 { 958 967 IEMOP_MNEMONIC("smsw"); 968 IEMOP_HLP_MIN_286(); 959 969 IEMOP_HLP_NO_LOCK_PREFIX(); 960 970 if ((bRm & X86_MODRM_MOD_MASK) == (3 << X86_MODRM_MOD_SHIFT)) … … 1014 1024 lower 3-bits are used. */ 1015 1025 IEMOP_MNEMONIC("lmsw"); 1026 IEMOP_HLP_MIN_286(); 1016 1027 IEMOP_HLP_NO_LOCK_PREFIX(); 1017 1028 if ((bRm & X86_MODRM_MOD_MASK) == (3 << X86_MODRM_MOD_SHIFT)) … … 1041 1052 { 1042 1053 IEMOP_MNEMONIC("invlpg"); 1054 IEMOP_HLP_MIN_486(); 1043 1055 IEMOP_HLP_NO_LOCK_PREFIX(); 1044 1056 IEM_MC_BEGIN(1, 1); … … 1055 1067 { 1056 1068 IEMOP_MNEMONIC("swapgs"); 1069 IEMOP_HLP_ONLY_64BIT(); 1057 1070 IEMOP_HLP_NO_LOCK_PREFIX(); 1058 IEMOP_HLP_ONLY_64BIT();1059 1071 return IEM_MC_DEFER_TO_CIMPL_0(iemCImpl_swapgs); 1060 1072 } … … 1267 1279 1268 1280 1269 /** Opcode 0x0f 0x0 4. */1281 /** Opcode 0x0f 0x05. */ 1270 1282 FNIEMOP_DEF(iemOp_syscall) 1271 1283 { 1272 IEMOP_MNEMONIC("syscall"); 1284 IEMOP_MNEMONIC("syscall"); /** @todo 286 LOADALL */ 1273 1285 IEMOP_HLP_NO_LOCK_PREFIX(); 1274 1286 return IEM_MC_DEFER_TO_CIMPL_0(iemCImpl_syscall); … … 1276 1288 1277 1289 1278 /** Opcode 0x0f 0x0 5. */1290 /** Opcode 0x0f 0x06. */ 1279 1291 FNIEMOP_DEF(iemOp_clts) 1280 1292 { … … 1285 1297 1286 1298 1287 /** Opcode 0x0f 0x0 6. */1299 /** Opcode 0x0f 0x07. */ 1288 1300 FNIEMOP_DEF(iemOp_sysret) 1289 1301 { 1290 IEMOP_MNEMONIC("sysret"); 1302 IEMOP_MNEMONIC("sysret"); /** @todo 386 LOADALL */ 1291 1303 IEMOP_HLP_NO_LOCK_PREFIX(); 1292 1304 return IEM_MC_DEFER_TO_CIMPL_0(iemCImpl_sysret); … … 1296 1308 /** Opcode 0x0f 0x08. */ 1297 1309 FNIEMOP_STUB(iemOp_invd); 1310 // IEMOP_HLP_MIN_486(); 1298 1311 1299 1312 … … 1302 1315 { 1303 1316 IEMOP_MNEMONIC("wbinvd"); 1317 IEMOP_HLP_MIN_486(); 1304 1318 IEMOP_HLP_NO_LOCK_PREFIX(); 1305 1319 IEM_MC_BEGIN(0, 0); … … 1555 1569 /* mod is ignored, as is operand size overrides. */ 1556 1570 IEMOP_MNEMONIC("mov Rd,Cd"); 1571 IEMOP_HLP_MIN_386(); 1557 1572 if (pIemCpu->enmCpuMode == IEMMODE_64BIT) 1558 1573 pIemCpu->enmEffOpSize = pIemCpu->enmDefOpSize = IEMMODE_64BIT; … … 1586 1601 { 1587 1602 IEMOP_MNEMONIC("mov Rd,Dd"); 1603 IEMOP_HLP_MIN_386(); 1588 1604 uint8_t bRm; IEM_OPCODE_GET_NEXT_U8(&bRm); 1589 1605 IEMOP_HLP_NO_LOCK_PREFIX(); … … 1601 1617 /* mod is ignored, as is operand size overrides. */ 1602 1618 IEMOP_MNEMONIC("mov Cd,Rd"); 1619 IEMOP_HLP_MIN_386(); 1603 1620 if (pIemCpu->enmCpuMode == IEMMODE_64BIT) 1604 1621 pIemCpu->enmEffOpSize = pIemCpu->enmDefOpSize = IEMMODE_64BIT; … … 1632 1649 { 1633 1650 IEMOP_MNEMONIC("mov Dd,Rd"); 1651 IEMOP_HLP_MIN_386(); 1634 1652 uint8_t bRm; IEM_OPCODE_GET_NEXT_U8(&bRm); 1635 1653 IEMOP_HLP_DONE_DECODING_NO_LOCK_PREFIX(); … … 1646 1664 { 1647 1665 IEMOP_MNEMONIC("mov Rd,Td"); 1666 /** @todo works on 386 and 486. */ 1648 1667 /* The RM byte is not considered, see testcase. */ 1649 1668 return IEMOP_RAISE_INVALID_OPCODE(); … … 1655 1674 { 1656 1675 IEMOP_MNEMONIC("mov Td,Rd"); 1676 /** @todo works on 386 and 486. */ 1657 1677 /* The RM byte is not considered, see testcase. */ 1658 1678 return IEMOP_RAISE_INVALID_OPCODE(); … … 3122 3142 { 3123 3143 IEMOP_MNEMONIC("jo Jv"); 3144 IEMOP_HLP_MIN_386(); 3124 3145 IEMOP_HLP_DEFAULT_64BIT_OP_SIZE(); 3125 3146 if (pIemCpu->enmEffOpSize == IEMMODE_16BIT) … … 3157 3178 { 3158 3179 IEMOP_MNEMONIC("jno Jv"); 3180 IEMOP_HLP_MIN_386(); 3159 3181 IEMOP_HLP_DEFAULT_64BIT_OP_SIZE(); 3160 3182 if (pIemCpu->enmEffOpSize == IEMMODE_16BIT) … … 3192 3214 { 3193 3215 IEMOP_MNEMONIC("jc/jb/jnae Jv"); 3216 IEMOP_HLP_MIN_386(); 3194 3217 IEMOP_HLP_DEFAULT_64BIT_OP_SIZE(); 3195 3218 if (pIemCpu->enmEffOpSize == IEMMODE_16BIT) … … 3227 3250 { 3228 3251 IEMOP_MNEMONIC("jnc/jnb/jae Jv"); 3252 IEMOP_HLP_MIN_386(); 3229 3253 IEMOP_HLP_DEFAULT_64BIT_OP_SIZE(); 3230 3254 if (pIemCpu->enmEffOpSize == IEMMODE_16BIT) … … 3262 3286 { 3263 3287 IEMOP_MNEMONIC("je/jz Jv"); 3288 IEMOP_HLP_MIN_386(); 3264 3289 IEMOP_HLP_DEFAULT_64BIT_OP_SIZE(); 3265 3290 if (pIemCpu->enmEffOpSize == IEMMODE_16BIT) … … 3297 3322 { 3298 3323 IEMOP_MNEMONIC("jne/jnz Jv"); 3324 IEMOP_HLP_MIN_386(); 3299 3325 IEMOP_HLP_DEFAULT_64BIT_OP_SIZE(); 3300 3326 if (pIemCpu->enmEffOpSize == IEMMODE_16BIT) … … 3332 3358 { 3333 3359 IEMOP_MNEMONIC("jbe/jna Jv"); 3360 IEMOP_HLP_MIN_386(); 3334 3361 IEMOP_HLP_DEFAULT_64BIT_OP_SIZE(); 3335 3362 if (pIemCpu->enmEffOpSize == IEMMODE_16BIT) … … 3367 3394 { 3368 3395 IEMOP_MNEMONIC("jnbe/ja Jv"); 3396 IEMOP_HLP_MIN_386(); 3369 3397 IEMOP_HLP_DEFAULT_64BIT_OP_SIZE(); 3370 3398 if (pIemCpu->enmEffOpSize == IEMMODE_16BIT) … … 3402 3430 { 3403 3431 IEMOP_MNEMONIC("js Jv"); 3432 IEMOP_HLP_MIN_386(); 3404 3433 IEMOP_HLP_DEFAULT_64BIT_OP_SIZE(); 3405 3434 if (pIemCpu->enmEffOpSize == IEMMODE_16BIT) … … 3437 3466 { 3438 3467 IEMOP_MNEMONIC("jns Jv"); 3468 IEMOP_HLP_MIN_386(); 3439 3469 IEMOP_HLP_DEFAULT_64BIT_OP_SIZE(); 3440 3470 if (pIemCpu->enmEffOpSize == IEMMODE_16BIT) … … 3472 3502 { 3473 3503 IEMOP_MNEMONIC("jp Jv"); 3504 IEMOP_HLP_MIN_386(); 3474 3505 IEMOP_HLP_DEFAULT_64BIT_OP_SIZE(); 3475 3506 if (pIemCpu->enmEffOpSize == IEMMODE_16BIT) … … 3507 3538 { 3508 3539 IEMOP_MNEMONIC("jo Jv"); 3540 IEMOP_HLP_MIN_386(); 3509 3541 IEMOP_HLP_DEFAULT_64BIT_OP_SIZE(); 3510 3542 if (pIemCpu->enmEffOpSize == IEMMODE_16BIT) … … 3542 3574 { 3543 3575 IEMOP_MNEMONIC("jl/jnge Jv"); 3576 IEMOP_HLP_MIN_386(); 3544 3577 IEMOP_HLP_DEFAULT_64BIT_OP_SIZE(); 3545 3578 if (pIemCpu->enmEffOpSize == IEMMODE_16BIT) … … 3577 3610 { 3578 3611 IEMOP_MNEMONIC("jnl/jge Jv"); 3612 IEMOP_HLP_MIN_386(); 3579 3613 IEMOP_HLP_DEFAULT_64BIT_OP_SIZE(); 3580 3614 if (pIemCpu->enmEffOpSize == IEMMODE_16BIT) … … 3612 3646 { 3613 3647 IEMOP_MNEMONIC("jle/jng Jv"); 3648 IEMOP_HLP_MIN_386(); 3614 3649 IEMOP_HLP_DEFAULT_64BIT_OP_SIZE(); 3615 3650 if (pIemCpu->enmEffOpSize == IEMMODE_16BIT) … … 3647 3682 { 3648 3683 IEMOP_MNEMONIC("jnle/jg Jv"); 3684 IEMOP_HLP_MIN_386(); 3649 3685 IEMOP_HLP_DEFAULT_64BIT_OP_SIZE(); 3650 3686 if (pIemCpu->enmEffOpSize == IEMMODE_16BIT) … … 3682 3718 { 3683 3719 IEMOP_MNEMONIC("seto Eb"); 3720 IEMOP_HLP_MIN_386(); 3684 3721 uint8_t bRm; IEM_OPCODE_GET_NEXT_U8(&bRm); 3685 3722 IEMOP_HLP_NO_LOCK_PREFIX(); /** @todo too early? */ … … 3722 3759 { 3723 3760 IEMOP_MNEMONIC("setno Eb"); 3761 IEMOP_HLP_MIN_386(); 3724 3762 uint8_t bRm; IEM_OPCODE_GET_NEXT_U8(&bRm); 3725 3763 IEMOP_HLP_NO_LOCK_PREFIX(); /** @todo too early? */ … … 3762 3800 { 3763 3801 IEMOP_MNEMONIC("setc Eb"); 3802 IEMOP_HLP_MIN_386(); 3764 3803 uint8_t bRm; IEM_OPCODE_GET_NEXT_U8(&bRm); 3765 3804 IEMOP_HLP_NO_LOCK_PREFIX(); /** @todo too early? */ … … 3802 3841 { 3803 3842 IEMOP_MNEMONIC("setnc Eb"); 3843 IEMOP_HLP_MIN_386(); 3804 3844 uint8_t bRm; IEM_OPCODE_GET_NEXT_U8(&bRm); 3805 3845 IEMOP_HLP_NO_LOCK_PREFIX(); /** @todo too early? */ … … 3842 3882 { 3843 3883 IEMOP_MNEMONIC("sete Eb"); 3884 IEMOP_HLP_MIN_386(); 3844 3885 uint8_t bRm; IEM_OPCODE_GET_NEXT_U8(&bRm); 3845 3886 IEMOP_HLP_NO_LOCK_PREFIX(); /** @todo too early? */ … … 3882 3923 { 3883 3924 IEMOP_MNEMONIC("setne Eb"); 3925 IEMOP_HLP_MIN_386(); 3884 3926 uint8_t bRm; IEM_OPCODE_GET_NEXT_U8(&bRm); 3885 3927 IEMOP_HLP_NO_LOCK_PREFIX(); /** @todo too early? */ … … 3922 3964 { 3923 3965 IEMOP_MNEMONIC("setbe Eb"); 3966 IEMOP_HLP_MIN_386(); 3924 3967 uint8_t bRm; IEM_OPCODE_GET_NEXT_U8(&bRm); 3925 3968 IEMOP_HLP_NO_LOCK_PREFIX(); /** @todo too early? */ … … 3962 4005 { 3963 4006 IEMOP_MNEMONIC("setnbe Eb"); 4007 IEMOP_HLP_MIN_386(); 3964 4008 uint8_t bRm; IEM_OPCODE_GET_NEXT_U8(&bRm); 3965 4009 IEMOP_HLP_NO_LOCK_PREFIX(); /** @todo too early? */ … … 4002 4046 { 4003 4047 IEMOP_MNEMONIC("sets Eb"); 4048 IEMOP_HLP_MIN_386(); 4004 4049 uint8_t bRm; IEM_OPCODE_GET_NEXT_U8(&bRm); 4005 4050 IEMOP_HLP_NO_LOCK_PREFIX(); /** @todo too early? */ … … 4042 4087 { 4043 4088 IEMOP_MNEMONIC("setns Eb"); 4089 IEMOP_HLP_MIN_386(); 4044 4090 uint8_t bRm; IEM_OPCODE_GET_NEXT_U8(&bRm); 4045 4091 IEMOP_HLP_NO_LOCK_PREFIX(); /** @todo too early? */ … … 4082 4128 { 4083 4129 IEMOP_MNEMONIC("setnp Eb"); 4130 IEMOP_HLP_MIN_386(); 4084 4131 uint8_t bRm; IEM_OPCODE_GET_NEXT_U8(&bRm); 4085 4132 IEMOP_HLP_NO_LOCK_PREFIX(); /** @todo too early? */ … … 4122 4169 { 4123 4170 IEMOP_MNEMONIC("setnp Eb"); 4171 IEMOP_HLP_MIN_386(); 4124 4172 uint8_t bRm; IEM_OPCODE_GET_NEXT_U8(&bRm); 4125 4173 IEMOP_HLP_NO_LOCK_PREFIX(); /** @todo too early? */ … … 4162 4210 { 4163 4211 IEMOP_MNEMONIC("setl Eb"); 4212 IEMOP_HLP_MIN_386(); 4164 4213 uint8_t bRm; IEM_OPCODE_GET_NEXT_U8(&bRm); 4165 4214 IEMOP_HLP_NO_LOCK_PREFIX(); /** @todo too early? */ … … 4202 4251 { 4203 4252 IEMOP_MNEMONIC("setnl Eb"); 4253 IEMOP_HLP_MIN_386(); 4204 4254 uint8_t bRm; IEM_OPCODE_GET_NEXT_U8(&bRm); 4205 4255 IEMOP_HLP_NO_LOCK_PREFIX(); /** @todo too early? */ … … 4242 4292 { 4243 4293 IEMOP_MNEMONIC("setle Eb"); 4294 IEMOP_HLP_MIN_386(); 4244 4295 uint8_t bRm; IEM_OPCODE_GET_NEXT_U8(&bRm); 4245 4296 IEMOP_HLP_NO_LOCK_PREFIX(); /** @todo too early? */ … … 4282 4333 { 4283 4334 IEMOP_MNEMONIC("setnle Eb"); 4335 IEMOP_HLP_MIN_386(); 4284 4336 uint8_t bRm; IEM_OPCODE_GET_NEXT_U8(&bRm); 4285 4337 IEMOP_HLP_NO_LOCK_PREFIX(); /** @todo too early? */ … … 4366 4418 { 4367 4419 IEMOP_MNEMONIC("push fs"); 4420 IEMOP_HLP_MIN_386(); 4368 4421 IEMOP_HLP_NO_LOCK_PREFIX(); 4369 4422 return FNIEMOP_CALL_1(iemOpCommonPushSReg, X86_SREG_FS); … … 4375 4428 { 4376 4429 IEMOP_MNEMONIC("pop fs"); 4430 IEMOP_HLP_MIN_386(); 4377 4431 IEMOP_HLP_NO_LOCK_PREFIX(); 4378 4432 return IEM_MC_DEFER_TO_CIMPL_2(iemCImpl_pop_Sreg, X86_SREG_FS, pIemCpu->enmEffOpSize); … … 4384 4438 { 4385 4439 IEMOP_MNEMONIC("cpuid"); 4440 IEMOP_HLP_MIN_486(); /* not all 486es. */ 4386 4441 IEMOP_HLP_NO_LOCK_PREFIX(); 4387 4442 return IEM_MC_DEFER_TO_CIMPL_0(iemCImpl_cpuid); … … 4571 4626 { 4572 4627 IEMOP_MNEMONIC("bt Gv,Gv"); 4628 IEMOP_HLP_MIN_386(); 4573 4629 return FNIEMOP_CALL_1(iemOpCommonBit_Ev_Gv, &g_iemAImpl_bt); 4574 4630 } … … 4871 4927 { 4872 4928 IEMOP_MNEMONIC("shld Ev,Gv,Ib"); 4929 IEMOP_HLP_MIN_386(); 4873 4930 return FNIEMOP_CALL_1(iemOpCommonShldShrd_Ib, &g_iemAImpl_shld); 4874 4931 } 4875 4932 4876 4933 4877 /** Opcode 0x0f 0xa 7. */4934 /** Opcode 0x0f 0xa5. */ 4878 4935 FNIEMOP_DEF(iemOp_shld_Ev_Gv_CL) 4879 4936 { 4880 4937 IEMOP_MNEMONIC("shld Ev,Gv,CL"); 4938 IEMOP_HLP_MIN_386(); 4881 4939 return FNIEMOP_CALL_1(iemOpCommonShldShrd_CL, &g_iemAImpl_shld); 4882 4940 } … … 4887 4945 { 4888 4946 IEMOP_MNEMONIC("push gs"); 4947 IEMOP_HLP_MIN_386(); 4889 4948 IEMOP_HLP_NO_LOCK_PREFIX(); 4890 4949 return FNIEMOP_CALL_1(iemOpCommonPushSReg, X86_SREG_GS); … … 4896 4955 { 4897 4956 IEMOP_MNEMONIC("pop gs"); 4957 IEMOP_HLP_MIN_386(); 4898 4958 IEMOP_HLP_NO_LOCK_PREFIX(); 4899 4959 return IEM_MC_DEFER_TO_CIMPL_2(iemCImpl_pop_Sreg, X86_SREG_GS, pIemCpu->enmEffOpSize); … … 4903 4963 /** Opcode 0x0f 0xaa. */ 4904 4964 FNIEMOP_STUB(iemOp_rsm); 4965 //IEMOP_HLP_MIN_386(); 4905 4966 4906 4967 … … 4909 4970 { 4910 4971 IEMOP_MNEMONIC("bts Ev,Gv"); 4972 IEMOP_HLP_MIN_386(); 4911 4973 return FNIEMOP_CALL_1(iemOpCommonBit_Ev_Gv, &g_iemAImpl_bts); 4912 4974 } … … 4917 4979 { 4918 4980 IEMOP_MNEMONIC("shrd Ev,Gv,Ib"); 4981 IEMOP_HLP_MIN_386(); 4919 4982 return FNIEMOP_CALL_1(iemOpCommonShldShrd_Ib, &g_iemAImpl_shrd); 4920 4983 } … … 4925 4988 { 4926 4989 IEMOP_MNEMONIC("shrd Ev,Gv,CL"); 4990 IEMOP_HLP_MIN_386(); 4927 4991 return FNIEMOP_CALL_1(iemOpCommonShldShrd_CL, &g_iemAImpl_shrd); 4928 4992 } … … 5061 5125 FNIEMOP_DEF(iemOp_Grp15) 5062 5126 { 5127 IEMOP_HLP_MIN_586(); /* Not entirely accurate nor needed, but useful for debugging 286 code. */ 5063 5128 uint8_t bRm; IEM_OPCODE_GET_NEXT_U8(&bRm); 5064 5129 if ((bRm & X86_MODRM_MOD_MASK) != (3 << X86_MODRM_MOD_SHIFT)) … … 5122 5187 { 5123 5188 IEMOP_MNEMONIC("imul Gv,Ev"); 5189 IEMOP_HLP_MIN_386(); 5124 5190 IEMOP_VERIFICATION_UNDEFINED_EFLAGS(X86_EFL_SF | X86_EFL_ZF | X86_EFL_AF | X86_EFL_PF); 5125 5191 return FNIEMOP_CALL_1(iemOpHlpBinaryOperator_rv_rm, &g_iemAImpl_imul_two); … … 5131 5197 { 5132 5198 IEMOP_MNEMONIC("cmpxchg Eb,Gb"); 5199 IEMOP_HLP_MIN_486(); 5133 5200 uint8_t bRm; IEM_OPCODE_GET_NEXT_U8(&bRm); 5134 5201 … … 5189 5256 { 5190 5257 IEMOP_MNEMONIC("cmpxchg Ev,Gv"); 5258 IEMOP_HLP_MIN_486(); 5191 5259 uint8_t bRm; IEM_OPCODE_GET_NEXT_U8(&bRm); 5192 5260 … … 5446 5514 { 5447 5515 IEMOP_MNEMONIC("lss Gv,Mp"); 5516 IEMOP_HLP_MIN_386(); 5448 5517 uint8_t bRm; IEM_OPCODE_GET_NEXT_U8(&bRm); 5449 5518 if ((bRm & X86_MODRM_MOD_MASK) == (3 << X86_MODRM_MOD_SHIFT)) … … 5465 5534 { 5466 5535 IEMOP_MNEMONIC("lfs Gv,Mp"); 5536 IEMOP_HLP_MIN_386(); 5467 5537 uint8_t bRm; IEM_OPCODE_GET_NEXT_U8(&bRm); 5468 5538 if ((bRm & X86_MODRM_MOD_MASK) == (3 << X86_MODRM_MOD_SHIFT)) … … 5476 5546 { 5477 5547 IEMOP_MNEMONIC("lgs Gv,Mp"); 5548 IEMOP_HLP_MIN_386(); 5478 5549 uint8_t bRm; IEM_OPCODE_GET_NEXT_U8(&bRm); 5479 5550 if ((bRm & X86_MODRM_MOD_MASK) == (3 << X86_MODRM_MOD_SHIFT)) … … 5487 5558 { 5488 5559 IEMOP_MNEMONIC("movzx Gv,Eb"); 5560 IEMOP_HLP_MIN_386(); 5489 5561 5490 5562 uint8_t bRm; IEM_OPCODE_GET_NEXT_U8(&bRm); … … 5578 5650 { 5579 5651 IEMOP_MNEMONIC("movzx Gv,Ew"); 5652 IEMOP_HLP_MIN_386(); 5580 5653 5581 5654 uint8_t bRm; IEM_OPCODE_GET_NEXT_U8(&bRm); … … 5656 5729 FNIEMOP_DEF(iemOp_Grp8) 5657 5730 { 5731 IEMOP_HLP_MIN_386(); 5658 5732 uint8_t bRm; IEM_OPCODE_GET_NEXT_U8(&bRm); 5659 5733 PCIEMOPBINSIZES pImpl; … … 5820 5894 { 5821 5895 IEMOP_MNEMONIC("btc Ev,Gv"); 5896 IEMOP_HLP_MIN_386(); 5822 5897 return FNIEMOP_CALL_1(iemOpCommonBit_Ev_Gv, &g_iemAImpl_btc); 5823 5898 } … … 5828 5903 { 5829 5904 IEMOP_MNEMONIC("bsf Gv,Ev"); 5905 IEMOP_HLP_MIN_386(); 5830 5906 IEMOP_VERIFICATION_UNDEFINED_EFLAGS(X86_EFL_OF | X86_EFL_SF | X86_EFL_AF | X86_EFL_PF | X86_EFL_CF); 5831 5907 return FNIEMOP_CALL_1(iemOpHlpBinaryOperator_rv_rm, &g_iemAImpl_bsf); … … 5837 5913 { 5838 5914 IEMOP_MNEMONIC("bsr Gv,Ev"); 5915 IEMOP_HLP_MIN_386(); 5839 5916 IEMOP_VERIFICATION_UNDEFINED_EFLAGS(X86_EFL_OF | X86_EFL_SF | X86_EFL_AF | X86_EFL_PF | X86_EFL_CF); 5840 5917 return FNIEMOP_CALL_1(iemOpHlpBinaryOperator_rv_rm, &g_iemAImpl_bsr); … … 5846 5923 { 5847 5924 IEMOP_MNEMONIC("movsx Gv,Eb"); 5925 IEMOP_HLP_MIN_386(); 5848 5926 5849 5927 uint8_t bRm; IEM_OPCODE_GET_NEXT_U8(&bRm); … … 5937 6015 { 5938 6016 IEMOP_MNEMONIC("movsx Gv,Ew"); 6017 IEMOP_HLP_MIN_386(); 5939 6018 5940 6019 uint8_t bRm; IEM_OPCODE_GET_NEXT_U8(&bRm); … … 6004 6083 { 6005 6084 uint8_t bRm; IEM_OPCODE_GET_NEXT_U8(&bRm); 6085 IEMOP_HLP_MIN_486(); 6006 6086 IEMOP_MNEMONIC("xadd Eb,Gb"); 6007 6087 … … 6063 6143 { 6064 6144 IEMOP_MNEMONIC("xadd Ev,Gv"); 6145 IEMOP_HLP_MIN_486(); 6065 6146 uint8_t bRm; IEM_OPCODE_GET_NEXT_U8(&bRm); 6066 6147 … … 6385 6466 prefix. REX.B is the correct prefix it appears. For a parallel 6386 6467 case, see iemOp_mov_AL_Ib and iemOp_mov_eAX_Iv. */ 6468 IEMOP_HLP_MIN_486(); 6387 6469 return FNIEMOP_CALL_1(iemOpCommonBswapGReg, X86_GREG_xAX | pIemCpu->uRexB); 6388 6470 } … … 6393 6475 { 6394 6476 IEMOP_MNEMONIC("bswap rCX/r9"); 6477 IEMOP_HLP_MIN_486(); 6395 6478 return FNIEMOP_CALL_1(iemOpCommonBswapGReg, X86_GREG_xCX | pIemCpu->uRexB); 6396 6479 } … … 6401 6484 { 6402 6485 IEMOP_MNEMONIC("bswap rDX/r9"); 6486 IEMOP_HLP_MIN_486(); 6403 6487 return FNIEMOP_CALL_1(iemOpCommonBswapGReg, X86_GREG_xDX | pIemCpu->uRexB); 6404 6488 } … … 6409 6493 { 6410 6494 IEMOP_MNEMONIC("bswap rBX/r9"); 6495 IEMOP_HLP_MIN_486(); 6411 6496 return FNIEMOP_CALL_1(iemOpCommonBswapGReg, X86_GREG_xBX | pIemCpu->uRexB); 6412 6497 } … … 6417 6502 { 6418 6503 IEMOP_MNEMONIC("bswap rSP/r12"); 6504 IEMOP_HLP_MIN_486(); 6419 6505 return FNIEMOP_CALL_1(iemOpCommonBswapGReg, X86_GREG_xSP | pIemCpu->uRexB); 6420 6506 } … … 6425 6511 { 6426 6512 IEMOP_MNEMONIC("bswap rBP/r13"); 6513 IEMOP_HLP_MIN_486(); 6427 6514 return FNIEMOP_CALL_1(iemOpCommonBswapGReg, X86_GREG_xBP | pIemCpu->uRexB); 6428 6515 } … … 6433 6520 { 6434 6521 IEMOP_MNEMONIC("bswap rSI/r14"); 6522 IEMOP_HLP_MIN_486(); 6435 6523 return FNIEMOP_CALL_1(iemOpCommonBswapGReg, X86_GREG_xSI | pIemCpu->uRexB); 6436 6524 } … … 6441 6529 { 6442 6530 IEMOP_MNEMONIC("bswap rDI/r15"); 6531 IEMOP_HLP_MIN_486(); 6443 6532 return FNIEMOP_CALL_1(iemOpCommonBswapGReg, X86_GREG_xDI | pIemCpu->uRexB); 6444 6533 } … … 6999 7088 { 7000 7089 uint8_t b; IEM_OPCODE_GET_NEXT_U8(&b); 7090 /** @todo PUSH CS on 8086, undefined on 80186. */ 7091 IEMOP_HLP_MIN_286(); 7001 7092 return FNIEMOP_CALL(g_apfnTwoByteMap[b]); 7002 7093 } … … 8084 8175 { 8085 8176 IEMOP_MNEMONIC("pusha"); 8177 IEMOP_HLP_MIN_186(); 8086 8178 IEMOP_HLP_NO_64BIT(); 8087 8179 if (pIemCpu->enmEffOpSize == IEMMODE_16BIT) … … 8096 8188 { 8097 8189 IEMOP_MNEMONIC("popa"); 8190 IEMOP_HLP_MIN_186(); 8098 8191 IEMOP_HLP_NO_64BIT(); 8099 8192 if (pIemCpu->enmEffOpSize == IEMMODE_16BIT) … … 8106 8199 /** Opcode 0x62. */ 8107 8200 FNIEMOP_STUB(iemOp_bound_Gv_Ma_evex); 8201 // IEMOP_HLP_MIN_186(); 8108 8202 8109 8203 … … 8112 8206 { 8113 8207 IEMOP_MNEMONIC("arpl Ew,Gw"); 8208 IEMOP_HLP_MIN_286(); 8114 8209 IEMOP_HLP_NO_REAL_OR_V86_MODE(); 8115 8210 uint8_t bRm; IEM_OPCODE_GET_NEXT_U8(&bRm); … … 8205 8300 { 8206 8301 IEMOP_HLP_CLEAR_REX_NOT_BEFORE_OPCODE("seg fs"); 8302 IEMOP_HLP_MIN_386(); 8303 8207 8304 pIemCpu->fPrefixes |= IEM_OP_PRF_SEG_FS; 8208 8305 pIemCpu->iEffSeg = X86_SREG_FS; … … 8217 8314 { 8218 8315 IEMOP_HLP_CLEAR_REX_NOT_BEFORE_OPCODE("seg gs"); 8316 IEMOP_HLP_MIN_386(); 8317 8219 8318 pIemCpu->fPrefixes |= IEM_OP_PRF_SEG_GS; 8220 8319 pIemCpu->iEffSeg = X86_SREG_GS; … … 8229 8328 { 8230 8329 IEMOP_HLP_CLEAR_REX_NOT_BEFORE_OPCODE("op size"); 8330 IEMOP_HLP_MIN_386(); 8331 8231 8332 pIemCpu->fPrefixes |= IEM_OP_PRF_SIZE_OP; 8232 8333 iemRecalEffOpSize(pIemCpu); … … 8241 8342 { 8242 8343 IEMOP_HLP_CLEAR_REX_NOT_BEFORE_OPCODE("addr size"); 8344 IEMOP_HLP_MIN_386(); 8345 8243 8346 pIemCpu->fPrefixes |= IEM_OP_PRF_SIZE_ADDR; 8244 8347 switch (pIemCpu->enmDefAddrMode) … … 8259 8362 { 8260 8363 IEMOP_MNEMONIC("push Iz"); 8364 IEMOP_HLP_MIN_186(); 8261 8365 IEMOP_HLP_DEFAULT_64BIT_OP_SIZE(); 8262 8366 switch (pIemCpu->enmEffOpSize) … … 8304 8408 { 8305 8409 IEMOP_MNEMONIC("imul Gv,Ev,Iz"); /* Gv = Ev * Iz; */ 8410 IEMOP_HLP_MIN_186(); 8306 8411 uint8_t bRm; IEM_OPCODE_GET_NEXT_U8(&bRm); 8307 8412 IEMOP_VERIFICATION_UNDEFINED_EFLAGS(X86_EFL_SF | X86_EFL_ZF | X86_EFL_AF | X86_EFL_PF); … … 8464 8569 { 8465 8570 IEMOP_MNEMONIC("push Ib"); 8571 IEMOP_HLP_MIN_186(); 8466 8572 int8_t i8Imm; IEM_OPCODE_GET_NEXT_S8(&i8Imm); 8467 8573 IEMOP_HLP_NO_LOCK_PREFIX(); … … 8491 8597 { 8492 8598 IEMOP_MNEMONIC("imul Gv,Ev,Ib"); /* Gv = Ev * Iz; */ 8599 IEMOP_HLP_MIN_186(); 8493 8600 uint8_t bRm; IEM_OPCODE_GET_NEXT_U8(&bRm); 8494 8601 IEMOP_VERIFICATION_UNDEFINED_EFLAGS(X86_EFL_SF | X86_EFL_ZF | X86_EFL_AF | X86_EFL_PF); … … 8644 8751 FNIEMOP_DEF(iemOp_insb_Yb_DX) 8645 8752 { 8753 IEMOP_HLP_MIN_186(); 8646 8754 IEMOP_HLP_NO_LOCK_PREFIX(); 8647 8755 if (pIemCpu->fPrefixes & (IEM_OP_PRF_REPNZ | IEM_OP_PRF_REPZ)) … … 8673 8781 FNIEMOP_DEF(iemOp_inswd_Yv_DX) 8674 8782 { 8783 IEMOP_HLP_MIN_186(); 8675 8784 IEMOP_HLP_NO_LOCK_PREFIX(); 8676 8785 if (pIemCpu->fPrefixes & (IEM_OP_PRF_REPZ | IEM_OP_PRF_REPNZ)) … … 8734 8843 FNIEMOP_DEF(iemOp_outsb_Yb_DX) 8735 8844 { 8845 IEMOP_HLP_MIN_186(); 8736 8846 IEMOP_HLP_NO_LOCK_PREFIX(); 8737 8847 if (pIemCpu->fPrefixes & (IEM_OP_PRF_REPNZ | IEM_OP_PRF_REPZ)) … … 8763 8873 FNIEMOP_DEF(iemOp_outswd_Yv_DX) 8764 8874 { 8875 IEMOP_HLP_MIN_186(); 8765 8876 IEMOP_HLP_NO_LOCK_PREFIX(); 8766 8877 if (pIemCpu->fPrefixes & (IEM_OP_PRF_REPZ | IEM_OP_PRF_REPNZ)) … … 9373 9484 uint8_t bRm; IEM_OPCODE_GET_NEXT_U8(&bRm); 9374 9485 IEMOP_MNEMONIC2("add\0or\0\0adc\0sbb\0and\0sub\0xor\0cmp" + ((bRm >> X86_MODRM_REG_SHIFT) & X86_MODRM_REG_SMASK)*4, "Ev,Ib"); 9486 /* Note! Seems the OR, AND, and XOR instructions are present on CPUs prior 9487 to the 386 even if absent in the intel reference manuals and some 9488 3rd party opcode listings. */ 9375 9489 PCIEMOPBINSIZES pImpl = g_apIemImplGrp1[(bRm >> X86_MODRM_REG_SHIFT) & X86_MODRM_REG_SMASK]; 9376 9490 … … 11766 11880 FNIEMOP_DEF(iemOp_Grp2_Eb_Ib) 11767 11881 { 11882 IEMOP_HLP_MIN_186(); 11768 11883 uint8_t bRm; IEM_OPCODE_GET_NEXT_U8(&bRm); 11769 11884 PCIEMOPSHIFTSIZES pImpl; … … 11826 11941 FNIEMOP_DEF(iemOp_Grp2_Ev_Ib) 11827 11942 { 11943 IEMOP_HLP_MIN_186(); 11828 11944 uint8_t bRm; IEM_OPCODE_GET_NEXT_U8(&bRm); 11829 11945 PCIEMOPSHIFTSIZES pImpl; … … 12164 12280 { 12165 12281 IEMOP_MNEMONIC("enter Iw,Ib"); 12282 IEMOP_HLP_MIN_186(); 12166 12283 IEMOP_HLP_DEFAULT_64BIT_OP_SIZE(); 12167 12284 IEMOP_HLP_NO_LOCK_PREFIX(); … … 12176 12293 { 12177 12294 IEMOP_MNEMONIC("retn"); 12295 IEMOP_HLP_MIN_186(); 12178 12296 IEMOP_HLP_DEFAULT_64BIT_OP_SIZE(); 12179 12297 IEMOP_HLP_NO_LOCK_PREFIX(); … … 12656 12774 { 12657 12775 IEMOP_MNEMONIC("salc"); 12776 IEMOP_HLP_MIN_286(); /* (undocument at the time) */ 12658 12777 uint8_t bImm; IEM_OPCODE_GET_NEXT_U8(&bImm); 12659 12778 IEMOP_HLP_DONE_DECODING_NO_LOCK_PREFIX(); … … 16204 16323 { 16205 16324 IEMOP_MNEMONIC("int1"); /* icebp */ 16325 IEMOP_HLP_MIN_386(); /** @todo does not generate #UD on 286, or so they say... */ 16206 16326 /** @todo testcase! */ 16207 16327 return IEM_MC_DEFER_TO_CIMPL_2(iemCImpl_int, X86_XCPT_DB, false /*fIsBpInstr*/); … … 16239 16359 { 16240 16360 IEMOP_HLP_NO_LOCK_PREFIX(); 16361 #if IEM_CFG_TARGET_CPU == IEMTARGETCPU_DYNAMIC && 0 16362 if ( pIemCpu->uTargetCpu == IEMTARGETCPU_CURRENT 16363 && pIemCpu->CTX_SUFF(pCtx)->cs.Sel <= 1000) 16364 { 16365 pIemCpu->uTargetCpu = IEMTARGETCPU_286; 16366 LogAlways(("\niemOp_hlt: Enabled CPU restrictions!\n\n")); 16367 } 16368 #endif 16241 16369 return IEM_MC_DEFER_TO_CIMPL_0(iemCImpl_hlt); 16242 16370 } -
trunk/src/VBox/VMM/VMMR3/IEMR3.cpp
r58122 r60384 72 72 * Host and guest CPU information. 73 73 */ 74 #if IEM_CFG_TARGET_CPU == IEMTARGETCPU_DYNAMIC 75 pVCpu->iem.s.uTargetCpu = IEMTARGETCPU_CURRENT; 76 #endif 74 77 if (idCpu == 0) 75 78 { -
trunk/src/VBox/VMM/include/IEMInternal.h
r60188 r60384 48 48 # define IEM_VERIFICATION_MODE_FULL 49 49 #endif 50 51 52 /** @def IEM_CFG_TARGET_CPU 53 * The minimum target CPU for the IEM emulation (IEMTARGETCPU_XXX value). The 54 * default is the a "current" CPU, i.e. something newer than the pentium pro. By 55 * twiddling this value, you can make IEM try behave like older CPUs which is 56 * useful when checking software that needs to run on real old CPUs. 57 */ 58 #if !defined(IEM_CFG_TARGET_CPU) || defined(DOXYGEN_RUNNING) 59 # define IEM_CFG_TARGET_CPU IEMTARGETCPU_CURRENT 60 /*# define IEM_CFG_TARGET_CPU IEMTARGETCPU_DYNAMIC*/ 61 #endif 62 50 63 51 64 … … 382 395 uint8_t offFpuOpcode; 383 396 384 /** @} */397 /** @} */ 385 398 386 399 /** The number of active guest memory mappings. */ … … 451 464 /** @name Target CPU information. 452 465 * @{ */ 466 #if IEM_CFG_TARGET_CPU == IEMTARGETCPU_DYNAMIC 467 /** The target CPU. */ 468 uint32_t uTargetCpu; 469 #else 470 uint32_t u32TargetCpuPadding; 471 #endif 453 472 /** The CPU vendor. */ 454 473 CPUMCPUVENDOR enmCpuVendor; … … 460 479 CPUMCPUVENDOR enmHostCpuVendor; 461 480 /** @} */ 481 482 uint32_t u32Alignment6; /**< Alignment padding. */ 462 483 463 484 #ifdef IEM_VERIFICATION_MODE_FULL … … 490 511 */ 491 512 #define IEMCPU_TO_VM(a_pIemCpu) ((PVM)( (uintptr_t)(a_pIemCpu) + a_pIemCpu->offVM )) 513 514 /** Gets the current IEMTARGETCPU value. 515 * @returns IEMTARGETCPU value. 516 * @param a_pIemCpu The IEM per CPU instance data. 517 */ 518 #if IEM_CFG_TARGET_CPU != IEMTARGETCPU_DYNAMIC 519 # define IEM_GET_TARGET_CPU(a_pIemCpu) (IEM_CFG_TARGET_CPU) 520 #else 521 # define IEM_GET_TARGET_CPU(a_pIemCpu) ((a_pIemCpu)->uTargetCpu) 522 #endif 492 523 493 524 /** @name IEM_ACCESS_XXX - Access details. -
trunk/src/VBox/VMM/testcase/tstIEMCheckMc.cpp
r57432 r60384 100 100 #define IEM_OPCODE_GET_NEXT_S32_SX_U64(a_pu64) do { *(a_pu64) = g_bRandom; CHK_PTYPE(uint64_t *, a_pu64); } while (0) 101 101 #define IEM_OPCODE_GET_NEXT_U64(a_pu64) do { *(a_pu64) = g_bRandom; CHK_PTYPE(uint64_t *, a_pu64); } while (0) 102 #define IEMOP_HLP_MIN_186() do { } while (0) 103 #define IEMOP_HLP_MIN_286() do { } while (0) 104 #define IEMOP_HLP_MIN_386() do { } while (0) 105 #define IEMOP_HLP_MIN_386_EX(a_fTrue) do { } while (0) 106 #define IEMOP_HLP_MIN_486() do { } while (0) 107 #define IEMOP_HLP_MIN_586() do { } while (0) 108 #define IEMOP_HLP_MIN_686() do { } while (0) 102 109 #define IEMOP_HLP_NO_REAL_OR_V86_MODE() do { } while (0) 103 110 #define IEMOP_HLP_NO_LOCK_PREFIX() do { } while (0)
注意:
瀏覽 TracChangeset
來幫助您使用更動檢視器