VirtualBox

Changeset 66327 in vbox for trunk/src/VBox/VMM/VMMAll


Ignore:
Timestamp:
Mar 29, 2017 10:12:02 AM (8 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
114260
Message:

IEM,CPUM: Implemented clflush Mb (0f ae /7).

Location:
trunk/src/VBox/VMM/VMMAll
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/VMM/VMMAll/IEMAllCImpl.cpp.h

    r66326 r66327  
    67756775
    67766776/**
     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 */
     6786IEM_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/**
    67776808 * Implements 'FINIT' and 'FNINIT'.
    67786809 *
  • trunk/src/VBox/VMM/VMMAll/IEMAllInstructionsPython.py

    r66323 r66327  
    174174    # ModR/M.rm - memory only.
    175175    'Ma':   ( 'IDX_UseModRM',       'rm',     '%Ma',  'Ma',      ), ##< Only used by BOUND.
     176    'MbRO': ( 'IDX_UseModRM',       'rm',     '%Mb',  'Mb',      ),
    176177    'Mq':   ( 'IDX_UseModRM',       'rm',     '%Mq',  'Mq',      ),
    177178
     
    17811782        """
    17821783        Tag:        \@opcode
    1783         Value:      0x?? | /reg | mr/reg | 11 /reg | !11 /reg | 11 mr/reg | !11 mr/reg
     1784        Value:      0x?? | /reg (TODO: | mr/reg | 11 /reg | !11 /reg | 11 mr/reg | !11 mr/reg)
    17841785
    17851786        The opcode byte or sub-byte for the instruction in the context of a map.
     
    17891790        # Flatten and validate the value.
    17901791        sOpcode = self.flattenAllSections(aasSections);
    1791         if sOpcode in g_kdSpecialOpcodes:
     1792        if _isValidOpcodeByte(sOpcode):
    17921793            pass;
    1793         elif not _isValidOpcodeByte(sOpcode):
     1794        elif len(sOpcode) == 2 and sOpcode[0] == '/' and sOpcode[1] in '012345678':
     1795            pass;
     1796        else:
    17941797            return self.errorComment(iTagLine, '%s: invalid opcode: %s' % (sTag, sOpcode,));
    17951798
     
    26372640            # Check the parameter locations for the encoding.
    26382641            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,));
    26432650
    26442651        # Stats.
  • trunk/src/VBox/VMM/VMMAll/IEMAllInstructionsTwoByte0f.cpp.h

    r66324 r66327  
    58395839FNIEMOP_UD_STUB_1(iemOp_Grp15_xsaveopt, uint8_t, bRm);
    58405840
    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 */
     5850FNIEMOP_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}
    58435867
    58445868
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette