VirtualBox

Changeset 76993 in vbox


Ignore:
Timestamp:
Jan 25, 2019 2:34:46 PM (6 years ago)
Author:
vboxsync
Message:

VMM: Nested VMX: bugref:9180 Allowing fetching VM-exit names from ring-0 as well. Various naming cleanups. Added HMDumpHwvirtVmxState() to be able to dump virtual VMCS state from ring-0 as well. Remove unusued HMIsVmxSupported() function.

Location:
trunk
Files:
21 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/VBox/vmm/hm.h

    r76821 r76993  
    137137VMM_INT_DECL(bool)              HMIsSvmActive(PVM pVM);
    138138VMM_INT_DECL(bool)              HMIsVmxActive(PVM pVM);
    139 VMM_INT_DECL(bool)              HMIsVmxSupported(PVM pVM);
    140 VMM_INT_DECL(const char *)      HMVmxGetDiagDesc(VMXVDIAG enmDiag);
    141 VMM_INT_DECL(const char *)      HMVmxGetAbortDesc(VMXABORT enmAbort);
    142 VMM_INT_DECL(const char *)      HMVmxGetVmcsStateDesc(uint8_t fVmcsState);
    143 VMM_INT_DECL(const char *)      HMVmxGetIdtVectoringInfoTypeDesc(uint8_t uType);
    144 VMM_INT_DECL(const char *)      HMVmxGetExitIntInfoTypeDesc(uint8_t uType);
    145 VMM_INT_DECL(const char *)      HMVmxGetEntryIntInfoTypeDesc(uint8_t uType);
    146 VMM_INT_DECL(void)              HMHCPagingModeChanged(PVM pVM, PVMCPU pVCpu, PGMMODE enmShadowMode, PGMMODE enmGuestMode);
    147 VMM_INT_DECL(void)              HMVmxGetVmxMsrsFromHwvirtMsrs(PCSUPHWVIRTMSRS pMsrs, PVMXMSRS pVmxMsrs);
    148 VMM_INT_DECL(void)              HMVmxGetSvmMsrsFromHwvirtMsrs(PCSUPHWVIRTMSRS pMsrs, PSVMMSRS pSvmMsrs);
     139VMM_INT_DECL(const char *)      HMGetVmxDiagDesc(VMXVDIAG enmDiag);
     140VMM_INT_DECL(const char *)      HMGetVmxAbortDesc(VMXABORT enmAbort);
     141VMM_INT_DECL(const char *)      HMGetVmxVmcsStateDesc(uint8_t fVmcsState);
     142VMM_INT_DECL(const char *)      HMGetVmxIdtVectoringInfoTypeDesc(uint8_t uType);
     143VMM_INT_DECL(const char *)      HMGetVmxExitIntInfoTypeDesc(uint8_t uType);
     144VMM_INT_DECL(const char *)      HMGetVmxEntryIntInfoTypeDesc(uint8_t uType);
     145VMM_INT_DECL(const char *)      HMGetVmxExitName(uint32_t uExit);
     146VMM_INT_DECL(const char *)      HMGetSvmExitName(uint32_t uExit);
     147VMM_INT_DECL(void)              HMDumpHwvirtVmxState(PVMCPU pVCpu);
     148VMM_INT_DECL(void)              HMHCChangedPagingMode(PVM pVM, PVMCPU pVCpu, PGMMODE enmShadowMode, PGMMODE enmGuestMode);
     149VMM_INT_DECL(void)              HMGetVmxMsrsFromHwvirtMsrs(PCSUPHWVIRTMSRS pMsrs, PVMXMSRS pVmxMsrs);
     150VMM_INT_DECL(void)              HMGetSvmMsrsFromHwvirtMsrs(PCSUPHWVIRTMSRS pMsrs, PSVMMSRS pSvmMsrs);
    149151/** @} */
    150152
     
    155157 * found in CPUM.
    156158 * @{ */
    157 VMM_INT_DECL(bool)              HMVmxCanExecuteGuest(PVMCPU pVCpu, PCCPUMCTX pCtx);
     159VMM_INT_DECL(bool)              HMCanExecuteVmxGuest(PVMCPU pVCpu, PCCPUMCTX pCtx);
    158160/** @} */
    159161
     
    171173/** @name R0, R3 HM (VMX/SVM agnostic) handlers.
    172174 * @{ */
    173 VMM_INT_DECL(int)               HMFlushTLB(PVMCPU pVCpu);
    174 VMM_INT_DECL(int)               HMFlushTLBOnAllVCpus(PVM pVM);
     175VMM_INT_DECL(int)               HMFlushTlb(PVMCPU pVCpu);
     176VMM_INT_DECL(int)               HMFlushTlbOnAllVCpus(PVM pVM);
    175177VMM_INT_DECL(int)               HMInvalidatePageOnAllVCpus(PVM pVM, RTGCPTR GCVirt);
    176178VMM_INT_DECL(int)               HMInvalidatePhysPage(PVM pVM, RTGCPHYS GCPhys);
     
    183185/** @name R0, R3 SVM handlers.
    184186 * @{ */
    185 VMM_INT_DECL(bool)              HMSvmIsVGifActive(PVM pVM);
    186 VMM_INT_DECL(uint64_t)          HMSvmNstGstApplyTscOffset(PVMCPU pVCpu, uint64_t uTicks);
     187VMM_INT_DECL(bool)              HMIsSvmVGifActive(PVM pVM);
     188VMM_INT_DECL(uint64_t)          HMApplySvmNstGstTscOffset(PVMCPU pVCpu, uint64_t uTicks);
    187189# ifdef VBOX_WITH_NESTED_HWVIRT_SVM
    188 VMM_INT_DECL(void)              HMSvmNstGstVmExitNotify(PVMCPU pVCpu, PCPUMCTX pCtx);
     190VMM_INT_DECL(void)              HMNotifySvmNstGstVmexit(PVMCPU pVCpu, PCPUMCTX pCtx);
    189191# endif
    190 VMM_INT_DECL(int)               HMSvmIsSubjectToErratum170(uint32_t *pu32Family, uint32_t *pu32Model, uint32_t *pu32Stepping);
    191 VMM_INT_DECL(int)               HMHCSvmMaybeMovTprHypercall(PVMCPU pVCpu);
     192VMM_INT_DECL(int)               HMIsSubjectToSvmErratum170(uint32_t *pu32Family, uint32_t *pu32Model, uint32_t *pu32Stepping);
     193VMM_INT_DECL(int)               HMHCMaybeMovTprSvmHypercall(PVMCPU pVCpu);
    192194/** @} */
    193195
     
    196198/** @name RC HM (VMX/SVM agnostic) handlers.
    197199 * @{ */
    198 # define HMFlushTLB(pVCpu)                                            do { } while (0)
    199 # define HMFlushTLBOnAllVCpus(pVM)                                    do { } while (0)
     200# define HMFlushTlb(pVCpu)                                            do { } while (0)
     201# define HMFlushTlbOnAllVCpus(pVM)                                    do { } while (0)
    200202# define HMInvalidatePageOnAllVCpus(pVM, GCVirt)                      do { } while (0)
    201203# define HMInvalidatePhysPage(pVM,  GCVirt)                           do { } while (0)
     
    208210/** @name RC SVM handlers.
    209211 * @{ */
    210 # define HMSvmIsVGifActive(pVM)                                       false
    211 # define HMSvmNstGstApplyTscOffset(pVCpu, uTicks)                     (uTicks)
    212 # define HMSvmNstGstVmExitNotify(pVCpu, pCtx)                         do { } while (0)
    213 # define HMSvmIsSubjectToErratum170(puFamily, puModel, puStepping)    false
    214 # define HMHCSvmMaybeMovTprHypercall(pVCpu)                           do { } while (0)
     212# define HMIsSvmVGifActive(pVM)                                       false
     213# define HMApplySvmNstGstTscOffset(pVCpu, uTicks)                     (uTicks)
     214# define HMNotifySvmNstGstVmexit(pVCpu, pCtx)                         do { } while (0)
     215# define HMIsSubjectToSvmErratum170(puFamily, puModel, puStepping)    false
     216# define HMHCMaybeMovTprSvmHypercall(pVCpu)                           do { } while (0)
    215217/** @} */
    216218
     
    281283VMMR3_INT_DECL(bool)            HMR3IsRescheduleRequired(PVM pVM, PCPUMCTX pCtx);
    282284VMMR3_INT_DECL(bool)            HMR3IsVmxPreemptionTimerUsed(PVM pVM);
    283 VMMR3DECL(const char *)         HMR3GetVmxExitName(uint32_t uExit);
    284 VMMR3DECL(const char *)         HMR3GetSvmExitName(uint32_t uExit);
    285285/** @} */
    286286#endif /* IN_RING3 */
  • trunk/include/VBox/vmm/hm_svm.h

    r76585 r76993  
    11621162 * @{
    11631163 */
    1164 VMM_INT_DECL(int)       HMSvmGetMsrpmOffsetAndBit(uint32_t idMsr, uint16_t *pbOffMsrpm, uint8_t *puMsrpmBit);
    1165 VMM_INT_DECL(bool)      HMSvmIsIOInterceptActive(void *pvIoBitmap, uint16_t u16Port, SVMIOIOTYPE enmIoType, uint8_t cbReg,
     1164VMM_INT_DECL(int)       HMGetSvmMsrpmOffsetAndBit(uint32_t idMsr, uint16_t *pbOffMsrpm, uint8_t *puMsrpmBit);
     1165VMM_INT_DECL(bool)      HMIsSvmIoInterceptActive(void *pvIoBitmap, uint16_t u16Port, SVMIOIOTYPE enmIoType, uint8_t cbReg,
    11661166                                                 uint8_t cAddrSizeBits, uint8_t iEffSeg, bool fRep, bool fStrIo,
    11671167                                                 PSVMIOIOEXITINFO pIoExitInfo);
  • trunk/include/VBox/vmm/hm_vmx.h

    r76827 r76993  
    14001400/** @name VMX abort reasons.
    14011401 * See Intel spec. "27.7 VMX Aborts".
    1402  * Update HMVmxGetAbortDesc() if new reasons are added.
    1403  * @{
     1402 * Update HMGetVmxAbortDesc() if new reasons are added. @{
    14041403 */
    14051404typedef enum
     
    40944093 * @{
    40954094 */
    4096 VMM_INT_DECL(int)   HMVmxGetMsrPermission(void const *pvMsrBitmap, uint32_t idMsr, PVMXMSREXITREAD penmRead,
     4095VMM_INT_DECL(int)   HMGetVmxMsrPermission(void const *pvMsrBitmap, uint32_t idMsr, PVMXMSREXITREAD penmRead,
    40974096                                          PVMXMSREXITWRITE penmWrite);
    4098 VMM_INT_DECL(bool)  HMVmxGetIoBitmapPermission(void const *pvIoBitmapA, void const *pvIoBitmapB, uint16_t uPort,
     4097VMM_INT_DECL(bool)  HMGetVmxIoBitmapPermission(void const *pvIoBitmapA, void const *pvIoBitmapB, uint16_t uPort,
    40994098                                               uint8_t cbAccess);
    41004099/** @} */
  • trunk/src/VBox/VMM/VMMAll/CPUMAllMsrs.cpp

    r76678 r76993  
    62486248    {
    62496249        /// @todo PGMFlushTLB(pVCpu, cr3, true /*fGlobal*/);
    6250         HMFlushTLB(pVCpu);
     6250        HMFlushTlb(pVCpu);
    62516251
    62526252        /* Notify PGM about NXE changes. */
  • trunk/src/VBox/VMM/VMMAll/CPUMAllRegs.cpp

    r76553 r76993  
    29852985 * @param   uTicks      The guest TSC.
    29862986 *
    2987  * @sa      HMSvmNstGstApplyTscOffset.
     2987 * @sa      HMApplySvmNstGstTscOffset.
    29882988 */
    29892989VMM_INT_DECL(uint64_t) CPUMApplyNestedGuestTscOffset(PVMCPU pVCpu, uint64_t uTicks)
     
    30063006            return uTicks + pVmcb->ctrl.u64TSCOffset;
    30073007        }
    3008         return HMSvmNstGstApplyTscOffset(pVCpu, uTicks);
     3008        return HMApplySvmNstGstTscOffset(pVCpu, uTicks);
    30093009    }
    30103010#else
  • trunk/src/VBox/VMM/VMMAll/HMAll.cpp

    r76797 r76993  
    3939
    4040
     41/*********************************************************************************************************************************
     42*   Global Variables                                                                                                             *
     43*********************************************************************************************************************************/
     44#define EXIT_REASON(a_Def, a_Val, a_Str)      #a_Def " - " #a_Val " - " a_Str
     45#define EXIT_REASON_NIL()                     NULL
     46
     47/** Exit reason descriptions for VT-x, used to describe statistics and exit
     48 *  history. */
     49static const char * const g_apszVmxExitReasons[MAX_EXITREASON_STAT] =
     50{
     51    EXIT_REASON(VMX_EXIT_XCPT_OR_NMI            ,   0, "Exception or non-maskable interrupt (NMI)."),
     52    EXIT_REASON(VMX_EXIT_EXT_INT                ,   1, "External interrupt."),
     53    EXIT_REASON(VMX_EXIT_TRIPLE_FAULT           ,   2, "Triple fault."),
     54    EXIT_REASON(VMX_EXIT_INIT_SIGNAL            ,   3, "INIT signal."),
     55    EXIT_REASON(VMX_EXIT_SIPI                   ,   4, "Start-up IPI (SIPI)."),
     56    EXIT_REASON(VMX_EXIT_IO_SMI_IRQ             ,   5, "I/O system-management interrupt (SMI)."),
     57    EXIT_REASON(VMX_EXIT_SMI_IRQ                ,   6, "Other SMI."),
     58    EXIT_REASON(VMX_EXIT_INT_WINDOW             ,   7, "Interrupt window."),
     59    EXIT_REASON(VMX_EXIT_NMI_WINDOW             ,   8, "NMI window."),
     60    EXIT_REASON(VMX_EXIT_TASK_SWITCH            ,   9, "Task switch."),
     61    EXIT_REASON(VMX_EXIT_CPUID                  ,  10, "CPUID instruction."),
     62    EXIT_REASON(VMX_EXIT_GETSEC                 ,  11, "GETSEC instrunction."),
     63    EXIT_REASON(VMX_EXIT_HLT                    ,  12, "HLT instruction."),
     64    EXIT_REASON(VMX_EXIT_INVD                   ,  13, "INVD instruction."),
     65    EXIT_REASON(VMX_EXIT_INVLPG                 ,  14, "INVLPG instruction."),
     66    EXIT_REASON(VMX_EXIT_RDPMC                  ,  15, "RDPMCinstruction."),
     67    EXIT_REASON(VMX_EXIT_RDTSC                  ,  16, "RDTSC instruction."),
     68    EXIT_REASON(VMX_EXIT_RSM                    ,  17, "RSM instruction in SMM."),
     69    EXIT_REASON(VMX_EXIT_VMCALL                 ,  18, "VMCALL instruction."),
     70    EXIT_REASON(VMX_EXIT_VMCLEAR                ,  19, "VMCLEAR instruction."),
     71    EXIT_REASON(VMX_EXIT_VMLAUNCH               ,  20, "VMLAUNCH instruction."),
     72    EXIT_REASON(VMX_EXIT_VMPTRLD                ,  21, "VMPTRLD instruction."),
     73    EXIT_REASON(VMX_EXIT_VMPTRST                ,  22, "VMPTRST instruction."),
     74    EXIT_REASON(VMX_EXIT_VMREAD                 ,  23, "VMREAD instruction."),
     75    EXIT_REASON(VMX_EXIT_VMRESUME               ,  24, "VMRESUME instruction."),
     76    EXIT_REASON(VMX_EXIT_VMWRITE                ,  25, "VMWRITE instruction."),
     77    EXIT_REASON(VMX_EXIT_VMXOFF                 ,  26, "VMXOFF instruction."),
     78    EXIT_REASON(VMX_EXIT_VMXON                  ,  27, "VMXON instruction."),
     79    EXIT_REASON(VMX_EXIT_MOV_CRX                ,  28, "Control-register accesses."),
     80    EXIT_REASON(VMX_EXIT_MOV_DRX                ,  29, "Debug-register accesses."),
     81    EXIT_REASON(VMX_EXIT_PORT_IO                ,  30, "I/O instruction."),
     82    EXIT_REASON(VMX_EXIT_RDMSR                  ,  31, "RDMSR instruction."),
     83    EXIT_REASON(VMX_EXIT_WRMSR                  ,  32, "WRMSR instruction."),
     84    EXIT_REASON(VMX_EXIT_ERR_INVALID_GUEST_STATE,  33, "VM-entry failure due to invalid guest state."),
     85    EXIT_REASON(VMX_EXIT_ERR_MSR_LOAD           ,  34, "VM-entry failure due to MSR loading."),
     86    EXIT_REASON_NIL(),
     87    EXIT_REASON(VMX_EXIT_MWAIT                  ,  36, "MWAIT instruction."),
     88    EXIT_REASON(VMX_EXIT_MTF                    ,  37, "Monitor Trap Flag."),
     89    EXIT_REASON_NIL(),
     90    EXIT_REASON(VMX_EXIT_MONITOR                ,  39, "MONITOR instruction."),
     91    EXIT_REASON(VMX_EXIT_PAUSE                  ,  40, "PAUSE instruction."),
     92    EXIT_REASON(VMX_EXIT_ERR_MACHINE_CHECK      ,  41, "VM-entry failure due to machine-check."),
     93    EXIT_REASON_NIL(),
     94    EXIT_REASON(VMX_EXIT_TPR_BELOW_THRESHOLD    ,  43, "TPR below threshold (MOV to CR8)."),
     95    EXIT_REASON(VMX_EXIT_APIC_ACCESS            ,  44, "APIC access."),
     96    EXIT_REASON(VMX_EXIT_VIRTUALIZED_EOI        ,  45, "Virtualized EOI."),
     97    EXIT_REASON(VMX_EXIT_GDTR_IDTR_ACCESS       ,  46, "GDTR/IDTR access using LGDT/SGDT/LIDT/SIDT."),
     98    EXIT_REASON(VMX_EXIT_LDTR_TR_ACCESS         ,  47, "LDTR/TR access using LLDT/SLDT/LTR/STR."),
     99    EXIT_REASON(VMX_EXIT_EPT_VIOLATION          ,  48, "EPT violation."),
     100    EXIT_REASON(VMX_EXIT_EPT_MISCONFIG          ,  49, "EPT misconfiguration."),
     101    EXIT_REASON(VMX_EXIT_INVEPT                 ,  50, "INVEPT instruction."),
     102    EXIT_REASON(VMX_EXIT_RDTSCP                 ,  51, "RDTSCP instruction."),
     103    EXIT_REASON(VMX_EXIT_PREEMPT_TIMER          ,  52, "VMX-preemption timer expired."),
     104    EXIT_REASON(VMX_EXIT_INVVPID                ,  53, "INVVPID instruction."),
     105    EXIT_REASON(VMX_EXIT_WBINVD                 ,  54, "WBINVD instruction."),
     106    EXIT_REASON(VMX_EXIT_XSETBV                 ,  55, "XSETBV instruction."),
     107    EXIT_REASON(VMX_EXIT_APIC_WRITE             ,  56, "APIC write completed to virtual-APIC page."),
     108    EXIT_REASON(VMX_EXIT_RDRAND                 ,  57, "RDRAND instruction."),
     109    EXIT_REASON(VMX_EXIT_INVPCID                ,  58, "INVPCID instruction."),
     110    EXIT_REASON(VMX_EXIT_VMFUNC                 ,  59, "VMFUNC instruction."),
     111    EXIT_REASON(VMX_EXIT_ENCLS                  ,  60, "ENCLS instruction."),
     112    EXIT_REASON(VMX_EXIT_RDSEED                 ,  61, "RDSEED instruction."),
     113    EXIT_REASON(VMX_EXIT_PML_FULL               ,  62, "Page-modification log full."),
     114    EXIT_REASON(VMX_EXIT_XSAVES                 ,  63, "XSAVES instruction."),
     115    EXIT_REASON(VMX_EXIT_XRSTORS                ,  64, "XRSTORS instruction.")
     116};
     117/** Array index of the last valid VT-x exit reason. */
     118#define MAX_EXITREASON_VTX                         64
     119
     120/** A partial list of \#EXIT reason descriptions for AMD-V, used to describe
     121 *  statistics and exit history.
     122 *
     123 *  @note AMD-V have annoyingly large gaps (e.g. \#NPF VMEXIT comes at 1024),
     124 *        this array doesn't contain the entire set of exit reasons, we
     125 *        handle them via hmSvmGetSpecialExitReasonDesc(). */
     126static const char * const g_apszSvmExitReasons[MAX_EXITREASON_STAT] =
     127{
     128    EXIT_REASON(SVM_EXIT_READ_CR0     ,    0, "Read CR0."),
     129    EXIT_REASON(SVM_EXIT_READ_CR1     ,    1, "Read CR1."),
     130    EXIT_REASON(SVM_EXIT_READ_CR2     ,    2, "Read CR2."),
     131    EXIT_REASON(SVM_EXIT_READ_CR3     ,    3, "Read CR3."),
     132    EXIT_REASON(SVM_EXIT_READ_CR4     ,    4, "Read CR4."),
     133    EXIT_REASON(SVM_EXIT_READ_CR5     ,    5, "Read CR5."),
     134    EXIT_REASON(SVM_EXIT_READ_CR6     ,    6, "Read CR6."),
     135    EXIT_REASON(SVM_EXIT_READ_CR7     ,    7, "Read CR7."),
     136    EXIT_REASON(SVM_EXIT_READ_CR8     ,    8, "Read CR8."),
     137    EXIT_REASON(SVM_EXIT_READ_CR9     ,    9, "Read CR9."),
     138    EXIT_REASON(SVM_EXIT_READ_CR10    ,   10, "Read CR10."),
     139    EXIT_REASON(SVM_EXIT_READ_CR11    ,   11, "Read CR11."),
     140    EXIT_REASON(SVM_EXIT_READ_CR12    ,   12, "Read CR12."),
     141    EXIT_REASON(SVM_EXIT_READ_CR13    ,   13, "Read CR13."),
     142    EXIT_REASON(SVM_EXIT_READ_CR14    ,   14, "Read CR14."),
     143    EXIT_REASON(SVM_EXIT_READ_CR15    ,   15, "Read CR15."),
     144    EXIT_REASON(SVM_EXIT_WRITE_CR0    ,   16, "Write CR0."),
     145    EXIT_REASON(SVM_EXIT_WRITE_CR1    ,   17, "Write CR1."),
     146    EXIT_REASON(SVM_EXIT_WRITE_CR2    ,   18, "Write CR2."),
     147    EXIT_REASON(SVM_EXIT_WRITE_CR3    ,   19, "Write CR3."),
     148    EXIT_REASON(SVM_EXIT_WRITE_CR4    ,   20, "Write CR4."),
     149    EXIT_REASON(SVM_EXIT_WRITE_CR5    ,   21, "Write CR5."),
     150    EXIT_REASON(SVM_EXIT_WRITE_CR6    ,   22, "Write CR6."),
     151    EXIT_REASON(SVM_EXIT_WRITE_CR7    ,   23, "Write CR7."),
     152    EXIT_REASON(SVM_EXIT_WRITE_CR8    ,   24, "Write CR8."),
     153    EXIT_REASON(SVM_EXIT_WRITE_CR9    ,   25, "Write CR9."),
     154    EXIT_REASON(SVM_EXIT_WRITE_CR10   ,   26, "Write CR10."),
     155    EXIT_REASON(SVM_EXIT_WRITE_CR11   ,   27, "Write CR11."),
     156    EXIT_REASON(SVM_EXIT_WRITE_CR12   ,   28, "Write CR12."),
     157    EXIT_REASON(SVM_EXIT_WRITE_CR13   ,   29, "Write CR13."),
     158    EXIT_REASON(SVM_EXIT_WRITE_CR14   ,   30, "Write CR14."),
     159    EXIT_REASON(SVM_EXIT_WRITE_CR15   ,   31, "Write CR15."),
     160    EXIT_REASON(SVM_EXIT_READ_DR0     ,   32, "Read DR0."),
     161    EXIT_REASON(SVM_EXIT_READ_DR1     ,   33, "Read DR1."),
     162    EXIT_REASON(SVM_EXIT_READ_DR2     ,   34, "Read DR2."),
     163    EXIT_REASON(SVM_EXIT_READ_DR3     ,   35, "Read DR3."),
     164    EXIT_REASON(SVM_EXIT_READ_DR4     ,   36, "Read DR4."),
     165    EXIT_REASON(SVM_EXIT_READ_DR5     ,   37, "Read DR5."),
     166    EXIT_REASON(SVM_EXIT_READ_DR6     ,   38, "Read DR6."),
     167    EXIT_REASON(SVM_EXIT_READ_DR7     ,   39, "Read DR7."),
     168    EXIT_REASON(SVM_EXIT_READ_DR8     ,   40, "Read DR8."),
     169    EXIT_REASON(SVM_EXIT_READ_DR9     ,   41, "Read DR9."),
     170    EXIT_REASON(SVM_EXIT_READ_DR10    ,   42, "Read DR10."),
     171    EXIT_REASON(SVM_EXIT_READ_DR11    ,   43, "Read DR11"),
     172    EXIT_REASON(SVM_EXIT_READ_DR12    ,   44, "Read DR12."),
     173    EXIT_REASON(SVM_EXIT_READ_DR13    ,   45, "Read DR13."),
     174    EXIT_REASON(SVM_EXIT_READ_DR14    ,   46, "Read DR14."),
     175    EXIT_REASON(SVM_EXIT_READ_DR15    ,   47, "Read DR15."),
     176    EXIT_REASON(SVM_EXIT_WRITE_DR0    ,   48, "Write DR0."),
     177    EXIT_REASON(SVM_EXIT_WRITE_DR1    ,   49, "Write DR1."),
     178    EXIT_REASON(SVM_EXIT_WRITE_DR2    ,   50, "Write DR2."),
     179    EXIT_REASON(SVM_EXIT_WRITE_DR3    ,   51, "Write DR3."),
     180    EXIT_REASON(SVM_EXIT_WRITE_DR4    ,   52, "Write DR4."),
     181    EXIT_REASON(SVM_EXIT_WRITE_DR5    ,   53, "Write DR5."),
     182    EXIT_REASON(SVM_EXIT_WRITE_DR6    ,   54, "Write DR6."),
     183    EXIT_REASON(SVM_EXIT_WRITE_DR7    ,   55, "Write DR7."),
     184    EXIT_REASON(SVM_EXIT_WRITE_DR8    ,   56, "Write DR8."),
     185    EXIT_REASON(SVM_EXIT_WRITE_DR9    ,   57, "Write DR9."),
     186    EXIT_REASON(SVM_EXIT_WRITE_DR10   ,   58, "Write DR10."),
     187    EXIT_REASON(SVM_EXIT_WRITE_DR11   ,   59, "Write DR11."),
     188    EXIT_REASON(SVM_EXIT_WRITE_DR12   ,   60, "Write DR12."),
     189    EXIT_REASON(SVM_EXIT_WRITE_DR13   ,   61, "Write DR13."),
     190    EXIT_REASON(SVM_EXIT_WRITE_DR14   ,   62, "Write DR14."),
     191    EXIT_REASON(SVM_EXIT_WRITE_DR15   ,   63, "Write DR15."),
     192    EXIT_REASON(SVM_EXIT_XCPT_0       ,   64, "Exception 0  (#DE)."),
     193    EXIT_REASON(SVM_EXIT_XCPT_1       ,   65, "Exception 1  (#DB)."),
     194    EXIT_REASON(SVM_EXIT_XCPT_2       ,   66, "Exception 2  (#NMI)."),
     195    EXIT_REASON(SVM_EXIT_XCPT_3       ,   67, "Exception 3  (#BP)."),
     196    EXIT_REASON(SVM_EXIT_XCPT_4       ,   68, "Exception 4  (#OF)."),
     197    EXIT_REASON(SVM_EXIT_XCPT_5       ,   69, "Exception 5  (#BR)."),
     198    EXIT_REASON(SVM_EXIT_XCPT_6       ,   70, "Exception 6  (#UD)."),
     199    EXIT_REASON(SVM_EXIT_XCPT_7       ,   71, "Exception 7  (#NM)."),
     200    EXIT_REASON(SVM_EXIT_XCPT_8       ,   72, "Exception 8  (#DF)."),
     201    EXIT_REASON(SVM_EXIT_XCPT_9       ,   73, "Exception 9  (#CO_SEG_OVERRUN)."),
     202    EXIT_REASON(SVM_EXIT_XCPT_10      ,   74, "Exception 10 (#TS)."),
     203    EXIT_REASON(SVM_EXIT_XCPT_11      ,   75, "Exception 11 (#NP)."),
     204    EXIT_REASON(SVM_EXIT_XCPT_12      ,   76, "Exception 12 (#SS)."),
     205    EXIT_REASON(SVM_EXIT_XCPT_13      ,   77, "Exception 13 (#GP)."),
     206    EXIT_REASON(SVM_EXIT_XCPT_14      ,   78, "Exception 14 (#PF)."),
     207    EXIT_REASON(SVM_EXIT_XCPT_15      ,   79, "Exception 15 (0x0f)."),
     208    EXIT_REASON(SVM_EXIT_XCPT_16      ,   80, "Exception 16 (#MF)."),
     209    EXIT_REASON(SVM_EXIT_XCPT_17      ,   81, "Exception 17 (#AC)."),
     210    EXIT_REASON(SVM_EXIT_XCPT_18      ,   82, "Exception 18 (#MC)."),
     211    EXIT_REASON(SVM_EXIT_XCPT_19      ,   83, "Exception 19 (#XF)."),
     212    EXIT_REASON(SVM_EXIT_XCPT_20      ,   84, "Exception 20 (#VE)."),
     213    EXIT_REASON(SVM_EXIT_XCPT_21      ,   85, "Exception 22 (0x15)."),
     214    EXIT_REASON(SVM_EXIT_XCPT_22      ,   86, "Exception 22 (0x16)."),
     215    EXIT_REASON(SVM_EXIT_XCPT_23      ,   87, "Exception 23 (0x17)."),
     216    EXIT_REASON(SVM_EXIT_XCPT_24      ,   88, "Exception 24 (0x18)."),
     217    EXIT_REASON(SVM_EXIT_XCPT_25      ,   89, "Exception 25 (0x19)."),
     218    EXIT_REASON(SVM_EXIT_XCPT_26      ,   90, "Exception 26 (0x1a)."),
     219    EXIT_REASON(SVM_EXIT_XCPT_27      ,   91, "Exception 27 (0x1b)."),
     220    EXIT_REASON(SVM_EXIT_XCPT_28      ,   92, "Exception 28 (0x1c)."),
     221    EXIT_REASON(SVM_EXIT_XCPT_29      ,   93, "Exception 29 (0x1d)."),
     222    EXIT_REASON(SVM_EXIT_XCPT_30      ,   94, "Exception 30 (#SX)."),
     223    EXIT_REASON(SVM_EXIT_XCPT_31      ,   95, "Exception 31 (0x1F)."),
     224    EXIT_REASON(SVM_EXIT_INTR         ,   96, "Physical maskable interrupt (host)."),
     225    EXIT_REASON(SVM_EXIT_NMI          ,   97, "Physical non-maskable interrupt (host)."),
     226    EXIT_REASON(SVM_EXIT_SMI          ,   98, "System management interrupt (host)."),
     227    EXIT_REASON(SVM_EXIT_INIT         ,   99, "Physical INIT signal (host)."),
     228    EXIT_REASON(SVM_EXIT_VINTR        ,  100, "Virtual interrupt-window exit."),
     229    EXIT_REASON(SVM_EXIT_CR0_SEL_WRITE,  101, "Selective CR0 Write (to bits other than CR0.TS and CR0.MP)."),
     230    EXIT_REASON(SVM_EXIT_IDTR_READ    ,  102, "Read IDTR."),
     231    EXIT_REASON(SVM_EXIT_GDTR_READ    ,  103, "Read GDTR."),
     232    EXIT_REASON(SVM_EXIT_LDTR_READ    ,  104, "Read LDTR."),
     233    EXIT_REASON(SVM_EXIT_TR_READ      ,  105, "Read TR."),
     234    EXIT_REASON(SVM_EXIT_IDTR_WRITE   ,  106, "Write IDTR."),
     235    EXIT_REASON(SVM_EXIT_GDTR_WRITE   ,  107, "Write GDTR."),
     236    EXIT_REASON(SVM_EXIT_LDTR_WRITE   ,  108, "Write LDTR."),
     237    EXIT_REASON(SVM_EXIT_TR_WRITE     ,  109, "Write TR."),
     238    EXIT_REASON(SVM_EXIT_RDTSC        ,  110, "RDTSC instruction."),
     239    EXIT_REASON(SVM_EXIT_RDPMC        ,  111, "RDPMC instruction."),
     240    EXIT_REASON(SVM_EXIT_PUSHF        ,  112, "PUSHF instruction."),
     241    EXIT_REASON(SVM_EXIT_POPF         ,  113, "POPF instruction."),
     242    EXIT_REASON(SVM_EXIT_CPUID        ,  114, "CPUID instruction."),
     243    EXIT_REASON(SVM_EXIT_RSM          ,  115, "RSM instruction."),
     244    EXIT_REASON(SVM_EXIT_IRET         ,  116, "IRET instruction."),
     245    EXIT_REASON(SVM_EXIT_SWINT        ,  117, "Software interrupt (INTn instructions)."),
     246    EXIT_REASON(SVM_EXIT_INVD         ,  118, "INVD instruction."),
     247    EXIT_REASON(SVM_EXIT_PAUSE        ,  119, "PAUSE instruction."),
     248    EXIT_REASON(SVM_EXIT_HLT          ,  120, "HLT instruction."),
     249    EXIT_REASON(SVM_EXIT_INVLPG       ,  121, "INVLPG instruction."),
     250    EXIT_REASON(SVM_EXIT_INVLPGA      ,  122, "INVLPGA instruction."),
     251    EXIT_REASON(SVM_EXIT_IOIO         ,  123, "IN/OUT/INS/OUTS instruction."),
     252    EXIT_REASON(SVM_EXIT_MSR          ,  124, "RDMSR or WRMSR access to protected MSR."),
     253    EXIT_REASON(SVM_EXIT_TASK_SWITCH  ,  125, "Task switch."),
     254    EXIT_REASON(SVM_EXIT_FERR_FREEZE  ,  126, "FERR Freeze; CPU frozen in an x87/mmx instruction waiting for interrupt."),
     255    EXIT_REASON(SVM_EXIT_SHUTDOWN     ,  127, "Shutdown."),
     256    EXIT_REASON(SVM_EXIT_VMRUN        ,  128, "VMRUN instruction."),
     257    EXIT_REASON(SVM_EXIT_VMMCALL      ,  129, "VMCALL instruction."),
     258    EXIT_REASON(SVM_EXIT_VMLOAD       ,  130, "VMLOAD instruction."),
     259    EXIT_REASON(SVM_EXIT_VMSAVE       ,  131, "VMSAVE instruction."),
     260    EXIT_REASON(SVM_EXIT_STGI         ,  132, "STGI instruction."),
     261    EXIT_REASON(SVM_EXIT_CLGI         ,  133, "CLGI instruction."),
     262    EXIT_REASON(SVM_EXIT_SKINIT       ,  134, "SKINIT instruction."),
     263    EXIT_REASON(SVM_EXIT_RDTSCP       ,  135, "RDTSCP instruction."),
     264    EXIT_REASON(SVM_EXIT_ICEBP        ,  136, "ICEBP instruction."),
     265    EXIT_REASON(SVM_EXIT_WBINVD       ,  137, "WBINVD instruction."),
     266    EXIT_REASON(SVM_EXIT_MONITOR      ,  138, "MONITOR instruction."),
     267    EXIT_REASON(SVM_EXIT_MWAIT        ,  139, "MWAIT instruction."),
     268    EXIT_REASON(SVM_EXIT_MWAIT_ARMED  ,  140, "MWAIT instruction when armed."),
     269    EXIT_REASON(SVM_EXIT_XSETBV       ,  141, "XSETBV instruction."),
     270};
     271/** Array index of the last valid AMD-V exit reason. */
     272#define MAX_EXITREASON_AMDV              141
     273
     274/** Special exit reasons not covered in the array above. */
     275#define SVM_EXIT_REASON_NPF                  EXIT_REASON(SVM_EXIT_NPF                , 1024, "Nested Page Fault.")
     276#define SVM_EXIT_REASON_AVIC_INCOMPLETE_IPI  EXIT_REASON(SVM_EXIT_AVIC_INCOMPLETE_IPI, 1025, "AVIC - Incomplete IPI delivery.")
     277#define SVM_EXIT_REASON_AVIC_NOACCEL         EXIT_REASON(SVM_EXIT_AVIC_NOACCEL       , 1026, "AVIC - Unhandled register.")
     278
     279/**
     280 * Gets the SVM exit reason if it's one of the reasons not present in the @c
     281 * g_apszSvmExitReasons array.
     282 *
     283 * @returns The exit reason or NULL if unknown.
     284 * @param   uExit       The exit.
     285 */
     286DECLINLINE(const char *) hmSvmGetSpecialExitReasonDesc(uint16_t uExit)
     287{
     288    switch (uExit)
     289    {
     290        case SVM_EXIT_NPF:                 return SVM_EXIT_REASON_NPF;
     291        case SVM_EXIT_AVIC_INCOMPLETE_IPI: return SVM_EXIT_REASON_AVIC_INCOMPLETE_IPI;
     292        case SVM_EXIT_AVIC_NOACCEL:        return SVM_EXIT_REASON_AVIC_NOACCEL;
     293    }
     294    return EXIT_REASON_NIL();
     295}
     296#undef EXIT_REASON_NIL
     297#undef EXIT_REASON
     298
     299
    41300/**
    42301 * Checks whether HM (VT-x/AMD-V) is being used by this VM.
     
    86345    }
    87346
    88     return HMVmxCanExecuteGuest(pVCpu, pCtx);
     347    return HMCanExecuteVmxGuest(pVCpu, pCtx);
    89348}
    90349
     
    192451 * @param   pVCpu       The cross context virtual CPU structure.
    193452 */
    194 VMM_INT_DECL(int) HMFlushTLB(PVMCPU pVCpu)
    195 {
    196     LogFlow(("HMFlushTLB\n"));
     453VMM_INT_DECL(int) HMFlushTlb(PVMCPU pVCpu)
     454{
     455    LogFlow(("HMFlushTlb\n"));
    197456
    198457    VMCPU_FF_SET(pVCpu, VMCPU_FF_TLB_FLUSH);
     
    277536 * @param   pVM       The cross context VM structure.
    278537 */
    279 VMM_INT_DECL(int) HMFlushTLBOnAllVCpus(PVM pVM)
     538VMM_INT_DECL(int) HMFlushTlbOnAllVCpus(PVM pVM)
    280539{
    281540    if (pVM->cCpus == 1)
    282         return HMFlushTLB(&pVM->aCpus[0]);
     541        return HMFlushTlb(&pVM->aCpus[0]);
    283542
    284543    VMCPUID idThisCpu = VMMGetCpuId(pVM);
     
    331590    /** @todo Remove or figure out to way to update the Phys STAT counter.  */
    332591    /* STAM_COUNTER_INC(&pVCpu->hm.s.StatFlushTlbInvlpgPhys); */
    333     return HMFlushTLBOnAllVCpus(pVM);
     592    return HMFlushTlbOnAllVCpus(pVM);
    334593}
    335594
     
    429688VMM_INT_DECL(bool) HMIsVmxActive(PVM pVM)
    430689{
    431     return HMIsVmxSupported(pVM) && HMIsEnabled(pVM);
    432 }
    433 
    434 
    435 /**
    436  * Checks if VT-x is supported by the host CPU.
    437  *
    438  * @returns true if VT-x is supported, false otherwise.
    439  * @param   pVM         The cross context VM structure.
    440  *
    441  * @remarks Works before hmR3InitFinalizeR0.
    442  */
    443 VMM_INT_DECL(bool) HMIsVmxSupported(PVM pVM)
    444 {
    445     return pVM->hm.s.vmx.fSupported;
     690    return pVM->hm.s.vmx.fSupported && HMIsEnabled(pVM);
    446691}
    447692
     
    537782 * @param   enmGuestMode    New guest paging mode.
    538783 */
    539 VMM_INT_DECL(void) HMHCPagingModeChanged(PVM pVM, PVMCPU pVCpu, PGMMODE enmShadowMode, PGMMODE enmGuestMode)
     784VMM_INT_DECL(void) HMHCChangedPagingMode(PVM pVM, PVMCPU pVCpu, PGMMODE enmShadowMode, PGMMODE enmGuestMode)
    540785{
    541786# ifdef IN_RING3
     
    572817# endif
    573818
    574     Log4(("HMHCPagingModeChanged: Guest paging mode '%s', shadow paging mode '%s'\n", PGMGetModeName(enmGuestMode),
     819    Log4(("HMHCChangedPagingMode: Guest paging mode '%s', shadow paging mode '%s'\n", PGMGetModeName(enmGuestMode),
    575820          PGMGetModeName(enmShadowMode)));
    576821}
     
    587832 * @param   pVmxMsrs        Where to store the VMX MSRs.
    588833 */
    589 VMM_INT_DECL(void) HMVmxGetVmxMsrsFromHwvirtMsrs(PCSUPHWVIRTMSRS pHwvirtMsrs, PVMXMSRS pVmxMsrs)
     834VMM_INT_DECL(void) HMGetVmxMsrsFromHwvirtMsrs(PCSUPHWVIRTMSRS pHwvirtMsrs, PVMXMSRS pVmxMsrs)
    590835{
    591836    AssertReturnVoid(pHwvirtMsrs);
     
    622867 * @param   pSvmMsrs        Where to store the SVM MSRs.
    623868 */
    624 VMM_INT_DECL(void) HMVmxGetSvmMsrsFromHwvirtMsrs(PCSUPHWVIRTMSRS pHwvirtMsrs, PSVMMSRS pSvmMsrs)
     869VMM_INT_DECL(void) HMGetSvmMsrsFromHwvirtMsrs(PCSUPHWVIRTMSRS pHwvirtMsrs, PSVMMSRS pSvmMsrs)
    625870{
    626871    AssertReturnVoid(pHwvirtMsrs);
     
    629874}
    630875
     876
     877/**
     878 * Gets the name of a VT-x exit code.
     879 *
     880 * @returns Pointer to read only string if @a uExit is known, otherwise NULL.
     881 * @param   uExit               The VT-x exit to name.
     882 */
     883VMM_INT_DECL(const char *) HMGetVmxExitName(uint32_t uExit)
     884{
     885    if (uExit <= MAX_EXITREASON_VTX)
     886    {
     887        Assert(uExit < RT_ELEMENTS(g_apszVmxExitReasons));
     888        return g_apszVmxExitReasons[uExit];
     889    }
     890    return NULL;
     891}
     892
     893
     894/**
     895 * Gets the name of an AMD-V exit code.
     896 *
     897 * @returns Pointer to read only string if @a uExit is known, otherwise NULL.
     898 * @param   uExit               The AMD-V exit to name.
     899 */
     900VMM_INT_DECL(const char *) HMGetSvmExitName(uint32_t uExit)
     901{
     902    if (uExit <= MAX_EXITREASON_AMDV)
     903    {
     904        Assert(uExit < RT_ELEMENTS(g_apszSvmExitReasons));
     905        return g_apszSvmExitReasons[uExit];
     906    }
     907    return hmSvmGetSpecialExitReasonDesc(uExit);
     908}
     909
  • trunk/src/VBox/VMM/VMMAll/HMSVMAll.cpp

    r76553 r76993  
    130130 * @sa      hmR0SvmVmRunCacheVmcb.
    131131 */
    132 VMM_INT_DECL(void) HMSvmNstGstVmExitNotify(PVMCPU pVCpu, PCPUMCTX pCtx)
     132VMM_INT_DECL(void) HMNotifySvmNstGstVmexit(PVMCPU pVCpu, PCPUMCTX pCtx)
    133133{
    134134    PSVMNESTEDVMCBCACHE pVmcbNstGstCache = &pVCpu->hm.s.svm.NstGstVmcbCache;
     
    184184 *          to change throughout the lifetime of the VM.
    185185 */
    186 VMM_INT_DECL(bool) HMSvmIsVGifActive(PVM pVM)
     186VMM_INT_DECL(bool) HMIsSvmVGifActive(PVM pVM)
    187187{
    188188    bool const fVGif    = RT_BOOL(pVM->hm.s.svm.u32Features & X86_CPUID_SVM_FEATURE_EDX_VGIF);
     
    209209 * @sa      CPUMApplyNestedGuestTscOffset(), hmR0SvmNstGstUndoTscOffset().
    210210 */
    211 VMM_INT_DECL(uint64_t) HMSvmNstGstApplyTscOffset(PVMCPU pVCpu, uint64_t uTicks)
     211VMM_INT_DECL(uint64_t) HMApplySvmNstGstTscOffset(PVMCPU pVCpu, uint64_t uTicks)
    212212{
    213213    PCCPUMCTX pCtx = &pVCpu->cpum.GstCtx;
     
    229229 * @param   pVCpu               The cross context virtual CPU structure.
    230230 */
    231 VMM_INT_DECL(int) HMHCSvmMaybeMovTprHypercall(PVMCPU pVCpu)
     231VMM_INT_DECL(int) HMHCMaybeMovTprSvmHypercall(PVMCPU pVCpu)
    232232{
    233233    PVM pVM = pVCpu->CTX_SUFF(pVM);
     
    252252 * @returns true if the erratum applies, false otherwise.
    253253 */
    254 VMM_INT_DECL(int) HMSvmIsSubjectToErratum170(uint32_t *pu32Family, uint32_t *pu32Model, uint32_t *pu32Stepping)
     254VMM_INT_DECL(int) HMIsSubjectToSvmErratum170(uint32_t *pu32Family, uint32_t *pu32Model, uint32_t *pu32Stepping)
    255255{
    256256    /*
     
    308308 *                      returned in @a pbOffMsrpm.
    309309 */
    310 VMM_INT_DECL(int) HMSvmGetMsrpmOffsetAndBit(uint32_t idMsr, uint16_t *pbOffMsrpm, uint8_t *puMsrpmBit)
     310VMM_INT_DECL(int) HMGetSvmMsrpmOffsetAndBit(uint32_t idMsr, uint16_t *pbOffMsrpm, uint8_t *puMsrpmBit)
    311311{
    312312    Assert(pbOffMsrpm);
     
    372372 *                          Optional, can be NULL.
    373373 */
    374 VMM_INT_DECL(bool) HMSvmIsIOInterceptActive(void *pvIoBitmap, uint16_t u16Port, SVMIOIOTYPE enmIoType, uint8_t cbReg,
     374VMM_INT_DECL(bool) HMIsSvmIoInterceptActive(void *pvIoBitmap, uint16_t u16Port, SVMIOIOTYPE enmIoType, uint8_t cbReg,
    375375                                            uint8_t cAddrSizeBits, uint8_t iEffSeg, bool fRep, bool fStrIo,
    376376                                            PSVMIOIOEXITINFO pIoExitInfo)
  • trunk/src/VBox/VMM/VMMAll/HMVMXAll.cpp

    r76888 r76993  
    370370 * @param   enmDiag    The VMX diagnostic.
    371371 */
    372 VMM_INT_DECL(const char *) HMVmxGetDiagDesc(VMXVDIAG enmDiag)
     372VMM_INT_DECL(const char *) HMGetVmxDiagDesc(VMXVDIAG enmDiag)
    373373{
    374374    if (RT_LIKELY((unsigned)enmDiag < RT_ELEMENTS(g_apszVmxVDiagDesc)))
     
    384384 * @param   enmAbort    The VMX abort reason.
    385385 */
    386 VMM_INT_DECL(const char *) HMVmxGetAbortDesc(VMXABORT enmAbort)
     386VMM_INT_DECL(const char *) HMGetVmxAbortDesc(VMXABORT enmAbort)
    387387{
    388388    switch (enmAbort)
     
    408408 * @param   fVmcsState      The virtual-VMCS state.
    409409 */
    410 VMM_INT_DECL(const char *) HMVmxGetVmcsStateDesc(uint8_t fVmcsState)
     410VMM_INT_DECL(const char *) HMGetVmxVmcsStateDesc(uint8_t fVmcsState)
    411411{
    412412    switch (fVmcsState)
     
    425425 * @param   uType    The event type.
    426426 */
    427 VMM_INT_DECL(const char *) HMVmxGetEntryIntInfoTypeDesc(uint8_t uType)
     427VMM_INT_DECL(const char *) HMGetVmxEntryIntInfoTypeDesc(uint8_t uType)
    428428{
    429429    switch (uType)
     
    449449 * @param   uType    The event type.
    450450 */
    451 VMM_INT_DECL(const char *) HMVmxGetExitIntInfoTypeDesc(uint8_t uType)
     451VMM_INT_DECL(const char *) HMGetVmxExitIntInfoTypeDesc(uint8_t uType)
    452452{
    453453    switch (uType)
     
    472472 * @param   uType    The event type.
    473473 */
    474 VMM_INT_DECL(const char *) HMVmxGetIdtVectoringInfoTypeDesc(uint8_t uType)
     474VMM_INT_DECL(const char *) HMGetVmxIdtVectoringInfoTypeDesc(uint8_t uType)
    475475{
    476476    switch (uType)
     
    649649 *          state, make sure REM (which supplies a partial state) is updated.
    650650 */
    651 VMM_INT_DECL(bool) HMVmxCanExecuteGuest(PVMCPU pVCpu, PCCPUMCTX pCtx)
     651VMM_INT_DECL(bool) HMCanExecuteVmxGuest(PVMCPU pVCpu, PCCPUMCTX pCtx)
    652652{
    653653    PVM pVM = pVCpu->CTX_SUFF(pVM);
     
    831831 *                          NULL.
    832832 */
    833 VMM_INT_DECL(int) HMVmxGetMsrPermission(void const *pvMsrBitmap, uint32_t idMsr, PVMXMSREXITREAD penmRead,
     833VMM_INT_DECL(int) HMGetVmxMsrPermission(void const *pvMsrBitmap, uint32_t idMsr, PVMXMSREXITREAD penmRead,
    834834                                        PVMXMSREXITWRITE penmWrite)
    835835{
     
    906906 * @param   cbAccess        The size of the I/O access in bytes (1, 2 or 4 bytes).
    907907 */
    908 VMM_INT_DECL(bool) HMVmxGetIoBitmapPermission(void const *pvIoBitmapA, void const *pvIoBitmapB, uint16_t uPort,
     908VMM_INT_DECL(bool) HMGetVmxIoBitmapPermission(void const *pvIoBitmapA, void const *pvIoBitmapB, uint16_t uPort,
    909909                                                uint8_t cbAccess)
    910910{
     
    929929}
    930930
     931
     932/**
     933 * Dumps the virtual VMCS state to the release log.
     934 *
     935 * @param   pVCpu   The cross context virtual CPU structure.
     936 */
     937VMM_INT_DECL(void) HMDumpHwvirtVmxState(PVMCPU pVCpu)
     938{
     939#ifndef IN_RC
     940    /* The string width of -4 used in the macros below to cover 'LDTR', 'GDTR', 'IDTR. */
     941# define HMVMX_DUMP_HOST_XDTR(a_pVmcs, a_Seg, a_SegName, a_pszPrefix) \
     942    do { \
     943        LogRel(("  %s%-4s                       = {base=%016RX64}\n", \
     944            (a_pszPrefix), (a_SegName), (a_pVmcs)->u64Host##a_Seg##Base.u)); \
     945    } while (0)
     946# define HMVMX_DUMP_HOST_FS_GS_TR(a_pVmcs, a_Seg, a_SegName, a_pszPrefix) \
     947    do { \
     948        LogRel(("  %s%-4s                       = {%04x base=%016RX64}\n", \
     949                (a_pszPrefix), (a_SegName), (a_pVmcs)->Host##a_Seg, (a_pVmcs)->u64Host##a_Seg##Base.u)); \
     950    } while (0)
     951# define HMVMX_DUMP_GUEST_SEGREG(a_pVmcs, a_Seg, a_SegName, a_pszPrefix) \
     952    do { \
     953        LogRel(("  %s%-4s                       = {%04x base=%016RX64 limit=%08x flags=%04x}\n", \
     954                (a_pszPrefix), (a_SegName), (a_pVmcs)->Guest##a_Seg, (a_pVmcs)->u64Guest##a_Seg##Base.u, \
     955                (a_pVmcs)->u32Guest##a_Seg##Limit, (a_pVmcs)->u32Guest##a_Seg##Attr)); \
     956    } while (0)
     957# define HMVMX_DUMP_GUEST_XDTR(a_pVmcs, a_Seg, a_SegName, a_pszPrefix) \
     958    do { \
     959        LogRel(("  %s%-4s                       = {base=%016RX64 limit=%08x}\n", \
     960                (a_pszPrefix), (a_SegName), (a_pVmcs)->u64Guest##a_Seg##Base.u, (a_pVmcs)->u32Guest##a_Seg##Limit)); \
     961    } while (0)
     962
     963    PCCPUMCTX  pCtx  = &pVCpu->cpum.GstCtx;
     964    PCVMXVVMCS pVmcs = pVCpu->cpum.GstCtx.hwvirt.vmx.CTX_SUFF(pVmcs);
     965    if (!pVmcs)
     966    {
     967        LogRel(("Virtual VMCS not allocated\n"));
     968        return;
     969    }
     970    LogRel(("GCPhysVmxon                = %#RGp\n",     pCtx->hwvirt.vmx.GCPhysVmxon));
     971    LogRel(("GCPhysVmcs                 = %#RGp\n",     pCtx->hwvirt.vmx.GCPhysVmcs));
     972    LogRel(("GCPhysShadowVmcs           = %#RGp\n",     pCtx->hwvirt.vmx.GCPhysShadowVmcs));
     973    LogRel(("enmDiag                    = %u (%s)\n",   pCtx->hwvirt.vmx.enmDiag, HMGetVmxDiagDesc(pCtx->hwvirt.vmx.enmDiag)));
     974    LogRel(("enmAbort                   = %u (%s)\n",   pCtx->hwvirt.vmx.enmAbort, HMGetVmxAbortDesc(pCtx->hwvirt.vmx.enmAbort)));
     975    LogRel(("uAbortAux                  = %u (%#x)\n",  pCtx->hwvirt.vmx.uAbortAux, pCtx->hwvirt.vmx.uAbortAux));
     976    LogRel(("fInVmxRootMode             = %RTbool\n",   pCtx->hwvirt.vmx.fInVmxRootMode));
     977    LogRel(("fInVmxNonRootMode          = %RTbool\n",   pCtx->hwvirt.vmx.fInVmxNonRootMode));
     978    LogRel(("fInterceptEvents           = %RTbool\n",   pCtx->hwvirt.vmx.fInterceptEvents));
     979    LogRel(("fNmiUnblockingIret         = %RTbool\n",   pCtx->hwvirt.vmx.fNmiUnblockingIret));
     980    LogRel(("uFirstPauseLoopTick        = %RX64\n",     pCtx->hwvirt.vmx.uFirstPauseLoopTick));
     981    LogRel(("uPrevPauseTick             = %RX64\n",     pCtx->hwvirt.vmx.uPrevPauseTick));
     982    LogRel(("uVmentryTick               = %RX64\n",     pCtx->hwvirt.vmx.uVmentryTick));
     983    LogRel(("offVirtApicWrite           = %#RX16\n",    pCtx->hwvirt.vmx.offVirtApicWrite));
     984    LogRel(("VMCS cache:\n"));
     985
     986    const char *pszPrefix = "  ";
     987    /* Header. */
     988    {
     989        LogRel(("%sHeader:\n", pszPrefix));
     990        LogRel(("  %sVMCS revision id           = %#RX32\n",      pszPrefix, pVmcs->u32VmcsRevId));
     991        LogRel(("  %sVMX-abort id               = %#RX32 (%s)\n", pszPrefix, pVmcs->enmVmxAbort, HMGetVmxAbortDesc(pVmcs->enmVmxAbort)));
     992        LogRel(("  %sVMCS state                 = %#x (%s)\n",    pszPrefix, pVmcs->fVmcsState, HMGetVmxVmcsStateDesc(pVmcs->fVmcsState)));
     993    }
     994
     995    /* Control fields. */
     996    {
     997        /* 16-bit. */
     998        LogRel(("%sControl:\n", pszPrefix));
     999        LogRel(("  %sVPID                       = %#RX16\n",   pszPrefix, pVmcs->u16Vpid));
     1000        LogRel(("  %sPosted intr notify vector  = %#RX16\n",   pszPrefix, pVmcs->u16PostIntNotifyVector));
     1001        LogRel(("  %sEPTP index                 = %#RX16\n",   pszPrefix, pVmcs->u16EptpIndex));
     1002
     1003        /* 32-bit. */
     1004        LogRel(("  %sPinCtls                    = %#RX32\n",   pszPrefix, pVmcs->u32PinCtls));
     1005        LogRel(("  %sProcCtls                   = %#RX32\n",   pszPrefix, pVmcs->u32ProcCtls));
     1006        LogRel(("  %sProcCtls2                  = %#RX32\n",   pszPrefix, pVmcs->u32ProcCtls2));
     1007        LogRel(("  %sExitCtls                   = %#RX32\n",   pszPrefix, pVmcs->u32ExitCtls));
     1008        LogRel(("  %sEntryCtls                  = %#RX32\n",   pszPrefix, pVmcs->u32EntryCtls));
     1009        LogRel(("  %sException bitmap           = %#RX32\n",   pszPrefix, pVmcs->u32XcptBitmap));
     1010        LogRel(("  %sPage-fault mask            = %#RX32\n",   pszPrefix, pVmcs->u32XcptPFMask));
     1011        LogRel(("  %sPage-fault match           = %#RX32\n",   pszPrefix, pVmcs->u32XcptPFMatch));
     1012        LogRel(("  %sCR3-target count           = %RU32\n",    pszPrefix, pVmcs->u32Cr3TargetCount));
     1013        LogRel(("  %sVM-exit MSR store count    = %RU32\n",    pszPrefix, pVmcs->u32ExitMsrStoreCount));
     1014        LogRel(("  %sVM-exit MSR load count     = %RU32\n",    pszPrefix, pVmcs->u32ExitMsrLoadCount));
     1015        LogRel(("  %sVM-entry MSR load count    = %RU32\n",    pszPrefix, pVmcs->u32EntryMsrLoadCount));
     1016        LogRel(("  %sVM-entry interruption info = %#RX32\n",   pszPrefix, pVmcs->u32EntryIntInfo));
     1017        {
     1018            uint32_t const fInfo = pVmcs->u32EntryIntInfo;
     1019            uint8_t  const uType = VMX_ENTRY_INT_INFO_TYPE(fInfo);
     1020            LogRel(("    %sValid                      = %RTbool\n",  pszPrefix, VMX_ENTRY_INT_INFO_IS_VALID(fInfo)));
     1021            LogRel(("    %sType                       = %#x (%s)\n", pszPrefix, uType, HMGetVmxEntryIntInfoTypeDesc(uType)));
     1022            LogRel(("    %sVector                     = %#x\n",      pszPrefix, VMX_ENTRY_INT_INFO_VECTOR(fInfo)));
     1023            LogRel(("    %sNMI-unblocking-IRET        = %RTbool\n",  pszPrefix, VMX_ENTRY_INT_INFO_IS_NMI_UNBLOCK_IRET(fInfo)));
     1024            LogRel(("    %sError-code valid           = %RTbool\n",  pszPrefix, VMX_ENTRY_INT_INFO_IS_ERROR_CODE_VALID(fInfo)));
     1025        }
     1026        LogRel(("  %sVM-entry xcpt error-code   = %#RX32\n",   pszPrefix, pVmcs->u32EntryXcptErrCode));
     1027        LogRel(("  %sVM-entry instruction len   = %u bytes\n", pszPrefix, pVmcs->u32EntryInstrLen));
     1028        LogRel(("  %sTPR threshold              = %#RX32\n",   pszPrefix, pVmcs->u32TprThreshold));
     1029        LogRel(("  %sPLE gap                    = %#RX32\n",   pszPrefix, pVmcs->u32PleGap));
     1030        LogRel(("  %sPLE window                 = %#RX32\n",   pszPrefix, pVmcs->u32PleWindow));
     1031
     1032        /* 64-bit. */
     1033        LogRel(("  %sIO-bitmap A addr           = %#RX64\n",   pszPrefix, pVmcs->u64AddrIoBitmapA.u));
     1034        LogRel(("  %sIO-bitmap B addr           = %#RX64\n",   pszPrefix, pVmcs->u64AddrIoBitmapB.u));
     1035        LogRel(("  %sMSR-bitmap addr            = %#RX64\n",   pszPrefix, pVmcs->u64AddrMsrBitmap.u));
     1036        LogRel(("  %sVM-exit MSR store addr     = %#RX64\n",   pszPrefix, pVmcs->u64AddrExitMsrStore.u));
     1037        LogRel(("  %sVM-exit MSR load addr      = %#RX64\n",   pszPrefix, pVmcs->u64AddrExitMsrLoad.u));
     1038        LogRel(("  %sVM-entry MSR load addr     = %#RX64\n",   pszPrefix, pVmcs->u64AddrEntryMsrLoad.u));
     1039        LogRel(("  %sExecutive VMCS ptr         = %#RX64\n",   pszPrefix, pVmcs->u64ExecVmcsPtr.u));
     1040        LogRel(("  %sPML addr                   = %#RX64\n",   pszPrefix, pVmcs->u64AddrPml.u));
     1041        LogRel(("  %sTSC offset                 = %#RX64\n",   pszPrefix, pVmcs->u64TscOffset.u));
     1042        LogRel(("  %sVirtual-APIC addr          = %#RX64\n",   pszPrefix, pVmcs->u64AddrVirtApic.u));
     1043        LogRel(("  %sAPIC-access addr           = %#RX64\n",   pszPrefix, pVmcs->u64AddrApicAccess.u));
     1044        LogRel(("  %sPosted-intr desc addr      = %#RX64\n",   pszPrefix, pVmcs->u64AddrPostedIntDesc.u));
     1045        LogRel(("  %sVM-functions control       = %#RX64\n",   pszPrefix, pVmcs->u64VmFuncCtls.u));
     1046        LogRel(("  %sEPTP ptr                   = %#RX64\n",   pszPrefix, pVmcs->u64EptpPtr.u));
     1047        LogRel(("  %sEOI-exit bitmap 0 addr     = %#RX64\n",   pszPrefix, pVmcs->u64EoiExitBitmap0.u));
     1048        LogRel(("  %sEOI-exit bitmap 1 addr     = %#RX64\n",   pszPrefix, pVmcs->u64EoiExitBitmap1.u));
     1049        LogRel(("  %sEOI-exit bitmap 2 addr     = %#RX64\n",   pszPrefix, pVmcs->u64EoiExitBitmap2.u));
     1050        LogRel(("  %sEOI-exit bitmap 3 addr     = %#RX64\n",   pszPrefix, pVmcs->u64EoiExitBitmap3.u));
     1051        LogRel(("  %sEPTP-list addr             = %#RX64\n",   pszPrefix, pVmcs->u64AddrEptpList.u));
     1052        LogRel(("  %sVMREAD-bitmap addr         = %#RX64\n",   pszPrefix, pVmcs->u64AddrVmreadBitmap.u));
     1053        LogRel(("  %sVMWRITE-bitmap addr        = %#RX64\n",   pszPrefix, pVmcs->u64AddrVmwriteBitmap.u));
     1054        LogRel(("  %sVirt-Xcpt info addr        = %#RX64\n",   pszPrefix, pVmcs->u64AddrXcptVeInfo.u));
     1055        LogRel(("  %sXSS-bitmap                 = %#RX64\n",   pszPrefix, pVmcs->u64XssBitmap.u));
     1056        LogRel(("  %sENCLS-exiting bitmap addr  = %#RX64\n",   pszPrefix, pVmcs->u64AddrEnclsBitmap.u));
     1057        LogRel(("  %sTSC multiplier             = %#RX64\n",   pszPrefix, pVmcs->u64TscMultiplier.u));
     1058
     1059        /* Natural width. */
     1060        LogRel(("  %sCR0 guest/host mask        = %#RX64\n",   pszPrefix, pVmcs->u64Cr0Mask.u));
     1061        LogRel(("  %sCR4 guest/host mask        = %#RX64\n",   pszPrefix, pVmcs->u64Cr4Mask.u));
     1062        LogRel(("  %sCR0 read shadow            = %#RX64\n",   pszPrefix, pVmcs->u64Cr0ReadShadow.u));
     1063        LogRel(("  %sCR4 read shadow            = %#RX64\n",   pszPrefix, pVmcs->u64Cr4ReadShadow.u));
     1064        LogRel(("  %sCR3-target 0               = %#RX64\n",   pszPrefix, pVmcs->u64Cr3Target0.u));
     1065        LogRel(("  %sCR3-target 1               = %#RX64\n",   pszPrefix, pVmcs->u64Cr3Target1.u));
     1066        LogRel(("  %sCR3-target 2               = %#RX64\n",   pszPrefix, pVmcs->u64Cr3Target2.u));
     1067        LogRel(("  %sCR3-target 3               = %#RX64\n",   pszPrefix, pVmcs->u64Cr3Target3.u));
     1068    }
     1069
     1070    /* Guest state. */
     1071    {
     1072        LogRel(("%sGuest state:\n", pszPrefix));
     1073
     1074        /* 16-bit. */
     1075        HMVMX_DUMP_GUEST_SEGREG(pVmcs, Cs,   "cs",   pszPrefix);
     1076        HMVMX_DUMP_GUEST_SEGREG(pVmcs, Ss,   "ss",   pszPrefix);
     1077        HMVMX_DUMP_GUEST_SEGREG(pVmcs, Es,   "es",   pszPrefix);
     1078        HMVMX_DUMP_GUEST_SEGREG(pVmcs, Ds,   "ds",   pszPrefix);
     1079        HMVMX_DUMP_GUEST_SEGREG(pVmcs, Fs,   "fs",   pszPrefix);
     1080        HMVMX_DUMP_GUEST_SEGREG(pVmcs, Gs,   "gs",   pszPrefix);
     1081        HMVMX_DUMP_GUEST_SEGREG(pVmcs, Ldtr, "ldtr", pszPrefix);
     1082        HMVMX_DUMP_GUEST_SEGREG(pVmcs, Tr,   "tr",   pszPrefix);
     1083        HMVMX_DUMP_GUEST_XDTR(  pVmcs, Gdtr, "gdtr", pszPrefix);
     1084        HMVMX_DUMP_GUEST_XDTR(  pVmcs, Idtr, "idtr", pszPrefix);
     1085        LogRel(("  %sInterrupt status           = %#RX16\n",   pszPrefix, pVmcs->u16GuestIntStatus));
     1086        LogRel(("  %sPML index                  = %#RX16\n",   pszPrefix, pVmcs->u16PmlIndex));
     1087
     1088        /* 32-bit. */
     1089        LogRel(("  %sInterruptibility state     = %#RX32\n",   pszPrefix, pVmcs->u32GuestIntrState));
     1090        LogRel(("  %sActivity state             = %#RX32\n",   pszPrefix, pVmcs->u32GuestActivityState));
     1091        LogRel(("  %sSMBASE                     = %#RX32\n",   pszPrefix, pVmcs->u32GuestSmBase));
     1092        LogRel(("  %sSysEnter CS                = %#RX32\n",   pszPrefix, pVmcs->u32GuestSysenterCS));
     1093        LogRel(("  %sVMX-preemption timer value = %#RX32\n",   pszPrefix, pVmcs->u32PreemptTimer));
     1094
     1095        /* 64-bit. */
     1096        LogRel(("  %sVMCS link ptr              = %#RX64\n",   pszPrefix, pVmcs->u64VmcsLinkPtr.u));
     1097        LogRel(("  %sDBGCTL                     = %#RX64\n",   pszPrefix, pVmcs->u64GuestDebugCtlMsr.u));
     1098        LogRel(("  %sPAT                        = %#RX64\n",   pszPrefix, pVmcs->u64GuestPatMsr.u));
     1099        LogRel(("  %sEFER                       = %#RX64\n",   pszPrefix, pVmcs->u64GuestEferMsr.u));
     1100        LogRel(("  %sPERFGLOBALCTRL             = %#RX64\n",   pszPrefix, pVmcs->u64GuestPerfGlobalCtlMsr.u));
     1101        LogRel(("  %sPDPTE 0                    = %#RX64\n",   pszPrefix, pVmcs->u64GuestPdpte0.u));
     1102        LogRel(("  %sPDPTE 1                    = %#RX64\n",   pszPrefix, pVmcs->u64GuestPdpte1.u));
     1103        LogRel(("  %sPDPTE 2                    = %#RX64\n",   pszPrefix, pVmcs->u64GuestPdpte2.u));
     1104        LogRel(("  %sPDPTE 3                    = %#RX64\n",   pszPrefix, pVmcs->u64GuestPdpte3.u));
     1105        LogRel(("  %sBNDCFGS                    = %#RX64\n",   pszPrefix, pVmcs->u64GuestBndcfgsMsr.u));
     1106
     1107        /* Natural width. */
     1108        LogRel(("  %scr0                        = %#RX64\n",   pszPrefix, pVmcs->u64GuestCr0.u));
     1109        LogRel(("  %scr3                        = %#RX64\n",   pszPrefix, pVmcs->u64GuestCr3.u));
     1110        LogRel(("  %scr4                        = %#RX64\n",   pszPrefix, pVmcs->u64GuestCr4.u));
     1111        LogRel(("  %sdr7                        = %#RX64\n",   pszPrefix, pVmcs->u64GuestDr7.u));
     1112        LogRel(("  %srsp                        = %#RX64\n",   pszPrefix, pVmcs->u64GuestRsp.u));
     1113        LogRel(("  %srip                        = %#RX64\n",   pszPrefix, pVmcs->u64GuestRip.u));
     1114        LogRel(("  %srflags                     = %#RX64\n",   pszPrefix, pVmcs->u64GuestRFlags.u));
     1115        LogRel(("  %sPending debug xcpts        = %#RX64\n",   pszPrefix, pVmcs->u64GuestPendingDbgXcpt.u));
     1116        LogRel(("  %sSysEnter ESP               = %#RX64\n",   pszPrefix, pVmcs->u64GuestSysenterEsp.u));
     1117        LogRel(("  %sSysEnter EIP               = %#RX64\n",   pszPrefix, pVmcs->u64GuestSysenterEip.u));
     1118    }
     1119
     1120    /* Host state. */
     1121    {
     1122        LogRel(("%sHost state:\n", pszPrefix));
     1123
     1124        /* 16-bit. */
     1125        LogRel(("  %scs                         = %#RX16\n",   pszPrefix, pVmcs->HostCs));
     1126        LogRel(("  %sss                         = %#RX16\n",   pszPrefix, pVmcs->HostSs));
     1127        LogRel(("  %sds                         = %#RX16\n",   pszPrefix, pVmcs->HostDs));
     1128        LogRel(("  %ses                         = %#RX16\n",   pszPrefix, pVmcs->HostEs));
     1129        HMVMX_DUMP_HOST_FS_GS_TR(pVmcs, Fs, "fs", pszPrefix);
     1130        HMVMX_DUMP_HOST_FS_GS_TR(pVmcs, Gs, "gs", pszPrefix);
     1131        HMVMX_DUMP_HOST_FS_GS_TR(pVmcs, Tr, "tr", pszPrefix);
     1132        HMVMX_DUMP_HOST_XDTR(pVmcs, Gdtr, "gdtr", pszPrefix);
     1133        HMVMX_DUMP_HOST_XDTR(pVmcs, Idtr, "idtr", pszPrefix);
     1134
     1135        /* 32-bit. */
     1136        LogRel(("  %sSysEnter CS                = %#RX32\n",   pszPrefix, pVmcs->u32HostSysenterCs));
     1137
     1138        /* 64-bit. */
     1139        LogRel(("  %sEFER                       = %#RX64\n",   pszPrefix, pVmcs->u64HostEferMsr.u));
     1140        LogRel(("  %sPAT                        = %#RX64\n",   pszPrefix, pVmcs->u64HostPatMsr.u));
     1141        LogRel(("  %sPERFGLOBALCTRL             = %#RX64\n",   pszPrefix, pVmcs->u64HostPerfGlobalCtlMsr.u));
     1142
     1143        /* Natural width. */
     1144        LogRel(("  %scr0                        = %#RX64\n",   pszPrefix, pVmcs->u64HostCr0.u));
     1145        LogRel(("  %scr3                        = %#RX64\n",   pszPrefix, pVmcs->u64HostCr3.u));
     1146        LogRel(("  %scr4                        = %#RX64\n",   pszPrefix, pVmcs->u64HostCr4.u));
     1147        LogRel(("  %sSysEnter ESP               = %#RX64\n",   pszPrefix, pVmcs->u64HostSysenterEsp.u));
     1148        LogRel(("  %sSysEnter EIP               = %#RX64\n",   pszPrefix, pVmcs->u64HostSysenterEip.u));
     1149        LogRel(("  %srsp                        = %#RX64\n",   pszPrefix, pVmcs->u64HostRsp.u));
     1150        LogRel(("  %srip                        = %#RX64\n",   pszPrefix, pVmcs->u64HostRip.u));
     1151    }
     1152
     1153    /* Read-only fields. */
     1154    {
     1155        LogRel(("%sRead-only data fields:\n", pszPrefix));
     1156
     1157        /* 16-bit (none currently). */
     1158
     1159        /* 32-bit. */
     1160        uint32_t const uExitReason = pVmcs->u32RoExitReason;
     1161        LogRel(("  %sExit reason                = %u (%s)\n",  pszPrefix, uExitReason, HMGetVmxExitName(uExitReason)));
     1162        LogRel(("  %sExit qualification         = %#RX64\n",   pszPrefix, pVmcs->u64RoExitQual.u));
     1163        LogRel(("  %sVM-instruction error       = %#RX32\n",   pszPrefix, pVmcs->u32RoVmInstrError));
     1164        LogRel(("  %sVM-exit intr info          = %#RX32\n",   pszPrefix, pVmcs->u32RoExitIntInfo));
     1165        {
     1166            uint32_t const fInfo = pVmcs->u32RoExitIntInfo;
     1167            uint8_t  const uType = VMX_EXIT_INT_INFO_TYPE(fInfo);
     1168            LogRel(("    %sValid                      = %RTbool\n",  pszPrefix, VMX_EXIT_INT_INFO_IS_VALID(fInfo)));
     1169            LogRel(("    %sType                       = %#x (%s)\n", pszPrefix, uType, HMGetVmxExitIntInfoTypeDesc(uType)));
     1170            LogRel(("    %sVector                     = %#x\n",      pszPrefix, VMX_EXIT_INT_INFO_VECTOR(fInfo)));
     1171            LogRel(("    %sNMI-unblocking-IRET        = %RTbool\n",  pszPrefix, VMX_EXIT_INT_INFO_IS_NMI_UNBLOCK_IRET(fInfo)));
     1172            LogRel(("    %sError-code valid           = %RTbool\n",  pszPrefix, VMX_EXIT_INT_INFO_IS_ERROR_CODE_VALID(fInfo)));
     1173        }
     1174        LogRel(("  %sVM-exit intr error-code    = %#RX32\n",   pszPrefix, pVmcs->u32RoExitIntErrCode));
     1175        LogRel(("  %sIDT-vectoring info         = %#RX32\n",   pszPrefix, pVmcs->u32RoIdtVectoringInfo));
     1176        {
     1177            uint32_t const fInfo = pVmcs->u32RoIdtVectoringInfo;
     1178            uint8_t  const uType = VMX_IDT_VECTORING_INFO_TYPE(fInfo);
     1179            LogRel(("    %sValid                      = %RTbool\n",  pszPrefix, VMX_IDT_VECTORING_INFO_IS_VALID(fInfo)));
     1180            LogRel(("    %sType                       = %#x (%s)\n", pszPrefix, uType, HMGetVmxIdtVectoringInfoTypeDesc(uType)));
     1181            LogRel(("    %sVector                     = %#x\n",      pszPrefix, VMX_IDT_VECTORING_INFO_VECTOR(fInfo)));
     1182            LogRel(("    %sError-code valid           = %RTbool\n",  pszPrefix, VMX_IDT_VECTORING_INFO_IS_ERROR_CODE_VALID(fInfo)));
     1183        }
     1184        LogRel(("  %sIDT-vectoring error-code   = %#RX32\n",   pszPrefix, pVmcs->u32RoIdtVectoringErrCode));
     1185        LogRel(("  %sVM-exit instruction length = %u bytes\n", pszPrefix, pVmcs->u32RoExitInstrLen));
     1186        LogRel(("  %sVM-exit instruction info   = %#RX64\n",   pszPrefix, pVmcs->u32RoExitInstrInfo));
     1187
     1188        /* 64-bit. */
     1189        LogRel(("  %sGuest-physical addr        = %#RX64\n",   pszPrefix, pVmcs->u64RoGuestPhysAddr.u));
     1190
     1191        /* Natural width. */
     1192        LogRel(("  %sI/O RCX                    = %#RX64\n",   pszPrefix, pVmcs->u64RoIoRcx.u));
     1193        LogRel(("  %sI/O RSI                    = %#RX64\n",   pszPrefix, pVmcs->u64RoIoRsi.u));
     1194        LogRel(("  %sI/O RDI                    = %#RX64\n",   pszPrefix, pVmcs->u64RoIoRdi.u));
     1195        LogRel(("  %sI/O RIP                    = %#RX64\n",   pszPrefix, pVmcs->u64RoIoRip.u));
     1196        LogRel(("  %sGuest-linear addr          = %#RX64\n",   pszPrefix, pVmcs->u64RoGuestLinearAddr.u));
     1197    }
     1198
     1199# undef HMVMX_DUMP_HOST_XDTR
     1200# undef HMVMX_DUMP_HOST_FS_GS_TR
     1201# undef HMVMX_DUMP_GUEST_SEGREG
     1202# undef HMVMX_DUMP_GUEST_XDTR
     1203#else
     1204    NOREF(pVCpu);
     1205#endif /* !IN_RC */
     1206}
     1207
  • trunk/src/VBox/VMM/VMMAll/IEMAllCImplSvmInstr.cpp.h

    r76553 r76993  
    160160             * writing the VMCB back to guest memory.
    161161             */
    162             HMSvmNstGstVmExitNotify(pVCpu, IEM_GET_CTX(pVCpu));
     162            HMNotifySvmNstGstVmexit(pVCpu, IEM_GET_CTX(pVCpu));
    163163
    164164            Assert(CPUMSELREG_ARE_HIDDEN_PARTS_VALID(pVCpu, &pVCpu->cpum.GstCtx.es));
     
    341341    /* CLGI/STGI may not have been intercepted and thus not executed in IEM. */
    342342    if (   HMIsEnabled(pVCpu->CTX_SUFF(pVM))
    343         && HMSvmIsVGifActive(pVCpu->CTX_SUFF(pVM)))
     343        && HMIsSvmVGifActive(pVCpu->CTX_SUFF(pVM)))
    344344        return EMR3SetExecutionPolicy(pVCpu->CTX_SUFF(pVM)->pUVM, EMEXECPOLICY_IEM_ALL, false);
    345345# endif
     
    842842        /* If CLGI/STGI isn't intercepted we force IEM-only nested-guest execution here. */
    843843        if (   HMIsEnabled(pVM)
    844             && HMSvmIsVGifActive(pVM))
     844            && HMIsSvmVGifActive(pVM))
    845845            return EMR3SetExecutionPolicy(pVCpu->CTX_SUFF(pVM)->pUVM, EMEXECPOLICY_IEM_ALL, true);
    846846# endif
     
    990990    SVMIOIOEXITINFO IoExitInfo;
    991991    void *pvIoBitmap = pVCpu->cpum.GstCtx.hwvirt.svm.CTX_SUFF(pvIoBitmap);
    992     bool const fIntercept = HMSvmIsIOInterceptActive(pvIoBitmap, u16Port, enmIoType, cbReg, cAddrSizeBits, iEffSeg, fRep,
     992    bool const fIntercept = HMIsSvmIoInterceptActive(pvIoBitmap, u16Port, enmIoType, cbReg, cAddrSizeBits, iEffSeg, fRep,
    993993                                                       fStrIo, &IoExitInfo);
    994994    if (fIntercept)
     
    10391039    uint16_t offMsrpm;
    10401040    uint8_t  uMsrpmBit;
    1041     int rc = HMSvmGetMsrpmOffsetAndBit(idMsr, &offMsrpm, &uMsrpmBit);
     1041    int rc = HMGetSvmMsrpmOffsetAndBit(idMsr, &offMsrpm, &uMsrpmBit);
    10421042    if (RT_SUCCESS(rc))
    10431043    {
     
    14171417    if (VM_IS_HM_ENABLED(pVCpu->CTX_SUFF(pVM)))
    14181418    {
    1419         int rc = HMHCSvmMaybeMovTprHypercall(pVCpu);
     1419        int rc = HMHCMaybeMovTprSvmHypercall(pVCpu);
    14201420        if (RT_SUCCESS(rc))
    14211421        {
  • trunk/src/VBox/VMM/VMMAll/IEMAllCImplVmxInstr.cpp.h

    r76952 r76993  
    148148    { \
    149149        Log(("%s: VM-entry failed! enmDiag=%u (%s) -> %s\n", (a_pszInstr), (a_VmxDiag), \
    150             HMVmxGetDiagDesc(a_VmxDiag), (a_pszFailure))); \
     150            HMGetVmxDiagDesc(a_VmxDiag), (a_pszFailure))); \
    151151        (a_pVCpu)->cpum.GstCtx.hwvirt.vmx.enmDiag = (a_VmxDiag); \
    152152        return VERR_VMX_VMENTRY_FAILED; \
     
    158158    { \
    159159        Log(("VM-exit failed! uExitReason=%u enmDiag=%u (%s) -> %s\n", (a_uExitReason), (a_VmxDiag), \
    160             HMVmxGetDiagDesc(a_VmxDiag), (a_pszFailure))); \
     160            HMGetVmxDiagDesc(a_VmxDiag), (a_pszFailure))); \
    161161        (a_pVCpu)->cpum.GstCtx.hwvirt.vmx.enmDiag = (a_VmxDiag); \
    162162        return VERR_VMX_VMEXIT_FAILED; \
     
    20392039     * See Intel spec. 27.7 "VMX Aborts".
    20402040     */
    2041     LogFunc(("enmAbort=%u (%s) -> RESET\n", enmAbort, HMVmxGetAbortDesc(enmAbort)));
     2041    LogFunc(("enmAbort=%u (%s) -> RESET\n", enmAbort, HMGetVmxAbortDesc(enmAbort)));
    20422042
    20432043    /* We don't support SMX yet. */
     
    30733073        Assert(pbIoBitmapA);
    30743074        Assert(pbIoBitmapB);
    3075         return HMVmxGetIoBitmapPermission(pbIoBitmapA, pbIoBitmapB, u16Port, cbAccess);
     3075        return HMGetVmxIoBitmapPermission(pbIoBitmapA, pbIoBitmapB, u16Port, cbAccess);
    30763076    }
    30773077
     
    74857485        {
    74867486            VMXMSREXITREAD enmRead;
    7487             int rc = HMVmxGetMsrPermission(pVCpu->cpum.GstCtx.hwvirt.vmx.CTX_SUFF(pvMsrBitmap), idMsr, &enmRead,
     7487            int rc = HMGetVmxMsrPermission(pVCpu->cpum.GstCtx.hwvirt.vmx.CTX_SUFF(pvMsrBitmap), idMsr, &enmRead,
    74887488                                             NULL /* penmWrite */);
    74897489            AssertRC(rc);
     
    74947494        {
    74957495            VMXMSREXITWRITE enmWrite;
    7496             int rc = HMVmxGetMsrPermission(pVCpu->cpum.GstCtx.hwvirt.vmx.CTX_SUFF(pvMsrBitmap), idMsr, NULL /* penmRead */,
     7496            int rc = HMGetVmxMsrPermission(pVCpu->cpum.GstCtx.hwvirt.vmx.CTX_SUFF(pvMsrBitmap), idMsr, NULL /* penmRead */,
    74977497                                             &enmWrite);
    74987498            AssertRC(rc);
  • trunk/src/VBox/VMM/VMMAll/PGMAll.cpp

    r76553 r76993  
    34223422     * Notify HM.
    34233423     */
    3424     HMHCPagingModeChanged(pVM, pVCpu, pVCpu->pgm.s.enmShadowMode, pVCpu->pgm.s.enmGuestMode);
     3424    HMHCChangedPagingMode(pVM, pVCpu, pVCpu->pgm.s.enmShadowMode, pVCpu->pgm.s.enmGuestMode);
    34253425    return rc;
    34263426}
  • trunk/src/VBox/VMM/VMMAll/PGMAllHandler.cpp

    r76553 r76993  
    732732        PGM_INVL_VCPU_TLBS(VMMGetCpu0(pVM));
    733733#else
    734     HMFlushTLBOnAllVCpus(pVM);
     734    HMFlushTlbOnAllVCpus(pVM);
    735735#endif
    736736
  • trunk/src/VBox/VMM/VMMR0/HMR0.cpp

    r76553 r76993  
    11761176        pVM->hm.s.vmx.u64HostEfer           = g_HmR0.hwvirt.u.vmx.u64HostEfer;
    11771177        pVM->hm.s.vmx.u64HostSmmMonitorCtl  = g_HmR0.hwvirt.u.vmx.u64HostSmmMonitorCtl;
    1178         HMVmxGetVmxMsrsFromHwvirtMsrs(&g_HmR0.hwvirt.Msrs, &pVM->hm.s.vmx.Msrs);
     1178        HMGetVmxMsrsFromHwvirtMsrs(&g_HmR0.hwvirt.Msrs, &pVM->hm.s.vmx.Msrs);
    11791179    }
    11801180    else if (pVM->hm.s.svm.fSupported)
  • trunk/src/VBox/VMM/VMMR0/HMSVMR0.cpp

    r76553 r76993  
    712712    uint32_t u32Model;
    713713    uint32_t u32Stepping;
    714     if (HMSvmIsSubjectToErratum170(&u32Family, &u32Model, &u32Stepping))
     714    if (HMIsSubjectToSvmErratum170(&u32Family, &u32Model, &u32Stepping))
    715715    {
    716716        Log4Func(("AMD cpu with erratum 170 family %#x model %#x stepping %#x\n", u32Family, u32Model, u32Stepping));
     
    872872    uint16_t    offMsrpm;
    873873    uint8_t     uMsrpmBit;
    874     int rc = HMSvmGetMsrpmOffsetAndBit(idMsr, &offMsrpm, &uMsrpmBit);
     874    int rc = HMGetSvmMsrpmOffsetAndBit(idMsr, &offMsrpm, &uMsrpmBit);
    875875    AssertRC(rc);
    876876
     
    24532453    {
    24542454        Assert(pVCpu->CTX_SUFF(pVM)->hm.s.svm.u32Features & X86_CPUID_SVM_FEATURE_EDX_VGIF);    /* Hardware supports it. */
    2455         Assert(HMSvmIsVGifActive(pVCpu->CTX_SUFF(pVM)));                                        /* VM has configured it. */
     2455        Assert(HMIsSvmVGifActive(pVCpu->CTX_SUFF(pVM)));                                        /* VM has configured it. */
    24562456        pVmcb->ctrl.IntCtrl.n.u1VGif = CPUMGetGuestGif(pCtx);
    24572457    }
     
    25432543 * @param   pVCpu           The cross context virtual CPU structure.
    25442544 *
    2545  * @sa      HMSvmNstGstVmExitNotify.
     2545 * @sa      HMNotifySvmNstGstVmexit.
    25462546 */
    25472547static bool hmR0SvmCacheVmcbNested(PVMCPU pVCpu)
     
    28062806            {
    28072807                Assert(!CPUMIsGuestInSvmNestedHwVirtMode(pCtx));    /* We don't yet support passing VGIF feature to the guest. */
    2808                 Assert(HMSvmIsVGifActive(pVCpu->CTX_SUFF(pVM)));    /* VM has configured it. */
     2808                Assert(HMIsSvmVGifActive(pVCpu->CTX_SUFF(pVM)));    /* VM has configured it. */
    28092809                CPUMSetGuestGif(pCtx, pVmcbCtrl->IntCtrl.n.u1VGif);
    28102810            }
     
    33373337        /* Apply the nested-guest VMCB's TSC offset over the guest TSC offset. */
    33383338        if (CPUMIsGuestInSvmNestedHwVirtMode(&pVCpu->cpum.GstCtx))
    3339             uTscOffset = HMSvmNstGstApplyTscOffset(pVCpu, uTscOffset);
     3339            uTscOffset = HMApplySvmNstGstTscOffset(pVCpu, uTscOffset);
    33403340#endif
    33413341
     
    46864686 *          hmR0SvmNstGstUndoTscOffset() needs adjusting.
    46874687 *
    4688  * @sa      HMSvmNstGstApplyTscOffset().
     4688 * @sa      HMApplySvmNstGstTscOffset().
    46894689 */
    46904690DECLINLINE(uint64_t) hmR0SvmNstGstUndoTscOffset(PVMCPU pVCpu, uint64_t uTicks)
     
    47274727        else
    47284728        {
    4729             /* The nested-guest VMCB TSC offset shall eventually be restored on #VMEXIT via HMSvmNstGstVmExitNotify(). */
     4729            /* The nested-guest VMCB TSC offset shall eventually be restored on #VMEXIT via HMNotifySvmNstGstVmexit(). */
    47304730            uint64_t const uGstTsc = hmR0SvmNstGstUndoTscOffset(pVCpu, uHostTsc + pVmcbCtrl->u64TSCOffset);
    47314731            TMCpuTickSetLastSeen(pVCpu, uGstTsc);
     
    51675167    const bool        fStrIo        = pIoExitInfo->n.u1Str;
    51685168
    5169     return HMSvmIsIOInterceptActive(pvIoBitmap, u16Port, enmIoType, cbReg, cAddrSizeBits, iEffSeg, fRep, fStrIo,
     5169    return HMIsSvmIoInterceptActive(pvIoBitmap, u16Port, enmIoType, cbReg, cAddrSizeBits, iEffSeg, fRep, fStrIo,
    51705170                                      NULL /* pIoExitInfo */);
    51715171}
     
    52595259                uint16_t offMsrpm;
    52605260                uint8_t  uMsrpmBit;
    5261                 int rc = HMSvmGetMsrpmOffsetAndBit(idMsr, &offMsrpm, &uMsrpmBit);
     5261                int rc = HMGetSvmMsrpmOffsetAndBit(idMsr, &offMsrpm, &uMsrpmBit);
    52625262                if (RT_SUCCESS(rc))
    52635263                {
  • trunk/src/VBox/VMM/VMMR0/HMVMXR0.cpp

    r76876 r76993  
    17561756            VMXMSREXITREAD  enmRead;
    17571757            VMXMSREXITWRITE enmWrite;
    1758             rc = HMVmxGetMsrPermission(pVCpu->hm.s.vmx.pvMsrBitmap, pGuestMsr->u32Msr, &enmRead, &enmWrite);
    1759             AssertMsgReturnVoid(rc == VINF_SUCCESS, ("HMVmxGetMsrPermission! failed. rc=%Rrc\n", rc));
     1758            rc = HMGetVmxMsrPermission(pVCpu->hm.s.vmx.pvMsrBitmap, pGuestMsr->u32Msr, &enmRead, &enmWrite);
     1759            AssertMsgReturnVoid(rc == VINF_SUCCESS, ("HMGetVmxMsrPermission! failed. rc=%Rrc\n", rc));
    17601760            if (pGuestMsr->u32Msr == MSR_K6_EFER)
    17611761            {
     
    1198611986            VMXMSREXITREAD  enmRead;
    1198711987            VMXMSREXITWRITE enmWrite;
    11988             int rc2 = HMVmxGetMsrPermission(pVCpu->hm.s.vmx.pvMsrBitmap, idMsr, &enmRead, &enmWrite);
     11988            int rc2 = HMGetVmxMsrPermission(pVCpu->hm.s.vmx.pvMsrBitmap, idMsr, &enmRead, &enmWrite);
    1198911989            AssertRCReturn(rc2, rc2);
    1199011990            if (enmRead == VMXMSREXIT_PASSTHRU_READ)
     
    1213112131                        VMXMSREXITREAD  enmRead;
    1213212132                        VMXMSREXITWRITE enmWrite;
    12133                         int rc2 = HMVmxGetMsrPermission(pVCpu->hm.s.vmx.pvMsrBitmap, idMsr, &enmRead, &enmWrite);
     12133                        int rc2 = HMGetVmxMsrPermission(pVCpu->hm.s.vmx.pvMsrBitmap, idMsr, &enmRead, &enmWrite);
    1213412134                        AssertRCReturn(rc2, rc2);
    1213512135                        if (enmWrite == VMXMSREXIT_PASSTHRU_WRITE)
     
    1329513295             * guest using hardware-assisted VMX. Otherwise, fall back to emulation.
    1329613296             */
    13297             if (HMVmxCanExecuteGuest(pVCpu, pCtx))
     13297            if (HMCanExecuteVmxGuest(pVCpu, pCtx))
    1329813298            {
    1329913299                Log4Func(("Mode changed but guest still suitable for executing using VT-x\n"));
  • trunk/src/VBox/VMM/VMMR3/CPUM.cpp

    r76952 r76993  
    17631763            {
    17641764                if (fCaps & SUPVTCAPS_VT_X)
    1765                     HMVmxGetVmxMsrsFromHwvirtMsrs(&HwvirtMsrs, &pMsrs->hwvirt.vmx);
     1765                    HMGetVmxMsrsFromHwvirtMsrs(&HwvirtMsrs, &pMsrs->hwvirt.vmx);
    17661766                else
    1767                     HMVmxGetSvmMsrsFromHwvirtMsrs(&HwvirtMsrs, &pMsrs->hwvirt.svm);
     1767                    HMGetSvmMsrsFromHwvirtMsrs(&HwvirtMsrs, &pMsrs->hwvirt.svm);
    17681768                return VINF_SUCCESS;
    17691769            }
     
    33903390        pHlp->pfnPrintf(pHlp, "%sHeader:\n", pszPrefix);
    33913391        pHlp->pfnPrintf(pHlp, "  %sVMCS revision id           = %#RX32\n",   pszPrefix, pVmcs->u32VmcsRevId);
    3392         pHlp->pfnPrintf(pHlp, "  %sVMX-abort id               = %#RX32 (%s)\n", pszPrefix, pVmcs->enmVmxAbort, HMVmxGetAbortDesc(pVmcs->enmVmxAbort));
    3393         pHlp->pfnPrintf(pHlp, "  %sVMCS state                 = %#x (%s)\n", pszPrefix, pVmcs->fVmcsState, HMVmxGetVmcsStateDesc(pVmcs->fVmcsState));
     3392        pHlp->pfnPrintf(pHlp, "  %sVMX-abort id               = %#RX32 (%s)\n", pszPrefix, pVmcs->enmVmxAbort, HMGetVmxAbortDesc(pVmcs->enmVmxAbort));
     3393        pHlp->pfnPrintf(pHlp, "  %sVMCS state                 = %#x (%s)\n", pszPrefix, pVmcs->fVmcsState, HMGetVmxVmcsStateDesc(pVmcs->fVmcsState));
    33943394    }
    33953395
     
    34203420            uint8_t  const uType = VMX_ENTRY_INT_INFO_TYPE(fInfo);
    34213421            pHlp->pfnPrintf(pHlp, "    %sValid                      = %RTbool\n", pszPrefix, VMX_ENTRY_INT_INFO_IS_VALID(fInfo));
    3422             pHlp->pfnPrintf(pHlp, "    %sType                       = %#x (%s)\n", pszPrefix, uType, HMVmxGetEntryIntInfoTypeDesc(uType));
     3422            pHlp->pfnPrintf(pHlp, "    %sType                       = %#x (%s)\n", pszPrefix, uType, HMGetVmxEntryIntInfoTypeDesc(uType));
    34233423            pHlp->pfnPrintf(pHlp, "    %sVector                     = %#x\n",     pszPrefix, VMX_ENTRY_INT_INFO_VECTOR(fInfo));
    34243424            pHlp->pfnPrintf(pHlp, "    %sNMI-unblocking-IRET        = %RTbool\n", pszPrefix, VMX_ENTRY_INT_INFO_IS_NMI_UNBLOCK_IRET(fInfo));
     
    35613561
    35623562        /* 32-bit. */
    3563         pHlp->pfnPrintf(pHlp, "  %sExit reason                = %u (%s)\n",  pszPrefix, pVmcs->u32RoExitReason, HMR3GetVmxExitName(pVmcs->u32RoExitReason));
     3563        pHlp->pfnPrintf(pHlp, "  %sExit reason                = %u (%s)\n",  pszPrefix, pVmcs->u32RoExitReason, HMGetVmxExitName(pVmcs->u32RoExitReason));
    35643564        pHlp->pfnPrintf(pHlp, "  %sExit qualification         = %#RX64\n",   pszPrefix, pVmcs->u64RoExitQual.u);
    35653565        pHlp->pfnPrintf(pHlp, "  %sVM-instruction error       = %#RX32\n",   pszPrefix, pVmcs->u32RoVmInstrError);
     
    35693569            uint8_t  const uType = VMX_EXIT_INT_INFO_TYPE(fInfo);
    35703570            pHlp->pfnPrintf(pHlp, "    %sValid                      = %RTbool\n", pszPrefix, VMX_EXIT_INT_INFO_IS_VALID(fInfo));
    3571             pHlp->pfnPrintf(pHlp, "    %sType                       = %#x (%s)\n",     pszPrefix, uType, HMVmxGetExitIntInfoTypeDesc(uType));
     3571            pHlp->pfnPrintf(pHlp, "    %sType                       = %#x (%s)\n",     pszPrefix, uType, HMGetVmxExitIntInfoTypeDesc(uType));
    35723572            pHlp->pfnPrintf(pHlp, "    %sVector                     = %#x\n",     pszPrefix, VMX_EXIT_INT_INFO_VECTOR(fInfo));
    35733573            pHlp->pfnPrintf(pHlp, "    %sNMI-unblocking-IRET        = %RTbool\n", pszPrefix, VMX_EXIT_INT_INFO_IS_NMI_UNBLOCK_IRET(fInfo));
     
    35803580            uint8_t  const uType = VMX_IDT_VECTORING_INFO_TYPE(fInfo);
    35813581            pHlp->pfnPrintf(pHlp, "    %sValid                      = %RTbool\n", pszPrefix, VMX_IDT_VECTORING_INFO_IS_VALID(fInfo));
    3582             pHlp->pfnPrintf(pHlp, "    %sType                       = %#x (%s)\n",     pszPrefix, uType, HMVmxGetIdtVectoringInfoTypeDesc(uType));
     3582            pHlp->pfnPrintf(pHlp, "    %sType                       = %#x (%s)\n",     pszPrefix, uType, HMGetVmxIdtVectoringInfoTypeDesc(uType));
    35833583            pHlp->pfnPrintf(pHlp, "    %sVector                     = %#x\n",     pszPrefix, VMX_IDT_VECTORING_INFO_VECTOR(fInfo));
    35843584            pHlp->pfnPrintf(pHlp, "    %sError-code valid           = %RTbool\n", pszPrefix, VMX_IDT_VECTORING_INFO_IS_ERROR_CODE_VALID(fInfo));
     
    37073707        pHlp->pfnPrintf(pHlp, "  GCPhysVmcs                 = %#RGp\n",     pCtx->hwvirt.vmx.GCPhysVmcs);
    37083708        pHlp->pfnPrintf(pHlp, "  GCPhysShadowVmcs           = %#RGp\n",     pCtx->hwvirt.vmx.GCPhysShadowVmcs);
    3709         pHlp->pfnPrintf(pHlp, "  enmDiag                    = %u (%s)\n",   pCtx->hwvirt.vmx.enmDiag, HMVmxGetDiagDesc(pCtx->hwvirt.vmx.enmDiag));
    3710         pHlp->pfnPrintf(pHlp, "  enmAbort                   = %u (%s)\n",   pCtx->hwvirt.vmx.enmAbort, HMVmxGetAbortDesc(pCtx->hwvirt.vmx.enmAbort));
     3709        pHlp->pfnPrintf(pHlp, "  enmDiag                    = %u (%s)\n",   pCtx->hwvirt.vmx.enmDiag, HMGetVmxDiagDesc(pCtx->hwvirt.vmx.enmDiag));
     3710        pHlp->pfnPrintf(pHlp, "  enmAbort                   = %u (%s)\n",   pCtx->hwvirt.vmx.enmAbort, HMGetVmxAbortDesc(pCtx->hwvirt.vmx.enmAbort));
    37113711        pHlp->pfnPrintf(pHlp, "  uAbortAux                  = %u (%#x)\n",  pCtx->hwvirt.vmx.uAbortAux, pCtx->hwvirt.vmx.uAbortAux);
    37123712        pHlp->pfnPrintf(pHlp, "  fInVmxRootMode             = %RTbool\n",   pCtx->hwvirt.vmx.fInVmxRootMode);
  • trunk/src/VBox/VMM/VMMR3/EMR3Dbg.cpp

    r76553 r76993  
    130130
    131131        case EMEXIT_F_KIND_VMX:
    132             pszExitName = HMR3GetVmxExitName( uFlagsAndType & EMEXIT_F_TYPE_MASK);
     132            pszExitName = HMGetVmxExitName( uFlagsAndType & EMEXIT_F_TYPE_MASK);
    133133            break;
    134134
    135135        case EMEXIT_F_KIND_SVM:
    136             pszExitName = HMR3GetSvmExitName( uFlagsAndType & EMEXIT_F_TYPE_MASK);
     136            pszExitName = HMGetSvmExitName( uFlagsAndType & EMEXIT_F_TYPE_MASK);
    137137            break;
    138138
  • trunk/src/VBox/VMM/VMMR3/HM.cpp

    r76886 r76993  
    7575
    7676/*********************************************************************************************************************************
    77 *   Global Variables                                                                                                             *
     77*   Defined Constants And Macros                                                                                                 *
    7878*********************************************************************************************************************************/
    79 #define EXIT_REASON(def, val, str) #def " - " #val " - " str
    80 #define EXIT_REASON_NIL() NULL
    81 /** Exit reason descriptions for VT-x, used to describe statistics and exit
    82  *  history. */
    83 static const char * const g_apszVmxExitReasons[MAX_EXITREASON_STAT] =
    84 {
    85     EXIT_REASON(VMX_EXIT_XCPT_OR_NMI            ,   0, "Exception or non-maskable interrupt (NMI)."),
    86     EXIT_REASON(VMX_EXIT_EXT_INT                ,   1, "External interrupt."),
    87     EXIT_REASON(VMX_EXIT_TRIPLE_FAULT           ,   2, "Triple fault."),
    88     EXIT_REASON(VMX_EXIT_INIT_SIGNAL            ,   3, "INIT signal."),
    89     EXIT_REASON(VMX_EXIT_SIPI                   ,   4, "Start-up IPI (SIPI)."),
    90     EXIT_REASON(VMX_EXIT_IO_SMI_IRQ             ,   5, "I/O system-management interrupt (SMI)."),
    91     EXIT_REASON(VMX_EXIT_SMI_IRQ                ,   6, "Other SMI."),
    92     EXIT_REASON(VMX_EXIT_INT_WINDOW             ,   7, "Interrupt window."),
    93     EXIT_REASON(VMX_EXIT_NMI_WINDOW             ,   8, "NMI window."),
    94     EXIT_REASON(VMX_EXIT_TASK_SWITCH            ,   9, "Task switch."),
    95     EXIT_REASON(VMX_EXIT_CPUID                  ,  10, "CPUID instruction."),
    96     EXIT_REASON(VMX_EXIT_GETSEC                 ,  11, "GETSEC instrunction."),
    97     EXIT_REASON(VMX_EXIT_HLT                    ,  12, "HLT instruction."),
    98     EXIT_REASON(VMX_EXIT_INVD                   ,  13, "INVD instruction."),
    99     EXIT_REASON(VMX_EXIT_INVLPG                 ,  14, "INVLPG instruction."),
    100     EXIT_REASON(VMX_EXIT_RDPMC                  ,  15, "RDPMCinstruction."),
    101     EXIT_REASON(VMX_EXIT_RDTSC                  ,  16, "RDTSC instruction."),
    102     EXIT_REASON(VMX_EXIT_RSM                    ,  17, "RSM instruction in SMM."),
    103     EXIT_REASON(VMX_EXIT_VMCALL                 ,  18, "VMCALL instruction."),
    104     EXIT_REASON(VMX_EXIT_VMCLEAR                ,  19, "VMCLEAR instruction."),
    105     EXIT_REASON(VMX_EXIT_VMLAUNCH               ,  20, "VMLAUNCH instruction."),
    106     EXIT_REASON(VMX_EXIT_VMPTRLD                ,  21, "VMPTRLD instruction."),
    107     EXIT_REASON(VMX_EXIT_VMPTRST                ,  22, "VMPTRST instruction."),
    108     EXIT_REASON(VMX_EXIT_VMREAD                 ,  23, "VMREAD instruction."),
    109     EXIT_REASON(VMX_EXIT_VMRESUME               ,  24, "VMRESUME instruction."),
    110     EXIT_REASON(VMX_EXIT_VMWRITE                ,  25, "VMWRITE instruction."),
    111     EXIT_REASON(VMX_EXIT_VMXOFF                 ,  26, "VMXOFF instruction."),
    112     EXIT_REASON(VMX_EXIT_VMXON                  ,  27, "VMXON instruction."),
    113     EXIT_REASON(VMX_EXIT_MOV_CRX                ,  28, "Control-register accesses."),
    114     EXIT_REASON(VMX_EXIT_MOV_DRX                ,  29, "Debug-register accesses."),
    115     EXIT_REASON(VMX_EXIT_PORT_IO                ,  30, "I/O instruction."),
    116     EXIT_REASON(VMX_EXIT_RDMSR                  ,  31, "RDMSR instruction."),
    117     EXIT_REASON(VMX_EXIT_WRMSR                  ,  32, "WRMSR instruction."),
    118     EXIT_REASON(VMX_EXIT_ERR_INVALID_GUEST_STATE,  33, "VM-entry failure due to invalid guest state."),
    119     EXIT_REASON(VMX_EXIT_ERR_MSR_LOAD           ,  34, "VM-entry failure due to MSR loading."),
    120     EXIT_REASON_NIL(),
    121     EXIT_REASON(VMX_EXIT_MWAIT                  ,  36, "MWAIT instruction."),
    122     EXIT_REASON(VMX_EXIT_MTF                    ,  37, "Monitor Trap Flag."),
    123     EXIT_REASON_NIL(),
    124     EXIT_REASON(VMX_EXIT_MONITOR                ,  39, "MONITOR instruction."),
    125     EXIT_REASON(VMX_EXIT_PAUSE                  ,  40, "PAUSE instruction."),
    126     EXIT_REASON(VMX_EXIT_ERR_MACHINE_CHECK      ,  41, "VM-entry failure due to machine-check."),
    127     EXIT_REASON_NIL(),
    128     EXIT_REASON(VMX_EXIT_TPR_BELOW_THRESHOLD    ,  43, "TPR below threshold (MOV to CR8)."),
    129     EXIT_REASON(VMX_EXIT_APIC_ACCESS            ,  44, "APIC access."),
    130     EXIT_REASON(VMX_EXIT_VIRTUALIZED_EOI        ,  45, "Virtualized EOI."),
    131     EXIT_REASON(VMX_EXIT_GDTR_IDTR_ACCESS       ,  46, "GDTR/IDTR access using LGDT/SGDT/LIDT/SIDT."),
    132     EXIT_REASON(VMX_EXIT_LDTR_TR_ACCESS         ,  47, "LDTR/TR access using LLDT/SLDT/LTR/STR."),
    133     EXIT_REASON(VMX_EXIT_EPT_VIOLATION          ,  48, "EPT violation."),
    134     EXIT_REASON(VMX_EXIT_EPT_MISCONFIG          ,  49, "EPT misconfiguration."),
    135     EXIT_REASON(VMX_EXIT_INVEPT                 ,  50, "INVEPT instruction."),
    136     EXIT_REASON(VMX_EXIT_RDTSCP                 ,  51, "RDTSCP instruction."),
    137     EXIT_REASON(VMX_EXIT_PREEMPT_TIMER          ,  52, "VMX-preemption timer expired."),
    138     EXIT_REASON(VMX_EXIT_INVVPID                ,  53, "INVVPID instruction."),
    139     EXIT_REASON(VMX_EXIT_WBINVD                 ,  54, "WBINVD instruction."),
    140     EXIT_REASON(VMX_EXIT_XSETBV                 ,  55, "XSETBV instruction."),
    141     EXIT_REASON(VMX_EXIT_APIC_WRITE             ,  56, "APIC write completed to virtual-APIC page."),
    142     EXIT_REASON(VMX_EXIT_RDRAND                 ,  57, "RDRAND instruction."),
    143     EXIT_REASON(VMX_EXIT_INVPCID                ,  58, "INVPCID instruction."),
    144     EXIT_REASON(VMX_EXIT_VMFUNC                 ,  59, "VMFUNC instruction."),
    145     EXIT_REASON(VMX_EXIT_ENCLS                  ,  60, "ENCLS instruction."),
    146     EXIT_REASON(VMX_EXIT_RDSEED                 ,  61, "RDSEED instruction."),
    147     EXIT_REASON(VMX_EXIT_PML_FULL               ,  62, "Page-modification log full."),
    148     EXIT_REASON(VMX_EXIT_XSAVES                 ,  63, "XSAVES instruction."),
    149     EXIT_REASON(VMX_EXIT_XRSTORS                ,  64, "XRSTORS instruction.")
    150 };
    151 /** Array index of the last valid VT-x exit reason. */
    152 #define MAX_EXITREASON_VTX                         64
    153 
    154 /** A partial list of \#EXIT reason descriptions for AMD-V, used to describe
    155  *  statistics and exit history.
    156  *
    157  *  @note AMD-V have annoyingly large gaps (e.g. \#NPF VMEXIT comes at 1024),
    158  *        this array doesn't contain the entire set of exit reasons, we
    159  *        handle them via hmSvmGetSpecialExitReasonDesc(). */
    160 static const char * const g_apszSvmExitReasons[MAX_EXITREASON_STAT] =
    161 {
    162     EXIT_REASON(SVM_EXIT_READ_CR0     ,    0, "Read CR0."),
    163     EXIT_REASON(SVM_EXIT_READ_CR1     ,    1, "Read CR1."),
    164     EXIT_REASON(SVM_EXIT_READ_CR2     ,    2, "Read CR2."),
    165     EXIT_REASON(SVM_EXIT_READ_CR3     ,    3, "Read CR3."),
    166     EXIT_REASON(SVM_EXIT_READ_CR4     ,    4, "Read CR4."),
    167     EXIT_REASON(SVM_EXIT_READ_CR5     ,    5, "Read CR5."),
    168     EXIT_REASON(SVM_EXIT_READ_CR6     ,    6, "Read CR6."),
    169     EXIT_REASON(SVM_EXIT_READ_CR7     ,    7, "Read CR7."),
    170     EXIT_REASON(SVM_EXIT_READ_CR8     ,    8, "Read CR8."),
    171     EXIT_REASON(SVM_EXIT_READ_CR9     ,    9, "Read CR9."),
    172     EXIT_REASON(SVM_EXIT_READ_CR10    ,   10, "Read CR10."),
    173     EXIT_REASON(SVM_EXIT_READ_CR11    ,   11, "Read CR11."),
    174     EXIT_REASON(SVM_EXIT_READ_CR12    ,   12, "Read CR12."),
    175     EXIT_REASON(SVM_EXIT_READ_CR13    ,   13, "Read CR13."),
    176     EXIT_REASON(SVM_EXIT_READ_CR14    ,   14, "Read CR14."),
    177     EXIT_REASON(SVM_EXIT_READ_CR15    ,   15, "Read CR15."),
    178     EXIT_REASON(SVM_EXIT_WRITE_CR0    ,   16, "Write CR0."),
    179     EXIT_REASON(SVM_EXIT_WRITE_CR1    ,   17, "Write CR1."),
    180     EXIT_REASON(SVM_EXIT_WRITE_CR2    ,   18, "Write CR2."),
    181     EXIT_REASON(SVM_EXIT_WRITE_CR3    ,   19, "Write CR3."),
    182     EXIT_REASON(SVM_EXIT_WRITE_CR4    ,   20, "Write CR4."),
    183     EXIT_REASON(SVM_EXIT_WRITE_CR5    ,   21, "Write CR5."),
    184     EXIT_REASON(SVM_EXIT_WRITE_CR6    ,   22, "Write CR6."),
    185     EXIT_REASON(SVM_EXIT_WRITE_CR7    ,   23, "Write CR7."),
    186     EXIT_REASON(SVM_EXIT_WRITE_CR8    ,   24, "Write CR8."),
    187     EXIT_REASON(SVM_EXIT_WRITE_CR9    ,   25, "Write CR9."),
    188     EXIT_REASON(SVM_EXIT_WRITE_CR10   ,   26, "Write CR10."),
    189     EXIT_REASON(SVM_EXIT_WRITE_CR11   ,   27, "Write CR11."),
    190     EXIT_REASON(SVM_EXIT_WRITE_CR12   ,   28, "Write CR12."),
    191     EXIT_REASON(SVM_EXIT_WRITE_CR13   ,   29, "Write CR13."),
    192     EXIT_REASON(SVM_EXIT_WRITE_CR14   ,   30, "Write CR14."),
    193     EXIT_REASON(SVM_EXIT_WRITE_CR15   ,   31, "Write CR15."),
    194     EXIT_REASON(SVM_EXIT_READ_DR0     ,   32, "Read DR0."),
    195     EXIT_REASON(SVM_EXIT_READ_DR1     ,   33, "Read DR1."),
    196     EXIT_REASON(SVM_EXIT_READ_DR2     ,   34, "Read DR2."),
    197     EXIT_REASON(SVM_EXIT_READ_DR3     ,   35, "Read DR3."),
    198     EXIT_REASON(SVM_EXIT_READ_DR4     ,   36, "Read DR4."),
    199     EXIT_REASON(SVM_EXIT_READ_DR5     ,   37, "Read DR5."),
    200     EXIT_REASON(SVM_EXIT_READ_DR6     ,   38, "Read DR6."),
    201     EXIT_REASON(SVM_EXIT_READ_DR7     ,   39, "Read DR7."),
    202     EXIT_REASON(SVM_EXIT_READ_DR8     ,   40, "Read DR8."),
    203     EXIT_REASON(SVM_EXIT_READ_DR9     ,   41, "Read DR9."),
    204     EXIT_REASON(SVM_EXIT_READ_DR10    ,   42, "Read DR10."),
    205     EXIT_REASON(SVM_EXIT_READ_DR11    ,   43, "Read DR11"),
    206     EXIT_REASON(SVM_EXIT_READ_DR12    ,   44, "Read DR12."),
    207     EXIT_REASON(SVM_EXIT_READ_DR13    ,   45, "Read DR13."),
    208     EXIT_REASON(SVM_EXIT_READ_DR14    ,   46, "Read DR14."),
    209     EXIT_REASON(SVM_EXIT_READ_DR15    ,   47, "Read DR15."),
    210     EXIT_REASON(SVM_EXIT_WRITE_DR0    ,   48, "Write DR0."),
    211     EXIT_REASON(SVM_EXIT_WRITE_DR1    ,   49, "Write DR1."),
    212     EXIT_REASON(SVM_EXIT_WRITE_DR2    ,   50, "Write DR2."),
    213     EXIT_REASON(SVM_EXIT_WRITE_DR3    ,   51, "Write DR3."),
    214     EXIT_REASON(SVM_EXIT_WRITE_DR4    ,   52, "Write DR4."),
    215     EXIT_REASON(SVM_EXIT_WRITE_DR5    ,   53, "Write DR5."),
    216     EXIT_REASON(SVM_EXIT_WRITE_DR6    ,   54, "Write DR6."),
    217     EXIT_REASON(SVM_EXIT_WRITE_DR7    ,   55, "Write DR7."),
    218     EXIT_REASON(SVM_EXIT_WRITE_DR8    ,   56, "Write DR8."),
    219     EXIT_REASON(SVM_EXIT_WRITE_DR9    ,   57, "Write DR9."),
    220     EXIT_REASON(SVM_EXIT_WRITE_DR10   ,   58, "Write DR10."),
    221     EXIT_REASON(SVM_EXIT_WRITE_DR11   ,   59, "Write DR11."),
    222     EXIT_REASON(SVM_EXIT_WRITE_DR12   ,   60, "Write DR12."),
    223     EXIT_REASON(SVM_EXIT_WRITE_DR13   ,   61, "Write DR13."),
    224     EXIT_REASON(SVM_EXIT_WRITE_DR14   ,   62, "Write DR14."),
    225     EXIT_REASON(SVM_EXIT_WRITE_DR15   ,   63, "Write DR15."),
    226     EXIT_REASON(SVM_EXIT_XCPT_0       ,   64, "Exception 0  (#DE)."),
    227     EXIT_REASON(SVM_EXIT_XCPT_1       ,   65, "Exception 1  (#DB)."),
    228     EXIT_REASON(SVM_EXIT_XCPT_2       ,   66, "Exception 2  (#NMI)."),
    229     EXIT_REASON(SVM_EXIT_XCPT_3       ,   67, "Exception 3  (#BP)."),
    230     EXIT_REASON(SVM_EXIT_XCPT_4       ,   68, "Exception 4  (#OF)."),
    231     EXIT_REASON(SVM_EXIT_XCPT_5       ,   69, "Exception 5  (#BR)."),
    232     EXIT_REASON(SVM_EXIT_XCPT_6       ,   70, "Exception 6  (#UD)."),
    233     EXIT_REASON(SVM_EXIT_XCPT_7       ,   71, "Exception 7  (#NM)."),
    234     EXIT_REASON(SVM_EXIT_XCPT_8       ,   72, "Exception 8  (#DF)."),
    235     EXIT_REASON(SVM_EXIT_XCPT_9       ,   73, "Exception 9  (#CO_SEG_OVERRUN)."),
    236     EXIT_REASON(SVM_EXIT_XCPT_10      ,   74, "Exception 10 (#TS)."),
    237     EXIT_REASON(SVM_EXIT_XCPT_11      ,   75, "Exception 11 (#NP)."),
    238     EXIT_REASON(SVM_EXIT_XCPT_12      ,   76, "Exception 12 (#SS)."),
    239     EXIT_REASON(SVM_EXIT_XCPT_13      ,   77, "Exception 13 (#GP)."),
    240     EXIT_REASON(SVM_EXIT_XCPT_14      ,   78, "Exception 14 (#PF)."),
    241     EXIT_REASON(SVM_EXIT_XCPT_15      ,   79, "Exception 15 (0x0f)."),
    242     EXIT_REASON(SVM_EXIT_XCPT_16      ,   80, "Exception 16 (#MF)."),
    243     EXIT_REASON(SVM_EXIT_XCPT_17      ,   81, "Exception 17 (#AC)."),
    244     EXIT_REASON(SVM_EXIT_XCPT_18      ,   82, "Exception 18 (#MC)."),
    245     EXIT_REASON(SVM_EXIT_XCPT_19      ,   83, "Exception 19 (#XF)."),
    246     EXIT_REASON(SVM_EXIT_XCPT_20      ,   84, "Exception 20 (#VE)."),
    247     EXIT_REASON(SVM_EXIT_XCPT_21      ,   85, "Exception 22 (0x15)."),
    248     EXIT_REASON(SVM_EXIT_XCPT_22      ,   86, "Exception 22 (0x16)."),
    249     EXIT_REASON(SVM_EXIT_XCPT_23      ,   87, "Exception 23 (0x17)."),
    250     EXIT_REASON(SVM_EXIT_XCPT_24      ,   88, "Exception 24 (0x18)."),
    251     EXIT_REASON(SVM_EXIT_XCPT_25      ,   89, "Exception 25 (0x19)."),
    252     EXIT_REASON(SVM_EXIT_XCPT_26      ,   90, "Exception 26 (0x1a)."),
    253     EXIT_REASON(SVM_EXIT_XCPT_27      ,   91, "Exception 27 (0x1b)."),
    254     EXIT_REASON(SVM_EXIT_XCPT_28      ,   92, "Exception 28 (0x1c)."),
    255     EXIT_REASON(SVM_EXIT_XCPT_29      ,   93, "Exception 29 (0x1d)."),
    256     EXIT_REASON(SVM_EXIT_XCPT_30      ,   94, "Exception 30 (#SX)."),
    257     EXIT_REASON(SVM_EXIT_XCPT_31      ,   95, "Exception 31 (0x1F)."),
    258     EXIT_REASON(SVM_EXIT_INTR         ,   96, "Physical maskable interrupt (host)."),
    259     EXIT_REASON(SVM_EXIT_NMI          ,   97, "Physical non-maskable interrupt (host)."),
    260     EXIT_REASON(SVM_EXIT_SMI          ,   98, "System management interrupt (host)."),
    261     EXIT_REASON(SVM_EXIT_INIT         ,   99, "Physical INIT signal (host)."),
    262     EXIT_REASON(SVM_EXIT_VINTR        ,  100, "Virtual interrupt-window exit."),
    263     EXIT_REASON(SVM_EXIT_CR0_SEL_WRITE,  101, "Selective CR0 Write (to bits other than CR0.TS and CR0.MP)."),
    264     EXIT_REASON(SVM_EXIT_IDTR_READ    ,  102, "Read IDTR."),
    265     EXIT_REASON(SVM_EXIT_GDTR_READ    ,  103, "Read GDTR."),
    266     EXIT_REASON(SVM_EXIT_LDTR_READ    ,  104, "Read LDTR."),
    267     EXIT_REASON(SVM_EXIT_TR_READ      ,  105, "Read TR."),
    268     EXIT_REASON(SVM_EXIT_IDTR_WRITE   ,  106, "Write IDTR."),
    269     EXIT_REASON(SVM_EXIT_GDTR_WRITE   ,  107, "Write GDTR."),
    270     EXIT_REASON(SVM_EXIT_LDTR_WRITE   ,  108, "Write LDTR."),
    271     EXIT_REASON(SVM_EXIT_TR_WRITE     ,  109, "Write TR."),
    272     EXIT_REASON(SVM_EXIT_RDTSC        ,  110, "RDTSC instruction."),
    273     EXIT_REASON(SVM_EXIT_RDPMC        ,  111, "RDPMC instruction."),
    274     EXIT_REASON(SVM_EXIT_PUSHF        ,  112, "PUSHF instruction."),
    275     EXIT_REASON(SVM_EXIT_POPF         ,  113, "POPF instruction."),
    276     EXIT_REASON(SVM_EXIT_CPUID        ,  114, "CPUID instruction."),
    277     EXIT_REASON(SVM_EXIT_RSM          ,  115, "RSM instruction."),
    278     EXIT_REASON(SVM_EXIT_IRET         ,  116, "IRET instruction."),
    279     EXIT_REASON(SVM_EXIT_SWINT        ,  117, "Software interrupt (INTn instructions)."),
    280     EXIT_REASON(SVM_EXIT_INVD         ,  118, "INVD instruction."),
    281     EXIT_REASON(SVM_EXIT_PAUSE        ,  119, "PAUSE instruction."),
    282     EXIT_REASON(SVM_EXIT_HLT          ,  120, "HLT instruction."),
    283     EXIT_REASON(SVM_EXIT_INVLPG       ,  121, "INVLPG instruction."),
    284     EXIT_REASON(SVM_EXIT_INVLPGA      ,  122, "INVLPGA instruction."),
    285     EXIT_REASON(SVM_EXIT_IOIO         ,  123, "IN/OUT/INS/OUTS instruction."),
    286     EXIT_REASON(SVM_EXIT_MSR          ,  124, "RDMSR or WRMSR access to protected MSR."),
    287     EXIT_REASON(SVM_EXIT_TASK_SWITCH  ,  125, "Task switch."),
    288     EXIT_REASON(SVM_EXIT_FERR_FREEZE  ,  126, "FERR Freeze; CPU frozen in an x87/mmx instruction waiting for interrupt."),
    289     EXIT_REASON(SVM_EXIT_SHUTDOWN     ,  127, "Shutdown."),
    290     EXIT_REASON(SVM_EXIT_VMRUN        ,  128, "VMRUN instruction."),
    291     EXIT_REASON(SVM_EXIT_VMMCALL      ,  129, "VMCALL instruction."),
    292     EXIT_REASON(SVM_EXIT_VMLOAD       ,  130, "VMLOAD instruction."),
    293     EXIT_REASON(SVM_EXIT_VMSAVE       ,  131, "VMSAVE instruction."),
    294     EXIT_REASON(SVM_EXIT_STGI         ,  132, "STGI instruction."),
    295     EXIT_REASON(SVM_EXIT_CLGI         ,  133, "CLGI instruction."),
    296     EXIT_REASON(SVM_EXIT_SKINIT       ,  134, "SKINIT instruction."),
    297     EXIT_REASON(SVM_EXIT_RDTSCP       ,  135, "RDTSCP instruction."),
    298     EXIT_REASON(SVM_EXIT_ICEBP        ,  136, "ICEBP instruction."),
    299     EXIT_REASON(SVM_EXIT_WBINVD       ,  137, "WBINVD instruction."),
    300     EXIT_REASON(SVM_EXIT_MONITOR      ,  138, "MONITOR instruction."),
    301     EXIT_REASON(SVM_EXIT_MWAIT        ,  139, "MWAIT instruction."),
    302     EXIT_REASON(SVM_EXIT_MWAIT_ARMED  ,  140, "MWAIT instruction when armed."),
    303     EXIT_REASON(SVM_EXIT_XSETBV       ,  141, "XSETBV instruction."),
    304 };
    305 /** Array index of the last valid AMD-V exit reason. */
    306 #define MAX_EXITREASON_AMDV              141
    307 
    308 /** Special exit reasons not covered in the array above. */
    309 #define SVM_EXIT_REASON_NPF                  EXIT_REASON(SVM_EXIT_NPF                , 1024, "Nested Page Fault.")
    310 #define SVM_EXIT_REASON_AVIC_INCOMPLETE_IPI  EXIT_REASON(SVM_EXIT_AVIC_INCOMPLETE_IPI, 1025, "AVIC - Incomplete IPI delivery.")
    311 #define SVM_EXIT_REASON_AVIC_NOACCEL         EXIT_REASON(SVM_EXIT_AVIC_NOACCEL       , 1026, "AVIC - Unhandled register.")
    312 
    313 /**
    314  * Gets the SVM exit reason if it's one of the reasons not present in the @c
    315  * g_apszSvmExitReasons array.
    316  *
    317  * @returns The exit reason or NULL if unknown.
    318  * @param   uExit       The exit.
    319  */
    320 DECLINLINE(const char *) hmSvmGetSpecialExitReasonDesc(uint16_t uExit)
    321 {
    322     switch (uExit)
    323     {
    324         case SVM_EXIT_NPF:                 return SVM_EXIT_REASON_NPF;
    325         case SVM_EXIT_AVIC_INCOMPLETE_IPI: return SVM_EXIT_REASON_AVIC_INCOMPLETE_IPI;
    326         case SVM_EXIT_AVIC_NOACCEL:        return SVM_EXIT_REASON_AVIC_NOACCEL;
    327     }
    328     return EXIT_REASON_NIL();
    329 }
    330 #undef EXIT_REASON_NIL
    331 #undef EXIT_REASON
    332 
    33379/** @def HMVMX_REPORT_FEAT
    33480 * Reports VT-x feature to the release log.
     
    1090836#undef HM_REG_COUNTER
    1091837
    1092         const char *const *papszDesc =
    1093             ASMIsIntelCpu() || ASMIsViaCentaurCpu() || ASMIsShanghaiCpu()
    1094             ? &g_apszVmxExitReasons[0]
    1095             : &g_apszSvmExitReasons[0];
     838        bool const fCpuSupportsVmx = ASMIsIntelCpu() || ASMIsViaCentaurCpu() || ASMIsShanghaiCpu();
    1096839
    1097840        /*
     
    1102845                          (void **)&pVCpu->hm.s.paStatExitReason);
    1103846        AssertRCReturn(rc, rc);
    1104         for (int j = 0; j < MAX_EXITREASON_STAT; j++)
     847
     848        if (fCpuSupportsVmx)
    1105849        {
    1106             if (papszDesc[j])
     850            for (int j = 0; j < MAX_EXITREASON_STAT; j++)
    1107851            {
    1108                 rc = STAMR3RegisterF(pVM, &pVCpu->hm.s.paStatExitReason[j], STAMTYPE_COUNTER, STAMVISIBILITY_USED,
    1109                                      STAMUNIT_OCCURENCES, papszDesc[j], "/HM/CPU%d/Exit/Reason/%02x", i, j);
    1110                 AssertRCReturn(rc, rc);
     852                const char *pszExitName = HMGetVmxExitName(j);
     853                if (pszExitName)
     854                {
     855                    rc = STAMR3RegisterF(pVM, &pVCpu->hm.s.paStatExitReason[j], STAMTYPE_COUNTER, STAMVISIBILITY_USED,
     856                                         STAMUNIT_OCCURENCES, pszExitName, "/HM/CPU%d/Exit/Reason/%02x", i, j);
     857                    AssertRCReturn(rc, rc);
     858                }
     859            }
     860        }
     861        else
     862        {
     863            for (int j = 0; j < MAX_EXITREASON_STAT; j++)
     864            {
     865                const char *pszExitName = HMGetSvmExitName(j);
     866                if (pszExitName)
     867                {
     868                    rc = STAMR3RegisterF(pVM, &pVCpu->hm.s.paStatExitReason[j], STAMTYPE_COUNTER, STAMVISIBILITY_USED,
     869                                         STAMUNIT_OCCURENCES, pszExitName, "/HM/CPU%d/Exit/Reason/%02x", i, j);
     870                    AssertRCReturn(rc, rc);
     871                }
    1111872            }
    1112873        }
     
    1121882# endif
    1122883
    1123 #ifdef VBOX_WITH_NESTED_HWVIRT_SVM
     884#if defined(VBOX_WITH_NESTED_HWVIRT_SVM) || defined(VBOX_WITH_NESTED_HWVIRT_VMX)
    1124885        /*
    1125          * Nested-guest Exit reason stats.
     886         * Nested-guest VM-exit reason stats.
    1126887         */
    1127888        pVCpu->hm.s.paStatNestedExitReason = NULL;
     
    1129890                          (void **)&pVCpu->hm.s.paStatNestedExitReason);
    1130891        AssertRCReturn(rc, rc);
    1131         for (int j = 0; j < MAX_EXITREASON_STAT; j++)
     892        if (fCpuSupportsVmx)
    1132893        {
    1133             if (papszDesc[j])
     894            for (int j = 0; j < MAX_EXITREASON_STAT; j++)
    1134895            {
    1135                 rc = STAMR3RegisterF(pVM, &pVCpu->hm.s.paStatNestedExitReason[j], STAMTYPE_COUNTER, STAMVISIBILITY_USED,
    1136                                      STAMUNIT_OCCURENCES, papszDesc[j], "/HM/CPU%d/NestedExit/Reason/%02x", i, j);
    1137                 AssertRC(rc);
     896                const char *pszExitName = HMGetVmxExitName(j);
     897                if (pszExitName)
     898                {
     899                    rc = STAMR3RegisterF(pVM, &pVCpu->hm.s.paStatNestedExitReason[j], STAMTYPE_COUNTER, STAMVISIBILITY_USED,
     900                                         STAMUNIT_OCCURENCES, pszExitName, "/HM/CPU%d/NestedExit/Reason/%02x", i, j);
     901                    AssertRC(rc);
     902                }
     903            }
     904        }
     905        else
     906        {
     907            for (int j = 0; j < MAX_EXITREASON_STAT; j++)
     908            {
     909                const char *pszExitName = HMGetSvmExitName(j);
     910                if (pszExitName)
     911                {
     912                    rc = STAMR3RegisterF(pVM, &pVCpu->hm.s.paStatNestedExitReason[j], STAMTYPE_COUNTER, STAMVISIBILITY_USED,
     913                                         STAMUNIT_OCCURENCES, pszExitName, "/HM/CPU%d/NestedExit/Reason/%02x", i, j);
     914                    AssertRC(rc);
     915                }
    1138916            }
    1139917        }
     
    19811759    uint32_t u32Model;
    19821760    uint32_t u32Stepping;
    1983     if (HMSvmIsSubjectToErratum170(&u32Family, &u32Model, &u32Stepping))
     1761    if (HMIsSubjectToSvmErratum170(&u32Family, &u32Model, &u32Stepping))
    19841762        LogRel(("HM: AMD Cpu with erratum 170 family %#x model %#x stepping %#x\n", u32Family, u32Model, u32Stepping));
    19851763    LogRel(("HM: Max resume loops                  = %u\n",     pVM->hm.s.cMaxResumeLoops));
     
    34433221
    34443222/**
    3445  * Gets the name of a VT-x exit code.
    3446  *
    3447  * @returns Pointer to read only string if @a uExit is known, otherwise NULL.
    3448  * @param   uExit               The VT-x exit to name.
    3449  */
    3450 VMMR3DECL(const char *) HMR3GetVmxExitName(uint32_t uExit)
    3451 {
    3452     if (uExit < RT_ELEMENTS(g_apszVmxExitReasons))
    3453         return g_apszVmxExitReasons[uExit];
    3454     return NULL;
    3455 }
    3456 
    3457 
    3458 /**
    3459  * Gets the name of an AMD-V exit code.
    3460  *
    3461  * @returns Pointer to read only string if @a uExit is known, otherwise NULL.
    3462  * @param   uExit               The AMD-V exit to name.
    3463  */
    3464 VMMR3DECL(const char *) HMR3GetSvmExitName(uint32_t uExit)
    3465 {
    3466     if (uExit < RT_ELEMENTS(g_apszSvmExitReasons))
    3467         return g_apszSvmExitReasons[uExit];
    3468     return hmSvmGetSpecialExitReasonDesc(uExit);
    3469 }
    3470 
    3471 
    3472 /**
    34733223 * Displays HM info.
    34743224 *
  • trunk/src/VBox/VMM/VMMR3/PGM.cpp

    r76553 r76993  
    21812181            VMCPU_FF_SET(pVCpu, VMCPU_FF_PGM_SYNC_CR3);
    21822182            pgmR3RefreshShadowModeAfterA20Change(pVCpu);
    2183             HMFlushTLB(pVCpu);
     2183            HMFlushTlb(pVCpu);
    21842184#endif
    21852185        }
  • trunk/src/VBox/VMM/VMMR3/PGMPhys.cpp

    r76553 r76993  
    45744574        VMCPU_FF_SET(pVCpu, VMCPU_FF_PGM_SYNC_CR3);
    45754575        pgmR3RefreshShadowModeAfterA20Change(pVCpu);
    4576         HMFlushTLB(pVCpu);
     4576        HMFlushTlb(pVCpu);
    45774577#endif
    45784578        IEMTlbInvalidateAllPhysical(pVCpu);
  • trunk/src/VBox/VMM/include/PGMInternal.h

    r76585 r76993  
    418418# define PGM_INVL_BIG_PG(pVCpu, GCVirt)         ASMReloadCR3()
    419419#elif defined(IN_RING0)
    420 # define PGM_INVL_BIG_PG(pVCpu, GCVirt)         HMFlushTLB(pVCpu)
     420# define PGM_INVL_BIG_PG(pVCpu, GCVirt)         HMFlushTlb(pVCpu)
    421421#else
    422 # define PGM_INVL_BIG_PG(pVCpu, GCVirt)         HMFlushTLB(pVCpu)
     422# define PGM_INVL_BIG_PG(pVCpu, GCVirt)         HMFlushTlb(pVCpu)
    423423#endif
    424424
     
    431431# define PGM_INVL_VCPU_TLBS(pVCpu)             ASMReloadCR3()
    432432#elif defined(IN_RING0)
    433 # define PGM_INVL_VCPU_TLBS(pVCpu)             HMFlushTLB(pVCpu)
     433# define PGM_INVL_VCPU_TLBS(pVCpu)             HMFlushTlb(pVCpu)
    434434#else
    435 # define PGM_INVL_VCPU_TLBS(pVCpu)             HMFlushTLB(pVCpu)
     435# define PGM_INVL_VCPU_TLBS(pVCpu)             HMFlushTlb(pVCpu)
    436436#endif
    437437
     
    444444# define PGM_INVL_ALL_VCPU_TLBS(pVM)            ASMReloadCR3()
    445445#elif defined(IN_RING0)
    446 # define PGM_INVL_ALL_VCPU_TLBS(pVM)            HMFlushTLBOnAllVCpus(pVM)
     446# define PGM_INVL_ALL_VCPU_TLBS(pVM)            HMFlushTlbOnAllVCpus(pVM)
    447447#else
    448 # define PGM_INVL_ALL_VCPU_TLBS(pVM)            HMFlushTLBOnAllVCpus(pVM)
     448# define PGM_INVL_ALL_VCPU_TLBS(pVM)            HMFlushTlbOnAllVCpus(pVM)
    449449#endif
    450450
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