Changeset 66331 in vbox
- Timestamp:
- Mar 29, 2017 11:36:49 AM (8 years ago)
- Location:
- trunk
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/VBox/disopcode.h
r66327 r66331 730 730 OP_MWAIT, 731 731 OP_CLFLUSH, 732 OP_CLFLUSHOPT, 732 733 OP_MOV_DR, 733 734 OP_MOV_TR, -
trunk/src/VBox/VMM/VMMAll/IEMAllInstructionsPython.py
r66327 r66331 298 298 ## \@opcpuid 299 299 g_kdCpuIdFlags = { 300 'vme': 'X86_CPUID_FEATURE_EDX_VME', 301 'tsc': 'X86_CPUID_FEATURE_EDX_TSC', 302 'msr': 'X86_CPUID_FEATURE_EDX_MSR', 303 'cx8': 'X86_CPUID_FEATURE_EDX_CX8', 304 'sep': 'X86_CPUID_FEATURE_EDX_SEP', 305 'cmov': 'X86_CPUID_FEATURE_EDX_CMOV', 306 'clfsh': 'X86_CPUID_FEATURE_EDX_CLFSH', 307 'mmx': 'X86_CPUID_FEATURE_EDX_MMX', 308 'fxsr': 'X86_CPUID_FEATURE_EDX_FXSR', 309 'sse': 'X86_CPUID_FEATURE_EDX_SSE', 310 'sse2': 'X86_CPUID_FEATURE_EDX_SSE2', 311 'sse3': 'X86_CPUID_FEATURE_ECX_SSE3', 312 'pclmul': 'X86_CPUID_FEATURE_ECX_DTES64', 313 'monitor': 'X86_CPUID_FEATURE_ECX_CPLDS', 314 'vmx': 'X86_CPUID_FEATURE_ECX_VMX', 315 'smx': 'X86_CPUID_FEATURE_ECX_TM2', 316 'ssse3': 'X86_CPUID_FEATURE_ECX_SSSE3', 317 'fma': 'X86_CPUID_FEATURE_ECX_FMA', 318 'cx16': 'X86_CPUID_FEATURE_ECX_CX16', 319 'pcid': 'X86_CPUID_FEATURE_ECX_PCID', 320 'sse41': 'X86_CPUID_FEATURE_ECX_SSE4_1', 321 'sse42': 'X86_CPUID_FEATURE_ECX_SSE4_2', 322 'movbe': 'X86_CPUID_FEATURE_ECX_MOVBE', 323 'popcnt': 'X86_CPUID_FEATURE_ECX_POPCNT', 324 'aes': 'X86_CPUID_FEATURE_ECX_AES', 325 'xsave': 'X86_CPUID_FEATURE_ECX_XSAVE', 326 'avx': 'X86_CPUID_FEATURE_ECX_AVX', 327 'f16c': 'X86_CPUID_FEATURE_ECX_F16C', 328 'rdrand': 'X86_CPUID_FEATURE_ECX_RDRAND', 329 330 'axmmx': 'X86_CPUID_AMD_FEATURE_EDX_AXMMX', 331 '3dnowext': 'X86_CPUID_AMD_FEATURE_EDX_3DNOW_EX', 332 '3dnow': 'X86_CPUID_AMD_FEATURE_EDX_3DNOW', 333 'svm': 'X86_CPUID_AMD_FEATURE_ECX_SVM', 334 'cr8l': 'X86_CPUID_AMD_FEATURE_ECX_CR8L', 335 'abm': 'X86_CPUID_AMD_FEATURE_ECX_ABM', 336 'sse4a': 'X86_CPUID_AMD_FEATURE_ECX_SSE4A', 337 '3dnowprf': 'X86_CPUID_AMD_FEATURE_ECX_3DNOWPRF', 338 'xop': 'X86_CPUID_AMD_FEATURE_ECX_XOP', 339 'fma4': 'X86_CPUID_AMD_FEATURE_ECX_FMA4', 300 'vme': 'X86_CPUID_FEATURE_EDX_VME', 301 'tsc': 'X86_CPUID_FEATURE_EDX_TSC', 302 'msr': 'X86_CPUID_FEATURE_EDX_MSR', 303 'cx8': 'X86_CPUID_FEATURE_EDX_CX8', 304 'sep': 'X86_CPUID_FEATURE_EDX_SEP', 305 'cmov': 'X86_CPUID_FEATURE_EDX_CMOV', 306 'clfsh': 'X86_CPUID_FEATURE_EDX_CLFSH', 307 'clflushopt': 'X86_CPUID_STEXT_FEATURE_EBX_CLFLUSHOPT', 308 'mmx': 'X86_CPUID_FEATURE_EDX_MMX', 309 'fxsr': 'X86_CPUID_FEATURE_EDX_FXSR', 310 'sse': 'X86_CPUID_FEATURE_EDX_SSE', 311 'sse2': 'X86_CPUID_FEATURE_EDX_SSE2', 312 'sse3': 'X86_CPUID_FEATURE_ECX_SSE3', 313 'pclmul': 'X86_CPUID_FEATURE_ECX_DTES64', 314 'monitor': 'X86_CPUID_FEATURE_ECX_CPLDS', 315 'vmx': 'X86_CPUID_FEATURE_ECX_VMX', 316 'smx': 'X86_CPUID_FEATURE_ECX_TM2', 317 'ssse3': 'X86_CPUID_FEATURE_ECX_SSSE3', 318 'fma': 'X86_CPUID_FEATURE_ECX_FMA', 319 'cx16': 'X86_CPUID_FEATURE_ECX_CX16', 320 'pcid': 'X86_CPUID_FEATURE_ECX_PCID', 321 'sse41': 'X86_CPUID_FEATURE_ECX_SSE4_1', 322 'sse42': 'X86_CPUID_FEATURE_ECX_SSE4_2', 323 'movbe': 'X86_CPUID_FEATURE_ECX_MOVBE', 324 'popcnt': 'X86_CPUID_FEATURE_ECX_POPCNT', 325 'aes': 'X86_CPUID_FEATURE_ECX_AES', 326 'xsave': 'X86_CPUID_FEATURE_ECX_XSAVE', 327 'avx': 'X86_CPUID_FEATURE_ECX_AVX', 328 'f16c': 'X86_CPUID_FEATURE_ECX_F16C', 329 'rdrand': 'X86_CPUID_FEATURE_ECX_RDRAND', 330 331 'axmmx': 'X86_CPUID_AMD_FEATURE_EDX_AXMMX', 332 '3dnowext': 'X86_CPUID_AMD_FEATURE_EDX_3DNOW_EX', 333 '3dnow': 'X86_CPUID_AMD_FEATURE_EDX_3DNOW', 334 'svm': 'X86_CPUID_AMD_FEATURE_ECX_SVM', 335 'cr8l': 'X86_CPUID_AMD_FEATURE_ECX_CR8L', 336 'abm': 'X86_CPUID_AMD_FEATURE_ECX_ABM', 337 'sse4a': 'X86_CPUID_AMD_FEATURE_ECX_SSE4A', 338 '3dnowprf': 'X86_CPUID_AMD_FEATURE_ECX_3DNOWPRF', 339 'xop': 'X86_CPUID_AMD_FEATURE_ECX_XOP', 340 'fma4': 'X86_CPUID_AMD_FEATURE_ECX_FMA4', 340 341 }; 341 342 -
trunk/src/VBox/VMM/VMMAll/IEMAllInstructionsTwoByte0f.cpp.h
r66327 r66331 5844 5844 * @oppfx none 5845 5845 * @opcpuid clfsh 5846 * @opgroup og_ sse2_cachectl5846 * @opgroup og_cachectl 5847 5847 * @optest op1=1 -> 5848 5848 * @oponlytest … … 5866 5866 } 5867 5867 5868 /** 5869 * @opmaps grp15 5870 * @opcode /7 5871 * @oppfx 0x66 5872 * @opcpuid clflushopt 5873 * @opgroup og_cachectl 5874 * @optest op1=1 -> 5875 * @oponlytest 5876 */ 5877 FNIEMOP_DEF_1(iemOp_Grp15_clflushopt, uint8_t, bRm) 5878 { 5879 IEMOP_MNEMONIC1(M_MEM, CLFLUSHOPT, clflushopt, MbRO, DISOPTYPE_HARMLESS, IEMOPHINT_IGNORES_OP_SIZE); 5880 if (!IEM_GET_GUEST_CPU_FEATURES(pVCpu)->fClFlushOpt) 5881 return IEMOP_RAISE_INVALID_OPCODE(); 5882 5883 IEM_MC_BEGIN(2, 0); 5884 IEM_MC_ARG(uint8_t, iEffSeg, 0); 5885 IEM_MC_ARG(RTGCPTR, GCPtrEff, 1); 5886 IEM_MC_CALC_RM_EFF_ADDR(GCPtrEff, bRm, 0); 5887 IEMOP_HLP_DONE_DECODING_NO_LOCK_PREFIX(); 5888 IEM_MC_ASSIGN(iEffSeg, pVCpu->iem.s.iEffSeg); 5889 IEM_MC_CALL_CIMPL_2(iemCImpl_clflush_clflushopt, iEffSeg, GCPtrEff); 5890 IEM_MC_END(); 5891 return VINF_SUCCESS; 5892 } 5893 5868 5894 5869 5895 /** Opcode 0x0f 0xae 11b/5. */ … … 5940 5966 5941 5967 5968 /** 5969 * Group 15 jump table for register variant. 5970 */ 5971 IEM_STATIC const PFNIEMOPRM g_apfnGroup15RegReg[] = 5972 { /* pfx: none, 066h, 0f3h, 0f2h */ 5973 /* /0 */ iemOp_InvalidWithRM, iemOp_InvalidWithRM, iemOp_Grp15_rdfsbase, iemOp_InvalidWithRM, 5974 /* /1 */ iemOp_InvalidWithRM, iemOp_InvalidWithRM, iemOp_Grp15_rdgsbase, iemOp_InvalidWithRM, 5975 /* /2 */ iemOp_InvalidWithRM, iemOp_InvalidWithRM, iemOp_Grp15_wrfsbase, iemOp_InvalidWithRM, 5976 /* /3 */ iemOp_InvalidWithRM, iemOp_InvalidWithRM, iemOp_Grp15_wrgsbase, iemOp_InvalidWithRM, 5977 /* /4 */ IEMOP_X4(iemOp_InvalidWithRM), 5978 /* /5 */ iemOp_Grp15_lfence, iemOp_InvalidWithRM, iemOp_InvalidWithRM, iemOp_InvalidWithRM, 5979 /* /6 */ iemOp_Grp15_mfence, iemOp_InvalidWithRM, iemOp_InvalidWithRM, iemOp_InvalidWithRM, 5980 /* /7 */ iemOp_Grp15_sfence, iemOp_InvalidWithRM, iemOp_InvalidWithRM, iemOp_InvalidWithRM, 5981 }; 5982 AssertCompile(RT_ELEMENTS(g_apfnGroup15RegReg) == 8*4); 5983 5984 5985 /** 5986 * Group 15 jump table for memory variant. 5987 */ 5988 IEM_STATIC const PFNIEMOPRM g_apfnGroup15MemReg[] = 5989 { /* pfx: none, 066h, 0f3h, 0f2h */ 5990 /* /0 */ iemOp_Grp15_fxsave, iemOp_InvalidWithRM, iemOp_InvalidWithRM, iemOp_InvalidWithRM, 5991 /* /1 */ iemOp_Grp15_fxrstor, iemOp_InvalidWithRM, iemOp_InvalidWithRM, iemOp_InvalidWithRM, 5992 /* /2 */ iemOp_Grp15_ldmxcsr, iemOp_InvalidWithRM, iemOp_InvalidWithRM, iemOp_InvalidWithRM, 5993 /* /3 */ iemOp_Grp15_stmxcsr, iemOp_InvalidWithRM, iemOp_InvalidWithRM, iemOp_InvalidWithRM, 5994 /* /4 */ iemOp_Grp15_xsave, iemOp_InvalidWithRM, iemOp_InvalidWithRM, iemOp_InvalidWithRM, 5995 /* /5 */ iemOp_Grp15_xrstor, iemOp_InvalidWithRM, iemOp_InvalidWithRM, iemOp_InvalidWithRM, 5996 /* /6 */ iemOp_Grp15_xsaveopt, iemOp_InvalidWithRM, iemOp_InvalidWithRM, iemOp_InvalidWithRM, 5997 /* /7 */ iemOp_Grp15_clflush, iemOp_Grp15_clflushopt, iemOp_InvalidWithRM, iemOp_InvalidWithRM, 5998 }; 5999 AssertCompile(RT_ELEMENTS(g_apfnGroup15MemReg) == 8*4); 6000 6001 5942 6002 /** Opcode 0x0f 0xae. */ 5943 6003 FNIEMOP_DEF(iemOp_Grp15) 5944 6004 { 5945 /** @todo continue here tomorrow! (see bs3-cpu-decoding-1.c32 r113507). */5946 6005 IEMOP_HLP_MIN_586(); /* Not entirely accurate nor needed, but useful for debugging 286 code. */ 5947 6006 uint8_t bRm; IEM_OPCODE_GET_NEXT_U8(&bRm); 5948 if ((bRm & X86_MODRM_MOD_MASK) != (3 << X86_MODRM_MOD_SHIFT)) 5949 { 5950 switch ((bRm >> X86_MODRM_REG_SHIFT) & X86_MODRM_REG_SMASK) 5951 { 5952 case 0: return FNIEMOP_CALL_1(iemOp_Grp15_fxsave, bRm); 5953 case 1: return FNIEMOP_CALL_1(iemOp_Grp15_fxrstor, bRm); 5954 case 2: return FNIEMOP_CALL_1(iemOp_Grp15_ldmxcsr, bRm); 5955 case 3: return FNIEMOP_CALL_1(iemOp_Grp15_stmxcsr, bRm); 5956 case 4: return FNIEMOP_CALL_1(iemOp_Grp15_xsave, bRm); 5957 case 5: return FNIEMOP_CALL_1(iemOp_Grp15_xrstor, bRm); 5958 case 6: return FNIEMOP_CALL_1(iemOp_Grp15_xsaveopt,bRm); 5959 case 7: return FNIEMOP_CALL_1(iemOp_Grp15_clflush, bRm); 5960 IEM_NOT_REACHED_DEFAULT_CASE_RET(); 5961 } 5962 } 5963 else 5964 { 5965 switch (pVCpu->iem.s.fPrefixes & (IEM_OP_PRF_REPZ | IEM_OP_PRF_REPNZ | IEM_OP_PRF_SIZE_OP | IEM_OP_PRF_LOCK)) 5966 { 5967 case 0: 5968 switch ((bRm >> X86_MODRM_REG_SHIFT) & X86_MODRM_REG_SMASK) 5969 { 5970 case 0: return IEMOP_RAISE_INVALID_OPCODE(); 5971 case 1: return IEMOP_RAISE_INVALID_OPCODE(); 5972 case 2: return IEMOP_RAISE_INVALID_OPCODE(); 5973 case 3: return IEMOP_RAISE_INVALID_OPCODE(); 5974 case 4: return IEMOP_RAISE_INVALID_OPCODE(); 5975 case 5: return FNIEMOP_CALL_1(iemOp_Grp15_lfence, bRm); 5976 case 6: return FNIEMOP_CALL_1(iemOp_Grp15_mfence, bRm); 5977 case 7: return FNIEMOP_CALL_1(iemOp_Grp15_sfence, bRm); 5978 IEM_NOT_REACHED_DEFAULT_CASE_RET(); 5979 } 5980 break; 5981 5982 case IEM_OP_PRF_REPZ: 5983 switch ((bRm >> X86_MODRM_REG_SHIFT) & X86_MODRM_REG_SMASK) 5984 { 5985 case 0: return FNIEMOP_CALL_1(iemOp_Grp15_rdfsbase, bRm); 5986 case 1: return FNIEMOP_CALL_1(iemOp_Grp15_rdgsbase, bRm); 5987 case 2: return FNIEMOP_CALL_1(iemOp_Grp15_wrfsbase, bRm); 5988 case 3: return FNIEMOP_CALL_1(iemOp_Grp15_wrgsbase, bRm); 5989 case 4: return IEMOP_RAISE_INVALID_OPCODE(); 5990 case 5: return IEMOP_RAISE_INVALID_OPCODE(); 5991 case 6: return IEMOP_RAISE_INVALID_OPCODE(); 5992 case 7: return IEMOP_RAISE_INVALID_OPCODE(); 5993 IEM_NOT_REACHED_DEFAULT_CASE_RET(); 5994 } 5995 break; 5996 5997 default: 5998 return IEMOP_RAISE_INVALID_OPCODE(); 5999 } 6000 } 6007 if ((bRm & X86_MODRM_MOD_MASK) == (3 << X86_MODRM_MOD_SHIFT)) 6008 /* register, register */ 6009 return FNIEMOP_CALL_1(g_apfnGroup15RegReg[ ((bRm >> X86_MODRM_REG_SHIFT) & X86_MODRM_REG_SMASK) * 4 6010 + pVCpu->iem.s.idxPrefix], bRm); 6011 /* memory, register */ 6012 return FNIEMOP_CALL_1(g_apfnGroup15MemReg[ ((bRm >> X86_MODRM_REG_SHIFT) & X86_MODRM_REG_SMASK) * 4 6013 + pVCpu->iem.s.idxPrefix], bRm); 6001 6014 } 6002 6015 -
trunk/src/VBox/VMM/VMMR3/CPUMR3CpuId.cpp
r66327 r66331 1643 1643 pFeatures->fAvx2 = RT_BOOL(pSxfLeaf0->uEcx & X86_CPUID_STEXT_FEATURE_EBX_AVX2); 1644 1644 pFeatures->fAvx512Foundation = RT_BOOL(pSxfLeaf0->uEcx & X86_CPUID_STEXT_FEATURE_EBX_AVX512F); 1645 pFeatures->fClFlushOpt = RT_BOOL(pSxfLeaf0->uE cx & X86_CPUID_STEXT_FEATURE_EBX_CLFLUSHOPT);1645 pFeatures->fClFlushOpt = RT_BOOL(pSxfLeaf0->uEbx & X86_CPUID_STEXT_FEATURE_EBX_CLFLUSHOPT); 1646 1646 } 1647 1647 -
trunk/src/VBox/ValidationKit/bootsectors/bs3-cpu-decoding-1.c32
r65783 r66331 498 498 { UD_T_MODRM_MR5, 2, { 0x0f, 0xae }, UD_F_NOT_NO_PFX }, /* xrstor */ 499 499 { UD_T_MODRM_MR6, 2, { 0x0f, 0xae }, UD_F_NOT_NO_PFX }, /* xsaveopt */ 500 { UD_T_MODRM_MR7, 2, { 0x0f, 0xae }, UD_F_NOT_NO_PFX | UD_F_NOT_OZ_PFX }, /* clflush seems to ignore op size!*/500 { UD_T_MODRM_MR7, 2, { 0x0f, 0xae }, UD_F_NOT_NO_PFX | UD_F_NOT_OZ_PFX }, /* clflush (none) and clflushopt (66) */ 501 501 { UD_T_MODRM_RR0, 2, { 0x0f, 0xae }, UD_F_ANY_PFX }, /* f3=rdfsbase is 64-bit */ 502 502 { UD_T_MODRM_RR1, 2, { 0x0f, 0xae }, UD_F_ANY_PFX }, /* f3=rdfsbase is 64-bit */ -
trunk/src/VBox/ValidationKit/bootsectors/bs3-cpu-generated-1-template.c
r66327 r66331 1936 1936 case BS3CG1CPU_GE_Pentium: 1937 1937 case BS3CG1CPU_CLFSH: 1938 case BS3CG1CPU_CLFLUSHOPT: 1938 1939 return false; 1939 1940 … … 2062 2063 return false; 2063 2064 2065 case BS3CG1CPU_CLFLUSHOPT: 2066 if (g_uBs3CpuDetected & BS3CPU_F_CPUID) 2067 { 2068 ASMCpuIdExSlow(7, 0, 0/*leaf*/, 0, NULL, &fEbx, NULL, NULL); 2069 if (fEbx & X86_CPUID_STEXT_FEATURE_EBX_CLFLUSHOPT) 2070 return true; 2071 } 2072 return false; 2064 2073 2065 2074 default: -
trunk/src/VBox/ValidationKit/bootsectors/bs3-cpu-generated-1.h
r66327 r66331 153 153 BS3CG1CPU_AVX2, 154 154 BS3CG1CPU_CLFSH, 155 BS3CG1CPU_CLFLUSHOPT, 155 156 156 157 BS3CG1CPU_END
Note:
See TracChangeset
for help on using the changeset viewer.