VirtualBox

Changeset 71381 in vbox for trunk/src/VBox


Ignore:
Timestamp:
Mar 20, 2018 8:43:34 AM (7 years ago)
Author:
vboxsync
Message:

VMM/HM: Added VM debugger info dumping for SVM nested-guest VMCB cache.

File:
1 edited

Legend:

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

    r71344 r71381  
    382382static DECLCALLBACK(int)  hmR3Save(PVM pVM, PSSMHANDLE pSSM);
    383383static DECLCALLBACK(int)  hmR3Load(PVM pVM, PSSMHANDLE pSSM, uint32_t uVersion, uint32_t uPass);
     384static DECLCALLBACK(void) hmR3InfoSvmNstGstVmcbCache(PVM pVM, PCDBGFINFOHLP pHlp, const char *pszArgs);
    384385static DECLCALLBACK(void) hmR3InfoExitHistory(PVM pVM, PCDBGFINFOHLP pHlp, const char *pszArgs);
    385386static DECLCALLBACK(void) hmR3InfoEventPending(PVM pVM, PCDBGFINFOHLP pHlp, const char *pszArgs);
     
    444445    rc = DBGFR3InfoRegisterInternalEx(pVM, "hmeventpending", "Dumps the pending HM event.", hmR3InfoEventPending,
    445446                                      DBGFINFO_FLAGS_ALL_EMTS);
     447    AssertRCReturn(rc, rc);
     448
     449    rc = DBGFR3InfoRegisterInternalEx(pVM, "svmvmcbcache", "Dumps the HM SVM nested-guest VMCB cache.",
     450                                      hmR3InfoSvmNstGstVmcbCache, DBGFINFO_FLAGS_ALL_EMTS);
    446451    AssertRCReturn(rc, rc);
    447452
     
    37353740}
    37363741
     3742
     3743/**
     3744 * Displays the SVM nested-guest VMCB cache.
     3745 *
     3746 * @param   pVM         The cross context VM structure.
     3747 * @param   pHlp        The info helper functions.
     3748 * @param   pszArgs     Arguments, ignored.
     3749 */
     3750static DECLCALLBACK(void) hmR3InfoSvmNstGstVmcbCache(PVM pVM, PCDBGFINFOHLP pHlp, const char *pszArgs)
     3751{
     3752    NOREF(pszArgs);
     3753    PVMCPU pVCpu = VMMGetCpu(pVM);
     3754    if (!pVCpu)
     3755        pVCpu = &pVM->aCpus[0];
     3756
     3757    bool const fSvmEnabled = HMR3IsSvmEnabled(pVM->pUVM);
     3758    if (   fSvmEnabled
     3759        && pVM->cpum.ro.GuestFeatures.fSvm)
     3760    {
     3761        PCCPUMCTX            pCtx = CPUMQueryGuestCtxPtr(pVCpu);
     3762        PCSVMNESTEDVMCBCACHE pVmcbNstGstCache = &pVCpu->hm.s.svm.NstGstVmcbCache;
     3763        pHlp->pfnPrintf(pHlp, "CPU[%u]: HM nested-guest VMCB cache\n", pVCpu->idCpu);
     3764        pHlp->pfnPrintf(pHlp, "  fHMCachedVmcb     = %#RTbool\n", pCtx->hwvirt.svm.fHMCachedVmcb);
     3765        pHlp->pfnPrintf(pHlp, "  u16InterceptRdCRx = %#RX16\n",   pVmcbNstGstCache->u16InterceptRdCRx);
     3766        pHlp->pfnPrintf(pHlp, "  u16InterceptWrCRx = %#RX16\n",   pVmcbNstGstCache->u16InterceptWrCRx);
     3767        pHlp->pfnPrintf(pHlp, "  u16InterceptRdDRx = %#RX16\n",   pVmcbNstGstCache->u16InterceptRdDRx);
     3768        pHlp->pfnPrintf(pHlp, "  u16InterceptWrDRx = %#RX16\n",   pVmcbNstGstCache->u16InterceptWrDRx);
     3769        pHlp->pfnPrintf(pHlp, "  u32InterceptXcpt  = %#RX32\n",   pVmcbNstGstCache->u32InterceptXcpt);
     3770        pHlp->pfnPrintf(pHlp, "  u64InterceptCtrl  = %#RX64\n",   pVmcbNstGstCache->u64InterceptCtrl);
     3771        pHlp->pfnPrintf(pHlp, "  u64IOPMPhysAddr   = %#RX64\n",   pVmcbNstGstCache->u64IOPMPhysAddr);
     3772        pHlp->pfnPrintf(pHlp, "  u64MSRPMPhysAddr  = %#RX64\n",   pVmcbNstGstCache->u64MSRPMPhysAddr);
     3773        pHlp->pfnPrintf(pHlp, "  u64TSCOffset      = %#RX64\n",   pVmcbNstGstCache->u64TSCOffset);
     3774        pHlp->pfnPrintf(pHlp, "  u32VmcbCleanBits  = %#RX32\n",   pVmcbNstGstCache->u32VmcbCleanBits);
     3775        pHlp->pfnPrintf(pHlp, "  TLBCtrl           = %#RX64\n",   pVmcbNstGstCache->TLBCtrl);
     3776        pHlp->pfnPrintf(pHlp, "    u32ASID           = %#RX64\n", pVmcbNstGstCache->TLBCtrl.n.u32ASID);
     3777        pHlp->pfnPrintf(pHlp, "    u8TLBFlush        = %#RX64\n", pVmcbNstGstCache->TLBCtrl.n.u8TLBFlush);
     3778        pHlp->pfnPrintf(pHlp, "  u1NestedPaging    = %RTbool\n",  pVmcbNstGstCache->u1NestedPaging);
     3779        pHlp->pfnPrintf(pHlp, "  u1LbrVirt         = %RTbool\n",  pVmcbNstGstCache->u1LbrVirt);
     3780        pHlp->pfnPrintf(pHlp, "  u64CR0            = %#RX64\n",   pVmcbNstGstCache->u64CR0);
     3781        pHlp->pfnPrintf(pHlp, "  u64CR3            = %#RX64\n",   pVmcbNstGstCache->u64CR3);
     3782        pHlp->pfnPrintf(pHlp, "  u64CR4            = %#RX64\n",   pVmcbNstGstCache->u64CR4);
     3783        pHlp->pfnPrintf(pHlp, "  u64EFER           = %#RX64\n",   pVmcbNstGstCache->u64EFER);
     3784        pHlp->pfnPrintf(pHlp, "  u64DBGCTL         = %#RX64\n",   pVmcbNstGstCache->u64DBGCTL);
     3785        pHlp->pfnPrintf(pHlp, "  fVIntrMasking     = %RTbool\n",  pVmcbNstGstCache->fVIntrMasking);
     3786    }
     3787    else
     3788    {
     3789        if (!fSvmEnabled)
     3790            pHlp->pfnPrintf(pHlp, "HM SVM is not enabled for this VM!\n");
     3791        else
     3792            pHlp->pfnPrintf(pHlp, "SVM feature is not exposed to the guest!\n");
     3793    }
     3794}
     3795
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