Changeset 66391 in vbox
- Timestamp:
- Apr 2, 2017 2:56:59 PM (8 years ago)
- svn:sync-xref-src-repo-rev:
- 114343
- Location:
- trunk
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/VBox/disopcode.h
r66334 r66391 1060 1060 #define OP_PARM_WqZxReg OP_PARM_Wq /**< Annotates that register targets get their upper bits cleared. */ 1061 1061 #define OP_PARM_MbRO OP_PARM_Mb /**< Annotates readonly memory byte operand. */ 1062 #define OP_PARM_MdWO OP_PARM_Md /**< Annotates write only memory byte operand. */ 1062 1063 1063 1064 /** @} */ -
trunk/src/VBox/VMM/VMMAll/IEMAll.cpp
r66357 r66391 6564 6564 6565 6565 /** 6566 * Hook for actualizing the guest XMM0..15 register state for read only. 6566 * Hook for actualizing the guest XMM0..15 and MXCSR register state for read 6567 * only. 6567 6568 * 6568 6569 * This is necessary in ring-0 and raw-mode context (nop in ring-3). … … 6581 6582 6582 6583 /** 6583 * Hook for actualizing the guest XMM0..15 register state for read+write. 6584 * Hook for actualizing the guest XMM0..15 and MXCSR register state for 6585 * read+write. 6584 6586 * 6585 6587 * This is necessary in ring-0 and raw-mode context (nop in ring-3). … … 11427 11429 * Ensures the guest SSE state in the CPUMCTX is up to date. */ 11428 11430 #define IEM_MC_PREPARE_SSE_USAGE() iemFpuPrepareUsageSse(pVCpu) 11429 /** Actualizes the guest XMM0..15 register state for read-only access. */11431 /** Actualizes the guest XMM0..15 and MXCSR register state for read-only access. */ 11430 11432 #define IEM_MC_ACTUALIZE_SSE_STATE_FOR_READ() iemFpuActualizeSseStateForRead(pVCpu) 11431 /** Actualizes the guest XMM0..15 register state for read-write access. */11433 /** Actualizes the guest XMM0..15 and MXCSR register state for read-write access. */ 11432 11434 #define IEM_MC_ACTUALIZE_SSE_STATE_FOR_CHANGE() iemFpuActualizeSseStateForChange(pVCpu) 11433 11435 -
trunk/src/VBox/VMM/VMMAll/IEMAllCImpl.cpp.h
r66356 r66391 7056 7056 7057 7057 /** 7058 * Implements 'STMXCSR'. 7059 * 7060 * @param GCPtrEff The address of the image. 7061 */ 7062 IEM_CIMPL_DEF_2(iemCImpl_stmxcsr, uint8_t, iEffSeg, RTGCPTR, GCPtrEff) 7063 { 7064 PCPUMCTX pCtx = IEM_GET_CTX(pVCpu); 7065 7066 /* 7067 * Raise exceptions. 7068 */ 7069 if ( !(pCtx->cr0 & X86_CR0_EM) 7070 && (pCtx->cr4 & X86_CR4_OSFXSR)) 7071 { 7072 if (!(pCtx->cr0 & X86_CR0_TS)) 7073 { 7074 /* 7075 * Do the job. 7076 */ 7077 VBOXSTRICTRC rcStrict = iemMemStoreDataU32(pVCpu, iEffSeg, GCPtrEff, pCtx->CTX_SUFF(pXState)->x87.MXCSR); 7078 if (rcStrict == VINF_SUCCESS) 7079 { 7080 iemRegAddToRipAndClearRF(pVCpu, cbInstr); 7081 return VINF_SUCCESS; 7082 } 7083 return rcStrict; 7084 } 7085 return iemRaiseDeviceNotAvailable(pVCpu); 7086 } 7087 return iemRaiseUndefinedOpcode(pVCpu); 7088 } 7089 7090 7091 /** 7058 7092 * Commmon routine for fnstenv and fnsave. 7059 7093 * -
trunk/src/VBox/VMM/VMMAll/IEMAllInstructionsPython.py
r66334 r66391 175 175 'Ma': ( 'IDX_UseModRM', 'rm', '%Ma', 'Ma', ), ##< Only used by BOUND. 176 176 'MbRO': ( 'IDX_UseModRM', 'rm', '%Mb', 'Mb', ), 177 'MdWO': ( 'IDX_UseModRM', 'rm', '%Md', 'Md', ), 177 178 'Mq': ( 'IDX_UseModRM', 'rm', '%Mq', 'Mq', ), 178 179 … … 847 848 'oz.r14': ( 'uint', 'both', ), 848 849 'oz.r15': ( 'uint', 'both', ), 850 # FPU Registers 851 'fcw': ( 'uint', 'both', ), 852 'fsw': ( 'uint', 'both', ), 853 'ftw': ( 'uint', 'both', ), 854 'fop': ( 'uint', 'both', ), 855 'fpuip': ( 'uint', 'both', ), 856 'fpucs': ( 'uint', 'both', ), 857 'fpudp': ( 'uint', 'both', ), 858 'fpuds': ( 'uint', 'both', ), 859 'mxcsr': ( 'uint', 'both', ), 860 'st0': ( 'uint', 'both', ), 861 'st1': ( 'uint', 'both', ), 862 'st2': ( 'uint', 'both', ), 863 'st3': ( 'uint', 'both', ), 864 'st4': ( 'uint', 'both', ), 865 'st5': ( 'uint', 'both', ), 866 'st6': ( 'uint', 'both', ), 867 'st7': ( 'uint', 'both', ), 868 # MMX registers. 869 'mm0': ( 'uint', 'both', ), 870 'mm1': ( 'uint', 'both', ), 871 'mm2': ( 'uint', 'both', ), 872 'mm3': ( 'uint', 'both', ), 873 'mm4': ( 'uint', 'both', ), 874 'mm5': ( 'uint', 'both', ), 875 'mm6': ( 'uint', 'both', ), 876 'mm7': ( 'uint', 'both', ), 877 # SSE registers. 878 'xmm0': ( 'uint', 'both', ), 879 'xmm1': ( 'uint', 'both', ), 880 'xmm2': ( 'uint', 'both', ), 881 'xmm3': ( 'uint', 'both', ), 882 'xmm4': ( 'uint', 'both', ), 883 'xmm5': ( 'uint', 'both', ), 884 'xmm6': ( 'uint', 'both', ), 885 'xmm7': ( 'uint', 'both', ), 886 'xmm8': ( 'uint', 'both', ), 887 'xmm9': ( 'uint', 'both', ), 888 'xmm10': ( 'uint', 'both', ), 889 'xmm11': ( 'uint', 'both', ), 890 'xmm12': ( 'uint', 'both', ), 891 'xmm13': ( 'uint', 'both', ), 892 'xmm14': ( 'uint', 'both', ), 893 'xmm15': ( 'uint', 'both', ), 894 'xmm0.lo': ( 'uint', 'both', ), 895 'xmm1.lo': ( 'uint', 'both', ), 896 'xmm2.lo': ( 'uint', 'both', ), 897 'xmm3.lo': ( 'uint', 'both', ), 898 'xmm4.lo': ( 'uint', 'both', ), 899 'xmm5.lo': ( 'uint', 'both', ), 900 'xmm6.lo': ( 'uint', 'both', ), 901 'xmm7.lo': ( 'uint', 'both', ), 902 'xmm8.lo': ( 'uint', 'both', ), 903 'xmm9.lo': ( 'uint', 'both', ), 904 'xmm10.lo': ( 'uint', 'both', ), 905 'xmm11.lo': ( 'uint', 'both', ), 906 'xmm12.lo': ( 'uint', 'both', ), 907 'xmm13.lo': ( 'uint', 'both', ), 908 'xmm14.lo': ( 'uint', 'both', ), 909 'xmm15.lo': ( 'uint', 'both', ), 910 'xmm0.hi': ( 'uint', 'both', ), 911 'xmm1.hi': ( 'uint', 'both', ), 912 'xmm2.hi': ( 'uint', 'both', ), 913 'xmm3.hi': ( 'uint', 'both', ), 914 'xmm4.hi': ( 'uint', 'both', ), 915 'xmm5.hi': ( 'uint', 'both', ), 916 'xmm6.hi': ( 'uint', 'both', ), 917 'xmm7.hi': ( 'uint', 'both', ), 918 'xmm8.hi': ( 'uint', 'both', ), 919 'xmm9.hi': ( 'uint', 'both', ), 920 'xmm10.hi': ( 'uint', 'both', ), 921 'xmm11.hi': ( 'uint', 'both', ), 922 'xmm12.hi': ( 'uint', 'both', ), 923 'xmm13.hi': ( 'uint', 'both', ), 924 'xmm14.hi': ( 'uint', 'both', ), 925 'xmm15.hi': ( 'uint', 'both', ), 926 'xmm0.lo.zx': ( 'uint', 'both', ), 927 'xmm1.lo.zx': ( 'uint', 'both', ), 928 'xmm2.lo.zx': ( 'uint', 'both', ), 929 'xmm3.lo.zx': ( 'uint', 'both', ), 930 'xmm4.lo.zx': ( 'uint', 'both', ), 931 'xmm5.lo.zx': ( 'uint', 'both', ), 932 'xmm6.lo.zx': ( 'uint', 'both', ), 933 'xmm7.lo.zx': ( 'uint', 'both', ), 934 'xmm8.lo.zx': ( 'uint', 'both', ), 935 'xmm9.lo.zx': ( 'uint', 'both', ), 936 'xmm10.lo.zx': ( 'uint', 'both', ), 937 'xmm11.lo.zx': ( 'uint', 'both', ), 938 'xmm12.lo.zx': ( 'uint', 'both', ), 939 'xmm13.lo.zx': ( 'uint', 'both', ), 940 'xmm14.lo.zx': ( 'uint', 'both', ), 941 'xmm15.lo.zx': ( 'uint', 'both', ), 942 'xmm0.dw0': ( 'uint', 'both', ), 943 'xmm1.dw0': ( 'uint', 'both', ), 944 'xmm2.dw0': ( 'uint', 'both', ), 945 'xmm3.dw0': ( 'uint', 'both', ), 946 'xmm4.dw0': ( 'uint', 'both', ), 947 'xmm5.dw0': ( 'uint', 'both', ), 948 'xmm6.dw0': ( 'uint', 'both', ), 949 'xmm7.dw0': ( 'uint', 'both', ), 950 'xmm8.dw0': ( 'uint', 'both', ), 951 'xmm9.dw0': ( 'uint', 'both', ), 952 'xmm10.dw0': ( 'uint', 'both', ), 953 'xmm11.dw0': ( 'uint', 'both', ), 954 'xmm12.dw0': ( 'uint', 'both', ), 955 'xmm13.dw0': ( 'uint', 'both', ), 956 'xmm14.dw0': ( 'uint', 'both', ), 957 'xmm15_dw0': ( 'uint', 'both', ), 958 # AVX registers. 959 'ymm0': ( 'uint', 'both', ), 960 'ymm1': ( 'uint', 'both', ), 961 'ymm2': ( 'uint', 'both', ), 962 'ymm3': ( 'uint', 'both', ), 963 'ymm4': ( 'uint', 'both', ), 964 'ymm5': ( 'uint', 'both', ), 965 'ymm6': ( 'uint', 'both', ), 966 'ymm7': ( 'uint', 'both', ), 967 'ymm8': ( 'uint', 'both', ), 968 'ymm9': ( 'uint', 'both', ), 969 'ymm10': ( 'uint', 'both', ), 970 'ymm11': ( 'uint', 'both', ), 971 'ymm12': ( 'uint', 'both', ), 972 'ymm13': ( 'uint', 'both', ), 973 'ymm14': ( 'uint', 'both', ), 974 'ymm15': ( 'uint', 'both', ), 975 849 976 # Special ones. 850 977 'value.xcpt': ( 'uint', 'output', ), … … 1127 1254 1128 1255 # The /r form: 1129 if sOpcode[0] == '/' and sOpcode[1].isdigit() and len(sOpcode) == 2: 1130 return int(sOpcode[1:]) << 3; 1256 if len(sOpcode) == 4 and sOpcode.startswith('/') and sOpcode[-1].isdigit(): 1257 return int(sOpcode[-1:]) << 3; 1258 1259 # The 11/r form: 1260 if len(sOpcode) == 4 and sOpcode.startswith('11/') and sOpcode[-1].isdigit(): 1261 return (int(sOpcode[-1:]) << 3) | 0xc0; 1262 1263 # The !11/r form (returns mod=1): 1264 ## @todo this doesn't really work... 1265 if len(sOpcode) == 5 and sOpcode.startswith('!11/') and sOpcode[-1].isdigit(): 1266 return (int(sOpcode[-1:]) << 3) | 0x80; 1131 1267 1132 1268 raise Exception('unsupported opcode byte spec "%s" for %s' % (sOpcode, self,)); … … 1797 1933 if _isValidOpcodeByte(sOpcode): 1798 1934 pass; 1799 elif len(sOpcode) == 2 and sOpcode[0] == '/' and sOpcode[1] in '012345678': 1935 elif len(sOpcode) == 2 and sOpcode.startswith('/') and sOpcode[-1] in '012345678': 1936 pass; 1937 elif len(sOpcode) == 4 and sOpcode.startswith('11/') and sOpcode[-1] in '012345678': 1938 pass; 1939 elif len(sOpcode) == 5 and sOpcode.startswith('!11/') and sOpcode[-1] in '012345678': 1800 1940 pass; 1801 1941 else: -
trunk/src/VBox/VMM/VMMAll/IEMAllInstructionsTwoByte0f.cpp.h
r66342 r66391 5797 5797 IEM_MC_CALC_RM_EFF_ADDR(GCPtrEff, bRm, 0); 5798 5798 IEMOP_HLP_DONE_DECODING_NO_LOCK_PREFIX(); 5799 IEM_MC_ACTUALIZE_FPU_STATE_FOR_READ(); 5799 5800 IEM_MC_ASSIGN(iEffSeg, pVCpu->iem.s.iEffSeg); 5800 5801 IEM_MC_CALL_CIMPL_3(iemCImpl_fxsave, iEffSeg, GCPtrEff, enmEffOpSize); … … 5817 5818 IEM_MC_CALC_RM_EFF_ADDR(GCPtrEff, bRm, 0); 5818 5819 IEMOP_HLP_DONE_DECODING_NO_LOCK_PREFIX(); 5820 IEM_MC_ACTUALIZE_FPU_STATE_FOR_CHANGE(); 5819 5821 IEM_MC_ASSIGN(iEffSeg, pVCpu->iem.s.iEffSeg); 5820 5822 IEM_MC_CALL_CIMPL_3(iemCImpl_fxrstor, iEffSeg, GCPtrEff, enmEffOpSize); … … 5827 5829 FNIEMOP_STUB_1(iemOp_Grp15_ldmxcsr, uint8_t, bRm); 5828 5830 5829 /** Opcode 0x0f 0xae mem/3. */ 5830 FNIEMOP_STUB_1(iemOp_Grp15_stmxcsr, uint8_t, bRm); 5831 5832 /** 5833 * @opmaps grp15 5834 * @opcode !11/3 5835 * @oppfx none 5836 * @opcpuid sse 5837 * @opgroup og_cachectl 5838 * @optest mxcsr=0 -> op1=0 5839 * @optest mxcsr=0x2083 -> op1=0x2083 5840 * @oponlytest 5841 */ 5842 FNIEMOP_DEF_1(iemOp_Grp15_stmxcsr, uint8_t, bRm) 5843 { 5844 IEMOP_MNEMONIC1(M_MEM, STMXCSR, stmxcsr, MdWO, DISOPTYPE_HARMLESS, IEMOPHINT_IGNORES_OP_SIZE); 5845 if (!IEM_GET_GUEST_CPU_FEATURES(pVCpu)->fSse) 5846 return IEMOP_RAISE_INVALID_OPCODE(); 5847 5848 IEM_MC_BEGIN(2, 1); 5849 IEM_MC_ARG(uint8_t, iEffSeg, 0); 5850 IEM_MC_ARG(RTGCPTR, GCPtrEff, 1); 5851 IEM_MC_CALC_RM_EFF_ADDR(GCPtrEff, bRm, 0); 5852 IEMOP_HLP_DONE_DECODING_NO_LOCK_PREFIX(); 5853 IEM_MC_ACTUALIZE_SSE_STATE_FOR_READ(); 5854 IEM_MC_ASSIGN(iEffSeg, pVCpu->iem.s.iEffSeg); 5855 IEM_MC_CALL_CIMPL_2(iemCImpl_stmxcsr, iEffSeg, GCPtrEff); 5856 IEM_MC_END(); 5857 return VINF_SUCCESS; 5858 } 5859 5831 5860 5832 5861 /** Opcode 0x0f 0xae mem/4. */ … … 5841 5870 /** 5842 5871 * @opmaps grp15 5843 * @opcode /75872 * @opcode !11/7 5844 5873 * @oppfx none 5845 5874 * @opcpuid clfsh … … 5866 5895 /** 5867 5896 * @opmaps grp15 5868 * @opcode /75897 * @opcode !11/7 5869 5898 * @oppfx 0x66 5870 5899 * @opcpuid clflushopt … … 6559 6588 * @opinvalid intel-modrm 6560 6589 * @optest op1=1 op2=2 -> 6561 * @oponlytest6562 6590 */ 6563 6591 FNIEMOP_DEF(iemOp_Grp10) -
trunk/src/VBox/ValidationKit/bootsectors/bs3-cpu-generated-1-template.c
r66334 r66391 405 405 /* [BS3CG1DST_FPUDS] = */ 2, 406 406 /* [BS3CG1DST_MXCSR] = */ 4, 407 /* [BS3CG1DST_MXCSR_MASK] = */ 4,408 407 /* [BS3CG1DST_ST0] = */ 12, 409 408 /* [BS3CG1DST_ST1] = */ 12, … … 633 632 /* [BS3CG1DST_FPUDS] = */ sizeof(BS3REGCTX) + RT_OFFSETOF(BS3EXTCTX, Ctx.x87.DS), 634 633 /* [BS3CG1DST_MXCSR] = */ sizeof(BS3REGCTX) + RT_OFFSETOF(BS3EXTCTX, Ctx.x87.MXCSR), 635 /* [BS3CG1DST_MXCSR_MASK] = */ sizeof(BS3REGCTX) + RT_OFFSETOF(BS3EXTCTX, Ctx.x87.MXCSR_MASK),636 634 /* [BS3CG1DST_ST0] = */ sizeof(BS3REGCTX) + RT_OFFSETOF(BS3EXTCTX, Ctx.x87.aRegs[0]), 637 635 /* [BS3CG1DST_ST1] = */ sizeof(BS3REGCTX) + RT_OFFSETOF(BS3EXTCTX, Ctx.x87.aRegs[1]), … … 1558 1556 break; 1559 1557 1558 case BS3CG1ENC_MODRM_MdWO: 1559 if (iEncoding == 0) 1560 { 1561 off = Bs3Cg1InsertOpcodes(pThis, Bs3Cg1InsertReqPrefix(pThis, 0)) - 1; 1562 off = Bs3Cfg1EncodeMemMod0Disp(pThis, false, off, 1563 (pThis->abCurInstr[off] & X86_MODRM_REG_MASK) >> X86_MODRM_REG_SHIFT, 1564 4, 0, BS3CG1OPLOC_MEM_RW); 1565 } 1566 else 1567 break; 1568 pThis->cbCurInstr = off; 1569 iEncoding++; 1570 break; 1560 1571 1561 1572 case BS3CG1ENC_FIXED: … … 1826 1837 pThis->aOperands[0].cbOp = 1; 1827 1838 pThis->aOperands[0].enmLocation = BS3CG1OPLOC_MEM; 1839 break; 1840 1841 case BS3CG1ENC_MODRM_MdWO: 1842 pThis->iRmOp = 0; 1843 pThis->aOperands[0].cbOp = 4; 1844 pThis->aOperands[0].enmLocation = BS3CG1OPLOC_MEM_RW; 1828 1845 break; 1829 1846 … … 2675 2692 //CHECK_FIELD(x87.Rsrvd2, "Rsrvd2: %#06x, expected %#06x"); 2676 2693 CHECK_FIELD(x87.MXCSR, "MXCSR: %#010x, expected %#010x"); 2677 //CHECK_FIELD(x87.MXCSR_MASK, "MXCSR_MASK: %#010x, expected %#010x");2678 2694 #undef CHECK_FIELD 2679 2695 for (i = 0; i < RT_ELEMENTS(pExpect->Ctx.x87.aRegs); i++) -
trunk/src/VBox/ValidationKit/bootsectors/bs3-cpu-generated-1.h
r66334 r66391 70 70 BS3CG1OP_Ma, 71 71 BS3CG1OP_MbRO, 72 BS3CG1OP_MdWO, 72 73 BS3CG1OP_Mq, 73 74 … … 103 104 BS3CG1ENC_MODRM_Vdq_Wdq, 104 105 BS3CG1ENC_MODRM_MbRO, 106 BS3CG1ENC_MODRM_MdWO, 105 107 106 108 BS3CG1ENC_FIXED, … … 420 422 BS3CG1DST_FPUDS, 421 423 BS3CG1DST_MXCSR, 422 BS3CG1DST_MXCSR_MASK,423 424 BS3CG1DST_ST0, 424 425 BS3CG1DST_ST1,
Note:
See TracChangeset
for help on using the changeset viewer.