VirtualBox

Changeset 106101 in vbox for trunk/src/VBox


Ignore:
Timestamp:
Sep 19, 2024 9:16:19 PM (3 months ago)
Author:
vboxsync
Message:

VMM/IEM: More native eflag stats. Added IEMNATIVE_WITH_EFLAGS_POSTPONING config option (no code). bugref:10720

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

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/VMM/VMMAll/target-x86/IEMAllN8veEmit-x86.h

    r106037 r106101  
    207207                              )
    208208{
     209    STAM_COUNTER_INC(&pReNative->pVCpu->iem.s.StatNativeEflTotalLogical);
     210
    209211#ifdef IEMNATIVE_WITH_EFLAGS_SKIPPING
    210212    /*
     
    309311                                 )
    310312{
     313    STAM_COUNTER_INC(&pReNative->pVCpu->iem.s.StatNativeEflTotalArithmetic);
     314
    311315#ifdef IEMNATIVE_WITH_EFLAGS_SKIPPING
    312316    /*
     
    15571561                            uint8_t idxRegTmp)
    15581562{
     1563    STAM_COUNTER_INC(&pReNative->pVCpu->iem.s.StatNativeEflTotalShift);
     1564
    15591565RT_NOREF(pReNative, off, idxRegEfl, idxRegResult, idxRegSrc, idxRegCount, cOpBits, enmType);
    15601566#if 0 //def IEMNATIVE_WITH_EFLAGS_SKIPPING
     
    15651571    if (IEMLIVENESS_STATE_ARE_STATUS_EFL_TO_BE_CLOBBERED(pLivenessEntry))
    15661572    {
    1567         STAM_COUNTER_INC(&pReNative->pVCpu->iem.s.StatNativeEflSkippedLogical);
     1573        STAM_COUNTER_INC(&pReNative->pVCpu->iem.s.StatNativeEflSkippedShift);
    15681574# ifdef IEMNATIVE_STRICT_EFLAGS_SKIPPING
    15691575        off = iemNativeEmitOrImmIntoVCpuU32(pReNative, off, X86_EFL_STATUS_BITS, RT_UOFFSETOF(VMCPU, iem.s.fSkippingEFlags));
  • trunk/src/VBox/VMM/VMMR3/IEMR3.cpp

    r106090 r106101  
    733733        STAMR3RegisterF(pVM, &pVCpu->iem.s.StatNativeEflSkippedArithmetic,      STAMTYPE_COUNTER, STAMVISIBILITY_ALWAYS, STAMUNIT_COUNT,
    734734                        "Skipped all status flag updating, arithmetic instructions",
    735                         "/IEM/CPU%u/re/NativeEFlagsSkippedArithmetic", idCpu);
    736         STAMR3RegisterF(pVM, &pVCpu->iem.s.StatNativeEflSkippedLogical,      STAMTYPE_COUNTER, STAMVISIBILITY_ALWAYS, STAMUNIT_COUNT,
     735                        "/IEM/CPU%u/re/NativeEFlags/ArithmeticSkipped", idCpu);
     736        STAMR3RegisterF(pVM, &pVCpu->iem.s.StatNativeEflTotalArithmetic,        STAMTYPE_COUNTER, STAMVISIBILITY_ALWAYS, STAMUNIT_COUNT,
     737                        "Total number of arithmetic intructions with status flag updating",
     738                        "/IEM/CPU%u/re/NativeEFlags/ArithmeticTotal", idCpu);
     739        RTStrPrintf(szPat, sizeof(szPat), "/IEM/CPU%u/re/NativeEFlags/ArithmeticTotal", idCpu);
     740        RTStrPrintf(szVal, sizeof(szVal), "/IEM/CPU%u/re/NativeEFlags/ArithmeticSkipped", idCpu);
     741        STAMR3RegisterPctOfSum(pVM->pUVM, STAMVISIBILITY_ALWAYS, STAMUNIT_PCT, szVal, false, szPat,
     742                               "Skipped all status flag updating, arithmetic instructions, percentage",
     743                               "/IEM/CPU%u/re/NativeEFlags/ArithmeticSkippedPct", idCpu);
     744
     745        STAMR3RegisterF(pVM, &pVCpu->iem.s.StatNativeEflSkippedLogical,         STAMTYPE_COUNTER, STAMVISIBILITY_ALWAYS, STAMUNIT_COUNT,
    737746                        "Skipped all status flag updating, logical instructions",
    738                         "/IEM/CPU%u/re/NativeEFlagsSkippedLogical", idCpu);
     747                        "/IEM/CPU%u/re/NativeEFlags/LogicalSkipped", idCpu);
     748        STAMR3RegisterF(pVM, &pVCpu->iem.s.StatNativeEflTotalLogical,           STAMTYPE_COUNTER, STAMVISIBILITY_ALWAYS, STAMUNIT_COUNT,
     749                        "Total number of logical intructions with status flag updating",
     750                        "/IEM/CPU%u/re/NativeEFlags/LogicalTotal", idCpu);
     751        RTStrPrintf(szPat, sizeof(szPat), "/IEM/CPU%u/re/NativeEFlags/LogicalTotal", idCpu);
     752        RTStrPrintf(szVal, sizeof(szVal), "/IEM/CPU%u/re/NativeEFlags/LogicalSkipped", idCpu);
     753        STAMR3RegisterPctOfSum(pVM->pUVM, STAMVISIBILITY_ALWAYS, STAMUNIT_PCT, szVal, false, szPat,
     754                               "Skipped all status flag updating, logical instructions, percentage",
     755                               "/IEM/CPU%u/re/NativeEFlags/LogicalSkippedPct", idCpu);
     756
     757        STAMR3RegisterF(pVM, &pVCpu->iem.s.StatNativeEflSkippedShift,           STAMTYPE_COUNTER, STAMVISIBILITY_ALWAYS, STAMUNIT_COUNT,
     758                        "Skipped all status flag updating, shift instructions",
     759                        "/IEM/CPU%u/re/NativeEFlags/ShiftSkipped", idCpu);
     760        STAMR3RegisterF(pVM, &pVCpu->iem.s.StatNativeEflTotalShift,             STAMTYPE_COUNTER, STAMVISIBILITY_ALWAYS, STAMUNIT_COUNT,
     761                        "Total number of shift intructions with status flag updating",
     762                        "/IEM/CPU%u/re/NativeEFlags/ShiftTotal", idCpu);
     763        RTStrPrintf(szPat, sizeof(szPat), "/IEM/CPU%u/re/NativeEFlags/ShiftTotal", idCpu);
     764        RTStrPrintf(szVal, sizeof(szVal), "/IEM/CPU%u/re/NativeEFlags/ShiftSkipped", idCpu);
     765        STAMR3RegisterPctOfSum(pVM->pUVM, STAMVISIBILITY_ALWAYS, STAMUNIT_PCT, szVal, false, szPat,
     766                               "Skipped all status flag updating, shift instructions, percentage",
     767                               "/IEM/CPU%u/re/NativeEFlags/ShiftSkippedPct", idCpu);
    739768
    740769        STAMR3RegisterF(pVM, &pVCpu->iem.s.StatNativeLivenessEflCfSkippable,    STAMTYPE_COUNTER, STAMVISIBILITY_ALWAYS, STAMUNIT_COUNT, "Skippable EFLAGS.CF updating",       "/IEM/CPU%u/re/NativeLivenessEFlags/CfSkippable", idCpu);
  • trunk/src/VBox/VMM/include/IEMInternal.h

    r105877 r106101  
    23632363    /** Native recompiler: Number of times status flags calc has been skipped. */
    23642364    STAMCOUNTER             StatNativeEflSkippedArithmetic;
     2365    /** Native recompiler: Total number instructions in this category. */
     2366    STAMCOUNTER             StatNativeEflTotalArithmetic;
     2367
    23652368    /** Native recompiler: Number of times status flags calc has been skipped. */
    23662369    STAMCOUNTER             StatNativeEflSkippedLogical;
     2370    /** Native recompiler: Total number instructions in this category. */
     2371    STAMCOUNTER             StatNativeEflTotalLogical;
     2372
     2373    /** Native recompiler: Number of times status flags calc has been skipped. */
     2374    STAMCOUNTER             StatNativeEflSkippedShift;
     2375    /** Native recompiler: Total number instructions in this category. */
     2376    STAMCOUNTER             StatNativeEflTotalShift;
    23672377
    23682378    /** Native recompiler: Number of opportunities to skip EFLAGS.CF updating. */
     
    25372547
    25382548#ifdef IEM_WITH_TLB_TRACE
    2539     uint64_t                au64Padding[4];
     2549    //uint64_t                au64Padding[0];
    25402550#else
    2541     uint64_t                au64Padding[6];
     2551    uint64_t                au64Padding[2];
    25422552#endif
    25432553
  • trunk/src/VBox/VMM/include/IEMN8veRecompiler.h

    r106099 r106101  
    5050#if 1 || defined(DOXYGEN_RUNNING)
    5151# define IEMNATIVE_WITH_LIVENESS_ANALYSIS
    52 /*# define IEMLIVENESS_EXTENDED_LAYOUT*/
    5352#endif
    5453
     
    6968# define IEMNATIVE_STRICT_EFLAGS_SKIPPING
    7069#endif
     70
     71/** @def IEMNATIVE_WITH_EFLAGS_POSTPONING
     72 * Enables delaying EFLAGS calculations/updating to conditional code paths
     73 * that are (hopefully) not taken so frequently.
     74 *
     75 * This can only help with case where there is an conditional
     76 * call/exception/tbexit that needs the flag, but in the default code stream the
     77 * flag will be clobbered.  Useful for TlbMiss scenarios and sequences of memory
     78 * based instructions clobbering status flags. */
     79#if defined(IEMNATIVE_WITH_LIVENESS_ANALYSIS) || defined(DOXYGEN_RUNNING)
     80# if 0
     81#  define IEMNATIVE_WITH_EFLAGS_POSTPONING
     82# endif
     83#endif
     84
     85/** @def IEMLIVENESS_EXTENDED_LAYOUT
     86 * Enables the extended liveness data layout.  */
     87#if defined(IEMNATIVE_WITH_EFLAGS_POSTPONING) || defined(DOXYGEN_RUNNING) || 0
     88# define IEMLIVENESS_EXTENDED_LAYOUT
     89#endif
     90
    7191
    7292#ifdef VBOX_WITH_STATISTICS
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