VirtualBox

Changeset 71344 in vbox for trunk/src/VBox/VMM/VMMR0


Ignore:
Timestamp:
Mar 15, 2018 9:15:57 AM (7 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
121295
Message:

VMM/HM: Add nested-guest exit reason stat array for SVM R0 execution.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/VMM/VMMR0/HMSVMR0.cpp

    r71313 r71344  
    5858            STAM_COUNTER_INC(&pVCpu->hm.s.paStatExitReasonR0[(u64ExitCode) & MASK_EXITREASON_STAT]); \
    5959        } while (0)
     60
     61# ifdef VBOX_WITH_NESTED_HWVIRT
     62#  define HMSVM_NESTED_EXITCODE_STAM_COUNTER_INC(u64ExitCode) do { \
     63        STAM_COUNTER_INC(&pVCpu->hm.s.StatExitAll); \
     64        if ((u64ExitCode) == SVM_EXIT_NPF) \
     65            STAM_COUNTER_INC(&pVCpu->hm.s.StatNestedExitReasonNpf); \
     66        else \
     67            STAM_COUNTER_INC(&pVCpu->hm.s.paStatNestedExitReasonR0[(u64ExitCode) & MASK_EXITREASON_STAT]); \
     68        } while (0)
     69# endif
    6070#else
    61 # define HMSVM_EXITCODE_STAM_COUNTER_INC(u64ExitCode) do { } while (0)
    62 #endif
     71# define HMSVM_EXITCODE_STAM_COUNTER_INC(u64ExitCode)           do { } while (0)
     72# ifdef VBOX_WITH_NESTED_HWVIRT
     73#  define HMSVM_NESTED_EXITCODE_STAM_COUNTER_INC(u64ExitCode)   do { } while (0)
     74# endif
     75#endif /* !VBOX_WITH_STATISTICS */
     76
    6377
    6478/** If we decide to use a function table approach this can be useful to
     
    25382552     * Guest Virtual GIF (Global Interrupt Flag).
    25392553     */
    2540     if (   pVmcb->ctrl.IntCtrl.n.u1VGifEnable == 1
    2541         && !CPUMIsGuestInSvmNestedHwVirtMode(pMixedCtx))
     2554    if (pVmcb->ctrl.IntCtrl.n.u1VGifEnable == 1)
    25422555    {
    25432556        Assert(pVCpu->CTX_SUFF(pVM)->hm.s.svm.fVGif);
     2557        Assert(!CPUMIsGuestInSvmNestedHwVirtMode(pMixedCtx));
    25442558        pMixedCtx->hwvirt.fGif = pVmcb->ctrl.IntCtrl.n.u1VGif;
    25452559    }
     
    48794893
    48804894        /* Handle the #VMEXIT. */
    4881         HMSVM_EXITCODE_STAM_COUNTER_INC(SvmTransient.u64ExitCode);
     4895        HMSVM_NESTED_EXITCODE_STAM_COUNTER_INC(SvmTransient.u64ExitCode);
    48824896        STAM_PROFILE_ADV_STOP_START(&pVCpu->hm.s.StatExit1, &pVCpu->hm.s.StatExit2, x);
    48834897        VBOXVMM_R0_HMSVM_VMEXIT(pVCpu, pCtx, SvmTransient.u64ExitCode, pCtx->hwvirt.svm.CTX_SUFF(pVmcb));
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