VirtualBox

Changeset 47421 in vbox


Ignore:
Timestamp:
Jul 26, 2013 12:15:44 PM (12 years ago)
Author:
vboxsync
Message:

VMM: Use IEM for I/O that's been deferred to ring-3.

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

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/VMM/Makefile.kmk

    r47323 r47421  
    3333# Can be prepended to by setting it in LocalConfig.kmk
    3434VMM_COMMON_DEFS ?= VBOX_IN_VMM
     35ifdef VBOX_WITH_FIRST_IEM_STEP
     36 VMM_COMMON_DEFS += VBOX_WITH_FIRST_IEM_STEP
     37endif
    3538ifdef VBOX_WITH_IEM
    3639 VMM_COMMON_DEFS += VBOX_WITH_IEM
     
    187190        VMMAll/DBGFAll.cpp \
    188191        VMMAll/HMAll.cpp \
     192        VMMAll/IEMAll.cpp \
     193        VMMAll/IEMAllAImpl.asm \
     194        VMMAll/IEMAllAImplC.cpp \
    189195        VMMAll/IOMAll.cpp \
    190196        VMMAll/IOMAllMMIO.cpp \
     
    207213        VMMAll/EMAllA.asm \
    208214        VMMAll/FTMAll.cpp \
    209         VMMAll/IEMAll.cpp \
    210         VMMAll/IEMAllAImpl.asm \
    211         VMMAll/IEMAllAImplC.cpp \
    212215        VMMAll/TMAll.cpp \
    213216        VMMAll/TMAllCpu.cpp \
     
    437440        VMMAll/CPUMAllA.asm \
    438441        VMMAll/DBGFAll.cpp \
    439         VMMAll/IOMAll.cpp \
     442        VMMAll/IEMAll.cpp \
     443        VMMAll/IEMAllAImpl.asm \
     444        VMMAll/IEMAllAImplC.cpp \
     445        VMMAll/IOMAll.cpp \
    440446        VMMAll/IOMAllMMIO.cpp \
    441447        VMMAll/EMAll.cpp \
     
    474480  VMMRC_SOURCES += $(VMMRCImp_0_OUTDIR)/VMMRC.def
    475481 endif
    476  ifdef VBOX_WITH_IEM
    477   VMMRC_SOURCES += \
    478         VMMAll/IEMAll.cpp \
    479         VMMAll/IEMAllAImpl.asm \
    480         VMMAll/IEMAllAImplC.cpp
    481  endif
    482482
    483483 # the very last one.
     
    549549        VMMAll/FTMAll.cpp \
    550550        VMMAll/HMAll.cpp \
     551        VMMAll/IEMAll.cpp \
     552        VMMAll/IEMAllAImpl.asm \
     553        VMMAll/IEMAllAImplC.cpp \
    551554        VMMAll/IOMAll.cpp \
    552555        VMMAll/IOMAllMMIO.cpp \
     
    581584        VMMR0/VMMR0TripleFaultHack.cpp \
    582585        VMMR0/VMMR0TripleFaultHackA.asm
    583  endif
    584  ifdef VBOX_WITH_IEM
    585   VMMR0_SOURCES += \
    586         VMMAll/IEMAll.cpp \
    587         VMMAll/IEMAllAImpl.asm \
    588         VMMAll/IEMAllAImplC.cpp
    589586 endif
    590587 ifdef VBOX_WITH_NETSHAPER
  • trunk/src/VBox/VMM/VMMR3/EM.cpp

    r46918 r47421  
    383383        EM_REG_COUNTER_USED(&pStats->StatR3FailedPrefix,         "/EM/CPU%d/R3/Interpret/Failed/Prefix",     "The number of rejections because of prefix .");
    384384
     385        EM_REG_COUNTER_USED(&pStats->StatIoRestarted,            "/EM/CPU%d/R3/PrivInst/IoRestarted",        "I/O instructions restarted in ring-3.");
     386# ifdef VBOX_WITH_FIRST_IEM_STEP
     387        EM_REG_COUNTER_USED(&pStats->StatIoIem,                  "/EM/CPU%d/R3/PrivInst/IoIem",              "I/O instructions end to IEM in ring-3.");
     388# else
     389        EM_REG_COUNTER_USED(&pStats->StatIn,                     "/EM/CPU%d/R3/PrivInst/In",                 "Number of in instructions.");
     390        EM_REG_COUNTER_USED(&pStats->StatOut,                    "/EM/CPU%d/R3/PrivInst/Out",                "Number of out instructions.");
     391# endif
    385392        EM_REG_COUNTER_USED(&pStats->StatCli,                    "/EM/CPU%d/R3/PrivInst/Cli",                "Number of cli instructions.");
    386393        EM_REG_COUNTER_USED(&pStats->StatSti,                    "/EM/CPU%d/R3/PrivInst/Sti",                "Number of sli instructions.");
    387         EM_REG_COUNTER_USED(&pStats->StatIn,                     "/EM/CPU%d/R3/PrivInst/In",                 "Number of in instructions.");
    388         EM_REG_COUNTER_USED(&pStats->StatOut,                    "/EM/CPU%d/R3/PrivInst/Out",                "Number of out instructions.");
    389         EM_REG_COUNTER_USED(&pStats->StatIoRestarted,            "/EM/CPU%d/R3/PrivInst/IoRestarted",        "Number of restarted i/o instructions.");
    390394        EM_REG_COUNTER_USED(&pStats->StatHlt,                    "/EM/CPU%d/R3/PrivInst/Hlt",                "Number of hlt instructions not handled in GC because of PATM.");
    391395        EM_REG_COUNTER_USED(&pStats->StatInvlpg,                 "/EM/CPU%d/R3/PrivInst/Invlpg",             "Number of invlpg instructions.");
  • trunk/src/VBox/VMM/VMMR3/EMHM.cpp

    r46423 r47421  
    299299                    RT_SUCCESS_NP(rcStrict) ? VERR_IPE_UNEXPECTED_INFO_STATUS : VBOXSTRICTRC_TODO(rcStrict));
    300300
     301#ifdef VBOX_WITH_FIRST_IEM_STEP
     302    /* Hand it over to the interpreter. */
     303    rcStrict = IEMExecOne(pVCpu);
     304    LogFlow(("emR3ExecuteIOInstruction: %Rrc\n", VBOXSTRICTRC_VAL(rcStrict)));
     305    STAM_COUNTER_INC(&pVCpu->em.s.CTX_SUFF(pStats)->StatIoIem);
     306    STAM_PROFILE_STOP(&pVCpu->em.s.StatIOEmu, a);
     307    return VBOXSTRICTRC_TODO(rcStrict);
     308
     309#else
    301310    /** @todo probably we should fall back to the recompiler; otherwise we'll go back and forth between HC & GC
    302311     *   as io instructions tend to come in packages of more than one
     
    379388    STAM_PROFILE_STOP(&pVCpu->em.s.StatIOEmu, a);
    380389    return emR3ExecuteInstruction(pVM, pVCpu, "IO: ");
     390#endif
    381391}
    382392
  • trunk/src/VBox/VMM/VMMR3/EMRaw.cpp

    r46423 r47421  
    415415static int emR3ExecuteIOInstruction(PVM pVM, PVMCPU pVCpu)
    416416{
     417#ifdef VBOX_WITH_FIRST_IEM_STEP
     418    STAM_PROFILE_START(&pVCpu->em.s.StatIOEmu, a);
     419
     420    /* Hand it over to the interpreter. */
     421    VBOXSTRICTRC rcStrict = IEMExecOne(pVCpu);
     422    LogFlow(("emR3ExecuteIOInstruction: %Rrc\n", VBOXSTRICTRC_VAL(rcStrict)));
     423    STAM_COUNTER_INC(&pVCpu->em.s.CTX_SUFF(pStats)->StatIoIem);
     424    STAM_PROFILE_STOP(&pVCpu->em.s.StatIOEmu, a);
     425    return VBOXSTRICTRC_TODO(rcStrict);
     426
     427#else
    417428    PCPUMCTX pCtx = pVCpu->em.s.pCtx;
    418429
     
    497508    STAM_PROFILE_STOP(&pVCpu->em.s.StatIOEmu, a);
    498509    return emR3ExecuteInstruction(pVM, pVCpu, "IO: ");
     510#endif
    499511}
    500512
  • trunk/src/VBox/VMM/include/EMInternal.h

    r46423 r47421  
    266266    /** @name Privileged Instructions Ending Up In HC.
    267267     * @{ */
     268    STAMCOUNTER             StatIoRestarted;
     269#ifdef VBOX_WITH_FIRST_IEM_STEP
     270    STAMCOUNTER             StatIoIem;
     271#else
     272    STAMCOUNTER             StatIn;
     273    STAMCOUNTER             StatOut;
     274#endif
    268275    STAMCOUNTER             StatCli;
    269276    STAMCOUNTER             StatSti;
    270     STAMCOUNTER             StatIn;
    271     STAMCOUNTER             StatIoRestarted;
    272     STAMCOUNTER             StatOut;
    273277    STAMCOUNTER             StatInvlpg;
    274278    STAMCOUNTER             StatHlt;
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