VirtualBox

Changeset 56080 in vbox for trunk/src/VBox/VMM/VMMRC


Ignore:
Timestamp:
May 26, 2015 2:36:27 PM (10 years ago)
Author:
vboxsync
Message:

IOM,HM: Let IEM take over the MMIO handling from IOM when VBOX_WITH_2ND_IEM_STEP is defined (currently disabled).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/VMM/VMMRC/IOMRC.cpp

    r56072 r56080  
    2727#include <VBox/vmm/mm.h>
    2828#include <VBox/vmm/em.h>
     29#include <VBox/vmm/iem.h>
    2930#include <VBox/vmm/pgm.h>
    3031#include <VBox/vmm/trpm.h>
     
    4041#include <iprt/asm.h>
    4142#include <iprt/string.h>
     43
     44
     45#ifdef VBOX_WITH_2ND_IEM_STEP
     46/**
     47 * Converts disassembler mode to IEM mode.
     48 * @return IEM CPU mode.
     49 * @param  enmDisMode   Disassembler CPU mode.
     50 */
     51DECLINLINE(IEMMODE) iomDisModeToIemMode(DISCPUMODE enmDisMode)
     52{
     53    switch (enmDisMode)
     54    {
     55        case DISCPUMODE_16BIT: return IEMMODE_16BIT;
     56        case DISCPUMODE_32BIT: return IEMMODE_32BIT;
     57        case DISCPUMODE_64BIT: return IEMMODE_64BIT;
     58        default:
     59            AssertFailed();
     60            return IEMMODE_32BIT;
     61    }
     62}
     63#endif
    4264
    4365
     
    178200static VBOXSTRICTRC iomRCInterpretINS(PVM pVM, PVMCPU pVCpu, PCPUMCTXCORE pRegFrame, PDISCPUSTATE pCpu)
    179201{
     202#ifdef VBOX_WITH_2ND_IEM_STEP
     203    uint8_t cbValue = pCpu->pCurInstr->uOpcode == OP_INSB ? 1
     204                    : pCpu->uOpMode == DISCPUMODE_16BIT ? 2 : 4;       /* dword in both 32 & 64 bits mode */
     205    return IEMExecStringIoRead(pVCpu,
     206                               cbValue,
     207                               iomDisModeToIemMode((DISCPUMODE)pCpu->uCpuMode),
     208                               RT_BOOL(pCpu->fPrefix & (DISPREFIX_REPNE | DISPREFIX_REP)),
     209                               pCpu->cbInstr);
     210#else
    180211    /*
    181212     * Get port number directly from the register (no need to bother the
     
    197228
    198229    return IOMInterpretINSEx(pVM, pVCpu, pRegFrame, Port, pCpu->fPrefix, (DISCPUMODE)pCpu->uAddrMode, cb);
     230#endif
    199231}
    200232
     
    222254static VBOXSTRICTRC iomRCInterpretOUTS(PVM pVM, PVMCPU pVCpu, PCPUMCTXCORE pRegFrame, PDISCPUSTATE pCpu)
    223255{
     256#ifdef VBOX_WITH_2ND_IEM_STEP
     257    uint8_t cbValue = pCpu->pCurInstr->uOpcode == OP_OUTSB ? 1
     258                    : pCpu->uOpMode == DISCPUMODE_16BIT ? 2 : 4;       /* dword in both 32 & 64 bits mode */
     259    return IEMExecStringIoWrite(pVCpu,
     260                                cbValue,
     261                                iomDisModeToIemMode((DISCPUMODE)pCpu->uCpuMode),
     262                                RT_BOOL(pCpu->fPrefix & (DISPREFIX_REPNE | DISPREFIX_REP)),
     263                                pCpu->cbInstr,
     264                                pCpu->fPrefix & DISPREFIX_SEG ? pCpu->idxSegPrefix : X86_SREG_DS);
     265#else
    224266    /*
    225267     * Get port number from the first parameter.
     
    227269     */
    228270    uint64_t    Port = 0;
    229     unsigned    cb;
    230271    bool fRc = iomGetRegImmData(pCpu, &pCpu->Param1, pRegFrame, &Port, &cb);
    231272    AssertMsg(fRc, ("Failed to get reg/imm port number!\n")); NOREF(fRc);
     273    unsigned cb;
    232274    if (pCpu->pCurInstr->uOpcode == OP_OUTSB)
    233275        cb = 1;
     
    243285
    244286    return IOMInterpretOUTSEx(pVM, pVCpu, pRegFrame, Port, pCpu->fPrefix, (DISCPUMODE)pCpu->uAddrMode, cb);
     287#endif
    245288}
    246289
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