Changeset 66327 in vbox for trunk/src/VBox
- Timestamp:
- Mar 29, 2017 10:12:02 AM (8 years ago)
- Location:
- trunk/src/VBox
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/VMMAll/IEMAllCImpl.cpp.h
r66326 r66327 6775 6775 6776 6776 /** 6777 * Implements 'CLFLUSH' and 'CLFLUSHOPT'. 6778 * 6779 * This is implemented in C because it triggers a load like behviour without 6780 * actually reading anything. Since that's not so common, it's implemented 6781 * here. 6782 * 6783 * @param iEffSeg The effective segment. 6784 * @param GCPtrEff The address of the image. 6785 */ 6786 IEM_CIMPL_DEF_2(iemCImpl_clflush_clflushopt, uint8_t, iEffSeg, RTGCPTR, GCPtrEff) 6787 { 6788 /* 6789 * Pretend to do a load w/o reading (see also iemCImpl_monitor and iemMemMap). 6790 */ 6791 VBOXSTRICTRC rcStrict = iemMemApplySegment(pVCpu, IEM_ACCESS_TYPE_READ | IEM_ACCESS_WHAT_DATA, iEffSeg, 1, &GCPtrEff); 6792 if (rcStrict == VINF_SUCCESS) 6793 { 6794 RTGCPHYS GCPhysMem; 6795 rcStrict = iemMemPageTranslateAndCheckAccess(pVCpu, GCPtrEff, IEM_ACCESS_TYPE_READ | IEM_ACCESS_WHAT_DATA, &GCPhysMem); 6796 if (rcStrict == VINF_SUCCESS) 6797 { 6798 iemRegAddToRipAndClearRF(pVCpu, cbInstr); 6799 return VINF_SUCCESS; 6800 } 6801 } 6802 6803 return rcStrict; 6804 } 6805 6806 6807 /** 6777 6808 * Implements 'FINIT' and 'FNINIT'. 6778 6809 * -
trunk/src/VBox/VMM/VMMAll/IEMAllInstructionsPython.py
r66323 r66327 174 174 # ModR/M.rm - memory only. 175 175 'Ma': ( 'IDX_UseModRM', 'rm', '%Ma', 'Ma', ), ##< Only used by BOUND. 176 'MbRO': ( 'IDX_UseModRM', 'rm', '%Mb', 'Mb', ), 176 177 'Mq': ( 'IDX_UseModRM', 'rm', '%Mq', 'Mq', ), 177 178 … … 1781 1782 """ 1782 1783 Tag: \@opcode 1783 Value: 0x?? | /reg | mr/reg | 11 /reg | !11 /reg | 11 mr/reg | !11 mr/reg1784 Value: 0x?? | /reg (TODO: | mr/reg | 11 /reg | !11 /reg | 11 mr/reg | !11 mr/reg) 1784 1785 1785 1786 The opcode byte or sub-byte for the instruction in the context of a map. … … 1789 1790 # Flatten and validate the value. 1790 1791 sOpcode = self.flattenAllSections(aasSections); 1791 if sOpcode in g_kdSpecialOpcodes:1792 if _isValidOpcodeByte(sOpcode): 1792 1793 pass; 1793 elif not _isValidOpcodeByte(sOpcode): 1794 elif len(sOpcode) == 2 and sOpcode[0] == '/' and sOpcode[1] in '012345678': 1795 pass; 1796 else: 1794 1797 return self.errorComment(iTagLine, '%s: invalid opcode: %s' % (sTag, sOpcode,)); 1795 1798 … … 2637 2640 # Check the parameter locations for the encoding. 2638 2641 if g_kdIemForms[sForm][1] is not None: 2639 for iOperand, sWhere in enumerate(g_kdIemForms[sForm][1]): 2640 if oInstr.aoOperands[iOperand].sWhere != sWhere: 2641 self.error('%s: current instruction @op%u and a_Form location does not match: %s vs %s (%s)' 2642 % (sMacro, iOperand + 1, oInstr.aoOperands[iOperand].sWhere, sWhere, sForm,)); 2642 if len(g_kdIemForms[sForm][1]) != len(oInstr.aoOperands): 2643 self.error('%s: The a_Form=%s has a different operand count: %s (form) vs %s' 2644 % (sMacro, sForm, len(g_kdIemForms[sForm][1]), len(oInstr.aoOperands) )); 2645 else: 2646 for iOperand, sWhere in enumerate(g_kdIemForms[sForm][1]): 2647 if oInstr.aoOperands[iOperand].sWhere != sWhere: 2648 self.error('%s: current instruction @op%u and a_Form location does not match: %s vs %s (%s)' 2649 % (sMacro, iOperand + 1, oInstr.aoOperands[iOperand].sWhere, sWhere, sForm,)); 2643 2650 2644 2651 # Stats. -
trunk/src/VBox/VMM/VMMAll/IEMAllInstructionsTwoByte0f.cpp.h
r66324 r66327 5839 5839 FNIEMOP_UD_STUB_1(iemOp_Grp15_xsaveopt, uint8_t, bRm); 5840 5840 5841 /** Opcode 0x0f 0xae mem/7. */ 5842 FNIEMOP_STUB_1(iemOp_Grp15_clflush, uint8_t, bRm); 5841 /** 5842 * @opmaps grp15 5843 * @opcode /7 5844 * @oppfx none 5845 * @opcpuid clfsh 5846 * @opgroup og_sse2_cachectl 5847 * @optest op1=1 -> 5848 * @oponlytest 5849 */ 5850 FNIEMOP_DEF_1(iemOp_Grp15_clflush, uint8_t, bRm) 5851 { 5852 /** @todo clflushopt is same with 66h prefix. */ 5853 IEMOP_MNEMONIC1(M_MEM, CLFLUSH, clflush, MbRO, DISOPTYPE_HARMLESS, IEMOPHINT_IGNORES_OP_SIZE); 5854 if (!IEM_GET_GUEST_CPU_FEATURES(pVCpu)->fClFlush) 5855 return IEMOP_RAISE_INVALID_OPCODE(); 5856 5857 IEM_MC_BEGIN(2, 0); 5858 IEM_MC_ARG(uint8_t, iEffSeg, 0); 5859 IEM_MC_ARG(RTGCPTR, GCPtrEff, 1); 5860 IEM_MC_CALC_RM_EFF_ADDR(GCPtrEff, bRm, 0); 5861 IEMOP_HLP_DONE_DECODING_NO_LOCK_PREFIX(); 5862 IEM_MC_ASSIGN(iEffSeg, pVCpu->iem.s.iEffSeg); 5863 IEM_MC_CALL_CIMPL_2(iemCImpl_clflush_clflushopt, iEffSeg, GCPtrEff); 5864 IEM_MC_END(); 5865 return VINF_SUCCESS; 5866 } 5843 5867 5844 5868 -
trunk/src/VBox/VMM/VMMR3/CPUMR3CpuId.cpp
r66215 r66327 1635 1635 pFeatures->fMonitorMWait = RT_BOOL(pStd1Leaf->uEcx & X86_CPUID_FEATURE_ECX_MONITOR); 1636 1636 pFeatures->fMovCmpXchg16b = RT_BOOL(pStd1Leaf->uEcx & X86_CPUID_FEATURE_ECX_CX16); 1637 pFeatures->fClFlush = RT_BOOL(pStd1Leaf->uEdx & X86_CPUID_FEATURE_EDX_CLFSH); 1637 1638 1638 1639 /* Structured extended features. */ … … 1642 1643 pFeatures->fAvx2 = RT_BOOL(pSxfLeaf0->uEcx & X86_CPUID_STEXT_FEATURE_EBX_AVX2); 1643 1644 pFeatures->fAvx512Foundation = RT_BOOL(pSxfLeaf0->uEcx & X86_CPUID_STEXT_FEATURE_EBX_AVX512F); 1645 pFeatures->fClFlushOpt = RT_BOOL(pSxfLeaf0->uEcx & X86_CPUID_STEXT_FEATURE_EBX_CLFLUSHOPT); 1644 1646 } 1645 1647 -
trunk/src/VBox/ValidationKit/bootsectors/bs3-cpu-generated-1-template.c
r66323 r66327 1544 1544 break; 1545 1545 1546 case BS3CG1ENC_MODRM_MbRO: 1547 if (iEncoding == 0) 1548 { 1549 off = Bs3Cg1InsertOpcodes(pThis, Bs3Cg1InsertReqPrefix(pThis, 0)) - 1; 1550 off = Bs3Cfg1EncodeMemMod0Disp(pThis, false, off, 1551 (pThis->abCurInstr[off] & X86_MODRM_REG_MASK) >> X86_MODRM_REG_SHIFT, 1552 1, 0, BS3CG1OPLOC_MEM); 1553 } 1554 else 1555 break; 1556 pThis->cbCurInstr = off; 1557 iEncoding++; 1558 break; 1559 1560 1546 1561 case BS3CG1ENC_FIXED: 1547 1562 if (iEncoding == 0) … … 1805 1820 pThis->aOperands[0].enmLocation = BS3CG1OPLOC_CTX; 1806 1821 pThis->aOperands[1].enmLocation = BS3CG1OPLOC_MEM; 1822 break; 1823 1824 case BS3CG1ENC_MODRM_MbRO: 1825 pThis->iRmOp = 0; 1826 pThis->aOperands[0].cbOp = 1; 1827 pThis->aOperands[0].enmLocation = BS3CG1OPLOC_MEM; 1807 1828 break; 1808 1829 … … 1914 1935 case BS3CG1CPU_GE_80486: 1915 1936 case BS3CG1CPU_GE_Pentium: 1937 case BS3CG1CPU_CLFSH: 1916 1938 return false; 1917 1939 … … 2020 2042 { 2021 2043 ASMCpuIdExSlow(7, 0, 0/*leaf*/, 0, &fEax, &fEbx, &fEcx, &fEdx); 2022 2023 2044 switch (pThis->enmCpuTest) 2024 2045 { … … 2031 2052 } 2032 2053 return false; 2054 2055 case BS3CG1CPU_CLFSH: 2056 if (g_uBs3CpuDetected & BS3CPU_F_CPUID) 2057 { 2058 ASMCpuIdExSlow(1, 0, 0, 0, NULL, NULL, NULL, &fEdx); 2059 if (fEdx & X86_CPUID_FEATURE_EDX_CLFSH) 2060 return true; 2061 } 2062 return false; 2063 2033 2064 2034 2065 default: -
trunk/src/VBox/ValidationKit/bootsectors/bs3-cpu-generated-1.h
r66323 r66327 69 69 70 70 BS3CG1OP_Ma, 71 BS3CG1OP_MbRO, 71 72 BS3CG1OP_Mq, 72 73 … … 101 102 BS3CG1ENC_MODRM_Vq_Mq, 102 103 BS3CG1ENC_MODRM_Vdq_Wdq, 104 BS3CG1ENC_MODRM_MbRO, 103 105 104 106 BS3CG1ENC_FIXED, … … 150 152 BS3CG1CPU_AVX, 151 153 BS3CG1CPU_AVX2, 154 BS3CG1CPU_CLFSH, 155 152 156 BS3CG1CPU_END 153 157 } BS3CG1CPU;
Note:
See TracChangeset
for help on using the changeset viewer.