VirtualBox

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


Ignore:
Timestamp:
Jun 15, 2018 11:00:02 AM (6 years ago)
Author:
vboxsync
Message:

EM,HM: Replaced HM exit history with the EM one. VT-x now reads TSC on every exit even when VMX_VMCS_CTRL_PROC_EXEC_RDTSC_EXIT is set. VT-x needed an API for updating the PC as RIP and CS are fetched from the VMCB. bugref:9044

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

Legend:

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

    r72558 r72560  
    290290     * Register info dumpers.
    291291     */
    292     int rc = DBGFR3InfoRegisterInternalEx(pVM, "exits", "Dumps the VM-exit history.",
    293                                           emR3InfoExitHistory, DBGFINFO_FLAGS_ALL_EMTS);
     292    const char *pszExitsDesc = "Dumps the VM-exit history. Arguments: Number of entries; 'asc', 'ascending' or 'reverse'.";
     293    int rc = DBGFR3InfoRegisterInternalEx(pVM, "exits", pszExitsDesc, emR3InfoExitHistory, DBGFINFO_FLAGS_ALL_EMTS);
     294    AssertLogRelRCReturn(rc, rc);
     295    rc = DBGFR3InfoRegisterInternalEx(pVM, "exithistory", pszExitsDesc, emR3InfoExitHistory, DBGFINFO_FLAGS_ALL_EMTS);
    294296    AssertLogRelRCReturn(rc, rc);
    295297
  • trunk/src/VBox/VMM/VMMR3/HM.cpp

    r72555 r72560  
    383383static DECLCALLBACK(int)  hmR3Load(PVM pVM, PSSMHANDLE pSSM, uint32_t uVersion, uint32_t uPass);
    384384static DECLCALLBACK(void) hmR3InfoSvmNstGstVmcbCache(PVM pVM, PCDBGFINFOHLP pHlp, const char *pszArgs);
    385 static DECLCALLBACK(void) hmR3InfoExitHistory(PVM pVM, PCDBGFINFOHLP pHlp, const char *pszArgs);
     385static DECLCALLBACK(void) hmR3Info(PVM pVM, PCDBGFINFOHLP pHlp, const char *pszArgs);
    386386static DECLCALLBACK(void) hmR3InfoEventPending(PVM pVM, PCDBGFINFOHLP pHlp, const char *pszArgs);
    387387static int                hmR3InitCPU(PVM pVM);
     
    439439     * Register info handlers.
    440440     */
    441     rc = DBGFR3InfoRegisterInternalEx(pVM, "exithistory", "Dumps the HM VM-exit history.", hmR3InfoExitHistory,
    442                                       DBGFINFO_FLAGS_ALL_EMTS);
     441    rc = DBGFR3InfoRegisterInternalEx(pVM, "hm", "Dumps HM info.", hmR3Info, DBGFINFO_FLAGS_ALL_EMTS);
    443442    AssertRCReturn(rc, rc);
    444443
     
    36803679 * @param   pszArgs     Arguments, ignored.
    36813680 */
    3682 static DECLCALLBACK(void) hmR3InfoExitHistory(PVM pVM, PCDBGFINFOHLP pHlp, const char *pszArgs)
     3681static DECLCALLBACK(void) hmR3Info(PVM pVM, PCDBGFINFOHLP pHlp, const char *pszArgs)
    36833682{
    36843683    NOREF(pszArgs);
     
    36893688    if (HMIsEnabled(pVM))
    36903689    {
    3691         bool const fIsVtx = pVM->hm.s.vmx.fSupported;
    3692         const char * const *papszDesc;
    3693         unsigned cMaxExitDesc;
    3694         if (fIsVtx)
    3695         {
    3696             cMaxExitDesc = MAX_EXITREASON_VTX;
    3697             papszDesc    = &g_apszVTxExitReasons[0];
    3698             pHlp->pfnPrintf(pHlp, "CPU[%u]: VT-x VM-exit history:\n", pVCpu->idCpu);
    3699         }
     3690        if (pVM->hm.s.vmx.fSupported)
     3691            pHlp->pfnPrintf(pHlp, "CPU[%u]: VT-x info:\n", pVCpu->idCpu);
    37003692        else
    3701         {
    3702             cMaxExitDesc = MAX_EXITREASON_AMDV;
    3703             papszDesc    = &g_apszAmdVExitReasons[0];
    3704             pHlp->pfnPrintf(pHlp, "CPU[%u]: AMD-V #VMEXIT history:\n", pVCpu->idCpu);
    3705         }
    3706 
    3707         pHlp->pfnPrintf(pHlp, "  idxExitHistoryFree = %u\n", pVCpu->hm.s.idxExitHistoryFree);
    3708         unsigned const idxLast = pVCpu->hm.s.idxExitHistoryFree > 0 ?
    3709                                                                     pVCpu->hm.s.idxExitHistoryFree - 1 :
    3710                                                                     RT_ELEMENTS(pVCpu->hm.s.auExitHistory) - 1;
    3711         for (unsigned i = 0; i < RT_ELEMENTS(pVCpu->hm.s.auExitHistory); i++)
    3712         {
    3713             uint16_t const uExit = pVCpu->hm.s.auExitHistory[i];
    3714             const char *pszExit  = NULL;
    3715             if (uExit <= cMaxExitDesc)
    3716                 pszExit = papszDesc[uExit];
    3717             else if (!fIsVtx)
    3718                 pszExit = hmSvmGetSpecialExitReasonDesc(uExit);
    3719             else
    3720                 pszExit = NULL;
    3721 
    3722             pHlp->pfnPrintf(pHlp, "  auExitHistory[%2u] = 0x%04x  %s %s\n", i, uExit, pszExit,
    3723                             idxLast == i ? "<-- Latest exit" : "");
    3724         }
    3725         pHlp->pfnPrintf(pHlp, "HM error = %#x (%u)\n", pVCpu->hm.s.u32HMError, pVCpu->hm.s.u32HMError);
     3693            pHlp->pfnPrintf(pHlp, "CPU[%u]: AMD-V info:\n", pVCpu->idCpu);
     3694        pHlp->pfnPrintf(pHlp, "  HM error = %#x (%u)\n", pVCpu->hm.s.u32HMError, pVCpu->hm.s.u32HMError);
    37263695    }
    37273696    else
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