VirtualBox

Changeset 72518 in vbox for trunk


Ignore:
Timestamp:
Jun 11, 2018 3:00:30 PM (7 years ago)
Author:
vboxsync
Message:

IEM: Implemented rsm for the purpose of SVM intercepting. Renamed IEMOP_HLP_SVM_INSTR_INTERCEPT_AND_NRIP to IEMCIMPL_HLP_SVM_INSTR_INTERCEPT_AND_NRIP.

Location:
trunk/src/VBox/VMM
Files:
4 edited

Legend:

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

    r72517 r72518  
    49034903IEM_CIMPL_DEF_2(iemCImpl_sldt_reg, uint8_t, iGReg, uint8_t, enmEffOpSize)
    49044904{
    4905     IEMOP_HLP_SVM_INSTR_INTERCEPT_AND_NRIP(pVCpu, SVM_CTRL_INTERCEPT_LDTR_READS, SVM_EXIT_LDTR_READ, 0, 0);
     4905    IEMCIMPL_HLP_SVM_INSTR_INTERCEPT_AND_NRIP(pVCpu, SVM_CTRL_INTERCEPT_LDTR_READS, SVM_EXIT_LDTR_READ, 0, 0);
    49064906
    49074907    IEM_CTX_IMPORT_RET(pVCpu, CPUMCTX_EXTRN_LDTR);
     
    49274927IEM_CIMPL_DEF_2(iemCImpl_sldt_mem, uint8_t, iEffSeg, RTGCPTR, GCPtrEffDst)
    49284928{
    4929     IEMOP_HLP_SVM_INSTR_INTERCEPT_AND_NRIP(pVCpu, SVM_CTRL_INTERCEPT_LDTR_READS, SVM_EXIT_LDTR_READ, 0, 0);
     4929    IEMCIMPL_HLP_SVM_INSTR_INTERCEPT_AND_NRIP(pVCpu, SVM_CTRL_INTERCEPT_LDTR_READS, SVM_EXIT_LDTR_READ, 0, 0);
    49304930
    49314931    IEM_CTX_IMPORT_RET(pVCpu, CPUMCTX_EXTRN_LDTR);
     
    50685068IEM_CIMPL_DEF_2(iemCImpl_str_reg, uint8_t, iGReg, uint8_t, enmEffOpSize)
    50695069{
    5070     IEMOP_HLP_SVM_INSTR_INTERCEPT_AND_NRIP(pVCpu, SVM_CTRL_INTERCEPT_TR_READS, SVM_EXIT_TR_READ, 0, 0);
     5070    IEMCIMPL_HLP_SVM_INSTR_INTERCEPT_AND_NRIP(pVCpu, SVM_CTRL_INTERCEPT_TR_READS, SVM_EXIT_TR_READ, 0, 0);
    50715071
    50725072    IEM_CTX_IMPORT_RET(pVCpu, CPUMCTX_EXTRN_TR);
     
    50925092IEM_CIMPL_DEF_2(iemCImpl_str_mem, uint8_t, iEffSeg, RTGCPTR, GCPtrEffDst)
    50935093{
    5094     IEMOP_HLP_SVM_INSTR_INTERCEPT_AND_NRIP(pVCpu, SVM_CTRL_INTERCEPT_TR_READS, SVM_EXIT_TR_READ, 0, 0);
     5094    IEMCIMPL_HLP_SVM_INSTR_INTERCEPT_AND_NRIP(pVCpu, SVM_CTRL_INTERCEPT_TR_READS, SVM_EXIT_TR_READ, 0, 0);
    50955095
    50965096    IEM_CTX_IMPORT_RET(pVCpu, CPUMCTX_EXTRN_TR);
     
    60486048    }
    60496049
    6050     IEMOP_HLP_SVM_INSTR_INTERCEPT_AND_NRIP(pVCpu, SVM_CTRL_INTERCEPT_INVD, SVM_EXIT_INVD, 0, 0);
     6050    IEMCIMPL_HLP_SVM_INSTR_INTERCEPT_AND_NRIP(pVCpu, SVM_CTRL_INTERCEPT_INVD, SVM_EXIT_INVD, 0, 0);
    60516051
    60526052    /* We currently take no action here. */
     
    60676067    }
    60686068
    6069     IEMOP_HLP_SVM_INSTR_INTERCEPT_AND_NRIP(pVCpu, SVM_CTRL_INTERCEPT_WBINVD, SVM_EXIT_WBINVD, 0, 0);
     6069    IEMCIMPL_HLP_SVM_INSTR_INTERCEPT_AND_NRIP(pVCpu, SVM_CTRL_INTERCEPT_WBINVD, SVM_EXIT_WBINVD, 0, 0);
    60706070
    60716071    /* We currently take no action here. */
    60726072    iemRegAddToRipAndClearRF(pVCpu, cbInstr);
    60736073    return VINF_SUCCESS;
     6074}
     6075
     6076
     6077/** Opcode 0x0f 0xaa. */
     6078IEM_CIMPL_DEF_0(iemCImpl_rsm)
     6079{
     6080    IEMCIMPL_HLP_SVM_INSTR_INTERCEPT_AND_NRIP(pVCpu, SVM_CTRL_INTERCEPT_RSM, SVM_EXIT_RSM, 0, 0);
     6081    NOREF(cbInstr);
     6082    return iemRaiseUndefinedOpcode(pVCpu);
    60746083}
    60756084
  • trunk/src/VBox/VMM/VMMAll/IEMAllCImplSvmInstr.cpp.h

    r72506 r72518  
    2020/** Check and handles SVM nested-guest instruction intercept and updates
    2121 *  NRIP if needed.
    22  * @todo r=bird: This macro is conceptually wrong.
    23  */
    24 # define IEMOP_HLP_SVM_INSTR_INTERCEPT_AND_NRIP(a_pVCpu, a_Intercept, a_uExitCode, a_uExitInfo1, a_uExitInfo2) \
     22 */
     23# define IEMCIMPL_HLP_SVM_INSTR_INTERCEPT_AND_NRIP(a_pVCpu, a_Intercept, a_uExitCode, a_uExitInfo1, a_uExitInfo2) \
    2524    do \
    2625    { \
     
    4645
    4746#else  /* !VBOX_WITH_NESTED_HWVIRT_SVM */
    48 # define IEMOP_HLP_SVM_INSTR_INTERCEPT_AND_NRIP(a_pVCpu, a_Intercept, a_uExitCode, a_uExitInfo1, a_uExitInfo2)  do { } while (0)
     47# define IEMCIMPL_HLP_SVM_INSTR_INTERCEPT_AND_NRIP(a_pVCpu, a_Intercept, a_uExitCode, a_uExitInfo1, a_uExitInfo2)  do { } while (0)
    4948# define IEMCIMPL_HLP_SVM_READ_CR_INTERCEPT(a_pVCpu, a_uCr, a_uExitInfo1, a_uExitInfo2)                         do { } while (0)
    5049#endif /* !VBOX_WITH_NESTED_HWVIRT_SVM */
     
    14201419
    14211420    if (fCheckIntercept)
    1422         IEMOP_HLP_SVM_INSTR_INTERCEPT_AND_NRIP(pVCpu, SVM_CTRL_INTERCEPT_PAUSE, SVM_EXIT_PAUSE, 0, 0);
     1421        IEMCIMPL_HLP_SVM_INSTR_INTERCEPT_AND_NRIP(pVCpu, SVM_CTRL_INTERCEPT_PAUSE, SVM_EXIT_PAUSE, 0, 0);
    14231422
    14241423    iemRegAddToRipAndClearRF(pVCpu, cbInstr);
  • trunk/src/VBox/VMM/VMMAll/IEMAllInstructionsTwoByte0f.cpp.h

    r72517 r72518  
    65556555FNIEMOP_DEF(iemOp_rsm)
    65566556{
    6557     IEMOP_MNEMONIC(rsm, "rsm");
    6558     IEMOP_HLP_SVM_INSTR_INTERCEPT_AND_NRIP(pVCpu, SVM_CTRL_INTERCEPT_RSM, SVM_EXIT_RSM, 0, 0);
    6559     /** @todo rsm - for the regular case (above handles only the SVM nested-guest
    6560      *        intercept). */
    6561     IEMOP_BITCH_ABOUT_STUB();
    6562     return IEMOP_RAISE_INVALID_OPCODE();
    6563 }
    6564 
    6565 //IEMOP_HLP_MIN_386();
     6557    IEMOP_MNEMONIC0(FIXED, RSM, rsm, DISOPTYPE_HARMLESS, 0);
     6558    IEMOP_HLP_MIN_386(); /* 386SL and later. */
     6559    IEMOP_HLP_DONE_DECODING_NO_LOCK_PREFIX();
     6560    return IEM_MC_DEFER_TO_CIMPL_0(iemCImpl_rsm);
     6561}
     6562
    65666563
    65676564
  • trunk/src/VBox/VMM/testcase/tstIEMCheckMc.cpp

    r72515 r72518  
    129129
    130130#define IEMOP_HLP_DONE_DECODING()                           do { } while (0)
    131 
    132 #define IEMOP_HLP_SVM_INSTR_INTERCEPT_AND_NRIP(a_pVCpu, a_Intercept, a_uExitCode, a_uExitInfo1, a_uExitInfo2)   do { } while (0)
    133 #define IEMOP_HLP_SVM_READ_CR_INTERCEPT(a_pVCpu, a_uCr, a_uExitInfo1, a_uExitInfo2)                 do { } while (0)
    134131
    135132#define IEMOP_HLP_DECODED_NL_1(a_uDisOpNo, a_fIemOpFlags, a_uDisParam0, a_fDisOpType)               do { } while (0)
Note: See TracChangeset for help on using the changeset viewer.

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