VirtualBox

Changeset 71293 in vbox for trunk/src/VBox/VMM/VMMR3


Ignore:
Timestamp:
Mar 9, 2018 9:11:20 PM (7 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
121228
Message:

NEM: Some stats; doc updates. bugref:9044

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

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/VMM/VMMR3/EM.cpp

    r71020 r71293  
    430430        EM_REG_PROFILE(&pVCpu->em.s.StatIEMThenREM,         "/PROF/CPU%d/EM/IEMThenRem",        "Profiling IEM-then-REM instruction execution (by IEM).");
    431431        EM_REG_PROFILE(&pVCpu->em.s.StatNEMEntry,           "/PROF/CPU%d/EM/NEMEnter",          "Profiling NEM entry overhead.");
     432#endif /* VBOX_WITH_STATISTICS */
    432433        EM_REG_PROFILE(&pVCpu->em.s.StatNEMExec,            "/PROF/CPU%d/EM/NEMExec",           "Profiling NEM execution.");
    433434        EM_REG_COUNTER(&pVCpu->em.s.StatNEMExecuteCalled,   "/PROF/CPU%d/EM/NEMExecuteCalled",  "Number of times enmR3NEMExecute is called.");
     435#ifdef VBOX_WITH_STATISTICS
    434436        EM_REG_PROFILE(&pVCpu->em.s.StatREMEmu,             "/PROF/CPU%d/EM/REMEmuSingle",      "Profiling single instruction REM execution.");
    435437        EM_REG_PROFILE(&pVCpu->em.s.StatREMExec,            "/PROF/CPU%d/EM/REMExec",           "Profiling REM execution.");
     
    438440        EM_REG_PROFILE(&pVCpu->em.s.StatRAWExec,            "/PROF/CPU%d/EM/RAWExec",           "Profiling Raw Mode execution.");
    439441        EM_REG_PROFILE(&pVCpu->em.s.StatRAWTail,            "/PROF/CPU%d/EM/RAWTail",           "Profiling Raw Mode tail overhead.");
    440 
    441442#endif /* VBOX_WITH_STATISTICS */
    442443
  • trunk/src/VBox/VMM/VMMR3/EMR3Nem.cpp

    r71031 r71293  
    361361    *pfFFDone = false;
    362362
    363     STAM_COUNTER_INC(&pVCpu->em.s.StatNEMExecuteCalled);
     363    STAM_REL_COUNTER_INC(&pVCpu->em.s.StatNEMExecuteCalled);
    364364
    365365    /*
     
    421421         * Execute the code.
    422422         */
    423         STAM_PROFILE_ADV_STOP(&pVCpu->em.s.StatNEMEntry, a);
    424 
    425423        if (RT_LIKELY(emR3IsExecutionAllowed(pVM, pVCpu)))
    426424        {
    427             STAM_PROFILE_START(&pVCpu->em.s.StatNEMExec, x);
     425            STAM_PROFILE_ADV_STOP(&pVCpu->em.s.StatNEMEntry, a);
     426            STAM_REL_PROFILE_START(&pVCpu->em.s.StatNEMExec, x);
    428427            rcStrict = NEMR3RunGC(pVM, pVCpu);
    429             STAM_PROFILE_STOP(&pVCpu->em.s.StatNEMExec, x);
     428            STAM_REL_PROFILE_STOP(&pVCpu->em.s.StatNEMExec, x);
    430429        }
    431430        else
    432431        {
    433432            /* Give up this time slice; virtual time continues */
     433            STAM_PROFILE_ADV_STOP(&pVCpu->em.s.StatNEMEntry, a);
    434434            STAM_REL_PROFILE_ADV_START(&pVCpu->em.s.StatCapped, u);
    435435            RTThreadSleep(5);
  • trunk/src/VBox/VMM/VMMR3/NEMR3Native-win.cpp

    r71289 r71293  
    11001100                        VM_SET_MAIN_EXECUTION_ENGINE(pVM, VM_EXEC_ENGINE_NATIVE_API);
    11011101                        Log(("NEM: Marked active!\n"));
     1102
     1103                        /* Register release statistics */
     1104                        for (VMCPUID iCpu = 0; iCpu < pVM->cCpus; iCpu++)
     1105                        {
     1106                            PNEMCPU pNemCpu = &pVM->aCpus[iCpu].nem.s;
     1107                            STAMR3RegisterF(pVM, &pNemCpu->StatExitPortIo,          STAMTYPE_COUNTER, STAMVISIBILITY_ALWAYS, STAMUNIT_OCCURENCES, "Number of port I/O exits",               "/NEM/CPU%u/ExitPortIo", iCpu);
     1108                            STAMR3RegisterF(pVM, &pNemCpu->StatExitMemUnmapped,     STAMTYPE_COUNTER, STAMVISIBILITY_ALWAYS, STAMUNIT_OCCURENCES, "Number of unmapped memory exits",        "/NEM/CPU%u/ExitMemUnmapped", iCpu);
     1109                            STAMR3RegisterF(pVM, &pNemCpu->StatExitMemIntercept,    STAMTYPE_COUNTER, STAMVISIBILITY_ALWAYS, STAMUNIT_OCCURENCES, "Number of intercepted memory exits",     "/NEM/CPU%u/ExitMemIntercept", iCpu);
     1110                            STAMR3RegisterF(pVM, &pNemCpu->StatExitHalt,            STAMTYPE_COUNTER, STAMVISIBILITY_ALWAYS, STAMUNIT_OCCURENCES, "Number of HLT exits",                    "/NEM/CPU%u/ExitHalt", iCpu);
     1111                            STAMR3RegisterF(pVM, &pNemCpu->StatGetMsgTimeout,       STAMTYPE_COUNTER, STAMVISIBILITY_ALWAYS, STAMUNIT_OCCURENCES, "Number of get message timeouts/alerts",  "/NEM/CPU%u/GetMsgTimeout", iCpu);
     1112                            STAMR3RegisterF(pVM, &pNemCpu->StatStopCpuSuccess,      STAMTYPE_COUNTER, STAMVISIBILITY_ALWAYS, STAMUNIT_OCCURENCES, "Number of successful CPU stops",         "/NEM/CPU%u/StopCpuSuccess", iCpu);
     1113                            STAMR3RegisterF(pVM, &pNemCpu->StatStopCpuPending,      STAMTYPE_COUNTER, STAMVISIBILITY_ALWAYS, STAMUNIT_OCCURENCES, "Number of pending CPU stops",            "/NEM/CPU%u/StopCpuPending", iCpu);
     1114                            STAMR3RegisterF(pVM, &pNemCpu->StatCancelChangedState,  STAMTYPE_COUNTER, STAMVISIBILITY_ALWAYS, STAMUNIT_OCCURENCES, "Number of cancel changed state",         "/NEM/CPU%u/CancelChangedState", iCpu);
     1115                            STAMR3RegisterF(pVM, &pNemCpu->StatCancelAlertedThread, STAMTYPE_COUNTER, STAMVISIBILITY_ALWAYS, STAMUNIT_OCCURENCES, "Number of cancel alerted EMT",           "/NEM/CPU%u/CancelAlertedEMT", iCpu);
     1116                            STAMR3RegisterF(pVM, &pNemCpu->StatBreakOnFFPre,        STAMTYPE_COUNTER, STAMVISIBILITY_ALWAYS, STAMUNIT_OCCURENCES, "Number of pre execution FF breaks",      "/NEM/CPU%u/BreakOnFFPre", iCpu);
     1117                            STAMR3RegisterF(pVM, &pNemCpu->StatBreakOnFFPost,       STAMTYPE_COUNTER, STAMVISIBILITY_ALWAYS, STAMUNIT_OCCURENCES, "Number of post execution FF breaks",     "/NEM/CPU%u/BreakOnFFPost", iCpu);
     1118                            STAMR3RegisterF(pVM, &pNemCpu->StatBreakOnCancel,       STAMTYPE_COUNTER, STAMVISIBILITY_ALWAYS, STAMUNIT_OCCURENCES, "Number of cancel execution breaks",      "/NEM/CPU%u/BreakOnCancel", iCpu);
     1119                            STAMR3RegisterF(pVM, &pNemCpu->StatBreakOnStatus,       STAMTYPE_COUNTER, STAMVISIBILITY_ALWAYS, STAMUNIT_OCCURENCES, "Number of status code breaks",           "/NEM/CPU%u/BreakOnStatus", iCpu);
     1120                        }
    11021121                    }
    11031122                }
     
    12751294int nemR3NativeInitCompleted(PVM pVM, VMINITCOMPLETED enmWhat)
    12761295{
     1296    //BOOL fRet = SetThreadPriority(GetCurrentThread(), 0);
     1297    //AssertLogRel(fRet);
     1298
    12771299    NOREF(pVM); NOREF(enmWhat);
    12781300    return VINF_SUCCESS;
     
    22352257 * The CPU creation function boils down to a VidMessageSlotMap call that sets up
    22362258 * and maps a message buffer into ring-3 for async communication with hyper-V
    2237  * and/or the VID.SYS thread actually running the CPU.  When for instance a
    2238  * VMEXIT is encountered, hyper-V sends a message that the
    2239  * WHvRunVirtualProcessor API retrieves (and later acknowledges) via
    2240  * VidMessageSlotHandleAndGetNext.  It should be noteded that
     2259 * and/or the VID.SYS thread actually running the CPU thru
     2260 * WinHvRunVpDispatchLoop().  When for instance a VMEXIT is encountered, hyper-V
     2261 * sends a message that the WHvRunVirtualProcessor API retrieves (and later
     2262 * acknowledges) via VidMessageSlotHandleAndGetNext.  It should be noteded that
    22412263 * WHvDeleteVirtualProcessor doesn't do much as there seems to be no partner
    22422264 * function VidMessagesSlotMap that reverses what it did.
     
    22572279 * VMEXIT message.  Hyper-V / VID.SYS will return information about the message
    22582280 * in the message buffer mapping, and WHvRunVirtualProcessor will convert that
    2259  * into it's own WHV_RUN_VP_EXIT_CONTEXT format.
     2281 * finto it's own WHV_RUN_VP_EXIT_CONTEXT format.
    22602282 *
    22612283 * Other threads can interrupt the execution by using WHvCancelVirtualProcessor,
     
    22882310 *   and 5% for MMIO.
    22892311 *
     2312 *   While the tests we've done are using tight tight loops only doing port I/O
     2313 *   and MMIO, the problem is clearly visible when running regular guest OSes.
     2314 *   Anything that hammers the VGA device would be suffering, for example:
     2315 *
     2316 *       - Windows 2000 boot screen animation overloads us with MMIO exits
     2317 *         and won't even boot because all the time is spent in interrupt
     2318 *         handlers and redrawin the screen.
     2319 *
     2320 *       - DSL 4.4 and its bootmenu logo is slower than molasses in january.
     2321 *
     2322 *   We have not found a workaround for this yet.
     2323 *
     2324 *   Something that might improve the issue a little is to detect blocks with
     2325 *   excessive MMIO and port I/O exits and emulate instructions to cover
     2326 *   multiple exits before letting Hyper-V have a go at the guest execution
     2327 *   again.  This will only improve the situation under some circumstances,
     2328 *   since emulating instructions without recompilation can be expensive, so
     2329 *   there will only be real gains if the exitting instructions are tightly
     2330 *   packed.
     2331 *
    22902332 *
    22912333 * - The WHvCancelVirtualProcessor API schedules a dummy usermode APC callback
     
    24172459 *
    24182460 *
    2419  * - Why does WINHVR.SYS (or VID.SYS) only query/set 32 registers at the time
    2420  *   thru the HvCallGetVpRegisters and HvCallSetVpRegisters hypercalls?
     2461 * - Why does VID.SYS only query/set 32 registers at the time thru the
     2462 *   HvCallGetVpRegisters and HvCallSetVpRegisters hypercalls?
    24212463 *
    24222464 *   We've not trouble getting/setting all the registers defined by
    2423  *   WHV_REGISTER_NAME in one hypercall (around 80)...
     2465 *   WHV_REGISTER_NAME in one hypercall (around 80).  Some kind of stack
     2466 *   buffering or similar?
    24242467 *
    24252468 *
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