VirtualBox

Changeset 97193 in vbox


Ignore:
Timestamp:
Oct 18, 2022 10:18:45 AM (3 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
154168
Message:

VMM/EM: Drop the PVM and PCCPUMCTXCORE arguments from EMInterpretDisasCurrent and EMInterpretDisasOneEx.

Location:
trunk
Files:
10 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/VBox/vmm/em.h

    r97178 r97193  
    268268/** @name Deprecated interpretation related APIs (use IEM).
    269269 * @{ */
    270 VMM_INT_DECL(int)               EMInterpretDisasCurrent(PVMCC pVM, PVMCPUCC pVCpu, PDISCPUSTATE pCpu, unsigned *pcbInstr);
    271 VMM_INT_DECL(int)               EMInterpretDisasOneEx(PVMCC pVM, PVMCPUCC pVCpu, RTGCUINTPTR GCPtrInstr, PCCPUMCTXCORE pCtxCore,
     270VMM_INT_DECL(int)               EMInterpretDisasCurrent(PVMCPUCC pVCpu, PDISCPUSTATE pCpu, unsigned *pcbInstr);
     271VMM_INT_DECL(int)               EMInterpretDisasOneEx(PVMCPUCC pVCpu, RTGCUINTPTR GCPtrInstr,
    272272                                                      PDISCPUSTATE pDISState, unsigned *pcbInstr);
    273273VMM_INT_DECL(VBOXSTRICTRC)      EMInterpretInstruction(PVMCPUCC pVCpu, PCPUMCTXCORE pCoreCtx, RTGCPTR pvFault);
  • trunk/src/VBox/VMM/VMMAll/EMAll.cpp

    r97178 r97193  
    901901 *          details.
    902902 *
    903  * @param   pVM             The cross context VM structure.
    904903 * @param   pVCpu           The cross context virtual CPU structure.
    905904 * @param   pDis            Where to return the parsed instruction info.
    906905 * @param   pcbInstr        Where to return the instruction size. (optional)
    907906 */
    908 VMM_INT_DECL(int) EMInterpretDisasCurrent(PVMCC pVM, PVMCPUCC pVCpu, PDISCPUSTATE pDis, unsigned *pcbInstr)
    909 {
    910     PCPUMCTXCORE pCtxCore = CPUMCTX2CORE(CPUMQueryGuestCtxPtr(pVCpu));
    911     RTGCPTR GCPtrInstr;
     907VMM_INT_DECL(int) EMInterpretDisasCurrent(PVMCPUCC pVCpu, PDISCPUSTATE pDis, unsigned *pcbInstr)
     908{
     909    PCPUMCTX pCtx = CPUMQueryGuestCtxPtr(pVCpu);
     910    RTGCPTR  GCPtrInstr;
    912911#if 0
    913     int rc = SELMToFlatEx(pVCpu, DISSELREG_CS, pCtxCore, pCtxCore->rip, 0, &GCPtrInstr);
     912    int rc = SELMToFlatEx(pVCpu, DISSELREG_CS, pCtx, pCtx->rip, 0, &GCPtrInstr);
    914913#else
    915914/** @todo Get the CPU mode as well while we're at it! */
    916     int rc = SELMValidateAndConvertCSAddr(pVCpu, pCtxCore->eflags, pCtxCore->ss.Sel, pCtxCore->cs.Sel, &pCtxCore->cs,
    917                                           pCtxCore->rip, &GCPtrInstr);
     915    int rc = SELMValidateAndConvertCSAddr(pVCpu, pCtx->eflags, pCtx->ss.Sel, pCtx->cs.Sel, &pCtx->cs, pCtx->rip, &GCPtrInstr);
    918916#endif
    919     if (RT_FAILURE(rc))
    920     {
    921         Log(("EMInterpretDisasOne: Failed to convert %RTsel:%RGv (cpl=%d) - rc=%Rrc !!\n",
    922              pCtxCore->cs.Sel, (RTGCPTR)pCtxCore->rip, pCtxCore->ss.Sel & X86_SEL_RPL, rc));
    923         return rc;
    924     }
    925     return EMInterpretDisasOneEx(pVM, pVCpu, (RTGCUINTPTR)GCPtrInstr, pCtxCore, pDis, pcbInstr);
     917    if (RT_SUCCESS(rc))
     918        return EMInterpretDisasOneEx(pVCpu, (RTGCUINTPTR)GCPtrInstr, pDis, pcbInstr);
     919
     920    Log(("EMInterpretDisasOne: Failed to convert %RTsel:%RGv (cpl=%d) - rc=%Rrc !!\n",
     921         pCtx->cs.Sel, (RTGCPTR)pCtx->rip, pCtx->ss.Sel & X86_SEL_RPL, rc));
     922    return rc;
    926923}
    927924
     
    934931 * @returns VBox status code.
    935932 *
    936  * @param   pVM             The cross context VM structure.
    937933 * @param   pVCpu           The cross context virtual CPU structure.
    938934 * @param   GCPtrInstr      The flat address of the instruction.
    939  * @param   pCtxCore        The context core (used to determine the cpu mode).
    940935 * @param   pDis            Where to return the parsed instruction info.
    941936 * @param   pcbInstr        Where to return the instruction size. (optional)
    942937 */
    943 VMM_INT_DECL(int) EMInterpretDisasOneEx(PVMCC pVM, PVMCPUCC pVCpu, RTGCUINTPTR GCPtrInstr, PCCPUMCTXCORE pCtxCore,
    944                                         PDISCPUSTATE pDis, unsigned *pcbInstr)
    945 {
    946     NOREF(pVM);
    947     Assert(pCtxCore == CPUMGetGuestCtxCore(pVCpu)); NOREF(pCtxCore);
     938VMM_INT_DECL(int) EMInterpretDisasOneEx(PVMCPUCC pVCpu, RTGCUINTPTR GCPtrInstr, PDISCPUSTATE pDis, unsigned *pcbInstr)
     939{
    948940    DISCPUMODE enmCpuMode = CPUMGetGuestDisMode(pVCpu);
    949941    /** @todo Deal with too long instruction (=> \#GP), opcode read errors (=>
  • trunk/src/VBox/VMM/VMMAll/GIMAll.cpp

    r96407 r97193  
    247247    unsigned    cbInstr;
    248248    DISCPUSTATE Dis;
    249     int rc = EMInterpretDisasCurrent(pVM, pVCpu, &Dis, &cbInstr);
     249    int rc = EMInterpretDisasCurrent(pVCpu, &Dis, &cbInstr);
    250250    if (RT_SUCCESS(rc))
    251251    {
  • trunk/src/VBox/VMM/VMMAll/GIMAllHv.cpp

    r96407 r97193  
    14791479        unsigned    cbInstr;
    14801480        DISCPUSTATE Dis;
    1481         int rc = EMInterpretDisasCurrent(pVCpu->CTX_SUFF(pVM), pVCpu, &Dis, &cbInstr);
     1481        int rc = EMInterpretDisasCurrent(pVCpu, &Dis, &cbInstr);
    14821482        if (RT_SUCCESS(rc))
    14831483        {
  • trunk/src/VBox/VMM/VMMAll/GIMAllKvm.cpp

    r96407 r97193  
    434434        unsigned    cbInstr;
    435435        DISCPUSTATE Dis;
    436         int rc = EMInterpretDisasCurrent(pVM, pVCpu, &Dis, &cbInstr);
     436        int rc = EMInterpretDisasCurrent(pVCpu, &Dis, &cbInstr);
    437437        if (RT_SUCCESS(rc))
    438438        {
  • trunk/src/VBox/VMM/VMMAll/PGMAllPhys.cpp

    r97145 r97193  
    224224            uint32_t     cbOp;
    225225            PDISCPUSTATE pDis = &pVCpu->pgm.s.DisState;
    226             rc = EMInterpretDisasCurrent(pVM, pVCpu, pDis, &cbOp);
     226            rc = EMInterpretDisasCurrent(pVCpu, pDis, &cbOp);
    227227            if (     RT_SUCCESS(rc)
    228228                &&   pDis->uCpuMode == DISCPUMODE_32BIT  /** @todo why does this matter? */
  • trunk/src/VBox/VMM/VMMAll/PGMAllPool.cpp

    r97147 r97193  
    11531153     */
    11541154    PDISCPUSTATE pDis = &pVCpu->pgm.s.DisState;
    1155     int rc = EMInterpretDisasCurrent(pVM, pVCpu, pDis, NULL);
     1155    int rc = EMInterpretDisasCurrent(pVCpu, pDis, NULL);
    11561156    if (RT_UNLIKELY(rc != VINF_SUCCESS))
    11571157    {
  • trunk/src/VBox/VMM/VMMR0/HMSVMR0.cpp

    r97178 r97193  
    74147414        {
    74157415            PDISCPUSTATE pDis = &pVCpu->hmr0.s.svm.DisState;
    7416             int rc = EMInterpretDisasCurrent(pVCpu->CTX_SUFF(pVM), pVCpu, pDis, &cbInstr);
     7416            int rc = EMInterpretDisasCurrent(pVCpu, pDis, &cbInstr);
    74177417            if (   rc == VINF_SUCCESS
    74187418                && pDis->pCurInstr->uOpcode == OP_WRMSR)
     
    81158115        {
    81168116            PDISCPUSTATE pDis = &pVCpu->hmr0.s.svm.DisState;
    8117             int rc = EMInterpretDisasCurrent(pVCpu->CTX_SUFF(pVM), pVCpu, pDis, &cbInstr);
     8117            int rc = EMInterpretDisasCurrent(pVCpu, pDis, &cbInstr);
    81188118            if (   rc == VINF_SUCCESS
    81198119                && pDis->pCurInstr->uOpcode == OP_VMMCALL)
     
    81598159    {
    81608160        PDISCPUSTATE pDis = &pVCpu->hmr0.s.svm.DisState;
    8161         int rc = EMInterpretDisasCurrent(pVCpu->CTX_SUFF(pVM), pVCpu, pDis, &cbInstr);
     8161        int rc = EMInterpretDisasCurrent(pVCpu, pDis, &cbInstr);
    81628162        if (   rc == VINF_SUCCESS
    81638163            && pDis->pCurInstr->uOpcode == OP_PAUSE)
     
    85128512    if (!(pCtx->cr0 & X86_CR0_NE))
    85138513    {
    8514         PVMCC     pVM  = pVCpu->CTX_SUFF(pVM);
    85158514        PDISSTATE pDis = &pVCpu->hmr0.s.svm.DisState;
    85168515        unsigned  cbInstr;
    8517         int rc = EMInterpretDisasCurrent(pVM, pVCpu, pDis, &cbInstr);
     8516        int rc = EMInterpretDisasCurrent(pVCpu, pDis, &cbInstr);
    85188517        if (RT_SUCCESS(rc))
    85198518        {
  • trunk/src/VBox/VMM/VMMR3/DBGFDisas.cpp

    r96407 r97193  
    383383     * Get the Sel and GCPtr if fFlags requests that.
    384384     */
    385     PCCPUMCTXCORE  pCtxCore   = NULL;
    386     PCCPUMSELREG   pSRegCS    = NULL;
     385    PCCPUMCTX      pCtx    = CPUMQueryGuestCtxPtr(pVCpu);
     386    PCCPUMSELREG   pSRegCS = NULL;
    387387    if (fFlags & DBGF_DISAS_FLAGS_CURRENT_GUEST)
    388388    {
    389         pCtxCore   = CPUMGetGuestCtxCore(pVCpu);
    390         Sel        = pCtxCore->cs.Sel;
    391         pSRegCS    = &pCtxCore->cs;
    392         GCPtr      = pCtxCore->rip;
     389        Sel        = pCtx->cs.Sel;
     390        pSRegCS    = &pCtx->cs;
     391        GCPtr      = pCtx->rip;
    393392    }
    394393    /*
     
    398397    else
    399398    {
    400         pCtxCore = CPUMGetGuestCtxCore(pVCpu);
    401         if (pCtxCore->cs.Sel == Sel && Sel != DBGF_SEL_FLAT)
    402             pSRegCS = &pCtxCore->cs;
     399        if (pCtx->cs.Sel == Sel && Sel != DBGF_SEL_FLAT)
     400            pSRegCS = &pCtx->cs;
    403401        else
    404             pCtxCore = NULL;
     402            pCtx = NULL;
    405403    }
    406404
     
    425423        SelInfo.fFlags                  = PGMMODE_IS_LONG_MODE(enmMode)
    426424                                        ? DBGFSELINFO_FLAGS_LONG_MODE
    427                                         : enmMode != PGMMODE_REAL && !pCtxCore->eflags.Bits.u1VM
     425                                        : enmMode != PGMMODE_REAL && !pCtx->eflags.Bits.u1VM
    428426                                        ? DBGFSELINFO_FLAGS_PROT_MODE
    429427                                        : DBGFSELINFO_FLAGS_REAL_MODE;
     
    478476        }
    479477    }
    480     else if (   (pCtxCore && pCtxCore->eflags.Bits.u1VM)
     478    else if (   (pCtx && pCtx->eflags.Bits.u1VM)
    481479             || enmMode == PGMMODE_REAL
    482480             || (fFlags & DBGF_DISAS_FLAGS_MODE_MASK) == DBGF_DISAS_FLAGS_16BIT_REAL_MODE)
  • trunk/src/VBox/VMM/VMMR3/HM.cpp

    r97100 r97193  
    22742274    DISCPUSTATE     Dis;
    22752275    uint32_t        cbOp;
    2276     int rc = EMInterpretDisasCurrent(pVM, pVCpu, &Dis, &cbOp);
     2276    int rc = EMInterpretDisasCurrent(pVCpu, &Dis, &cbOp);
    22772277    AssertRC(rc);
    22782278    if (    rc == VINF_SUCCESS
     
    23272327
    23282328            pCtx->rip += cbOp;
    2329             rc = EMInterpretDisasCurrent(pVM, pVCpu, &Dis, &cbOp);
     2329            rc = EMInterpretDisasCurrent(pVCpu, &Dis, &cbOp);
    23302330            DBGFR3_DISAS_INSTR_CUR_LOG(pVCpu, "Following read");
    23312331            pCtx->rip = uSavedRip;
     
    24502450    DISCPUSTATE     Dis;
    24512451    uint32_t        cbOp;
    2452     int rc = EMInterpretDisasCurrent(pVM, pVCpu, &Dis, &cbOp);
     2452    int rc = EMInterpretDisasCurrent(pVCpu, &Dis, &cbOp);
    24532453    AssertRC(rc);
    24542454    if (    rc == VINF_SUCCESS
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