Changeset 76993 in vbox
- Timestamp:
- Jan 25, 2019 2:34:46 PM (6 years ago)
- Location:
- trunk
- Files:
-
- 21 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/VBox/vmm/hm.h
r76821 r76993 137 137 VMM_INT_DECL(bool) HMIsSvmActive(PVM pVM); 138 138 VMM_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); 139 VMM_INT_DECL(const char *) HMGetVmxDiagDesc(VMXVDIAG enmDiag); 140 VMM_INT_DECL(const char *) HMGetVmxAbortDesc(VMXABORT enmAbort); 141 VMM_INT_DECL(const char *) HMGetVmxVmcsStateDesc(uint8_t fVmcsState); 142 VMM_INT_DECL(const char *) HMGetVmxIdtVectoringInfoTypeDesc(uint8_t uType); 143 VMM_INT_DECL(const char *) HMGetVmxExitIntInfoTypeDesc(uint8_t uType); 144 VMM_INT_DECL(const char *) HMGetVmxEntryIntInfoTypeDesc(uint8_t uType); 145 VMM_INT_DECL(const char *) HMGetVmxExitName(uint32_t uExit); 146 VMM_INT_DECL(const char *) HMGetSvmExitName(uint32_t uExit); 147 VMM_INT_DECL(void) HMDumpHwvirtVmxState(PVMCPU pVCpu); 148 VMM_INT_DECL(void) HMHCChangedPagingMode(PVM pVM, PVMCPU pVCpu, PGMMODE enmShadowMode, PGMMODE enmGuestMode); 149 VMM_INT_DECL(void) HMGetVmxMsrsFromHwvirtMsrs(PCSUPHWVIRTMSRS pMsrs, PVMXMSRS pVmxMsrs); 150 VMM_INT_DECL(void) HMGetSvmMsrsFromHwvirtMsrs(PCSUPHWVIRTMSRS pMsrs, PSVMMSRS pSvmMsrs); 149 151 /** @} */ 150 152 … … 155 157 * found in CPUM. 156 158 * @{ */ 157 VMM_INT_DECL(bool) HM VmxCanExecuteGuest(PVMCPU pVCpu, PCCPUMCTX pCtx);159 VMM_INT_DECL(bool) HMCanExecuteVmxGuest(PVMCPU pVCpu, PCCPUMCTX pCtx); 158 160 /** @} */ 159 161 … … 171 173 /** @name R0, R3 HM (VMX/SVM agnostic) handlers. 172 174 * @{ */ 173 VMM_INT_DECL(int) HMFlushT LB(PVMCPU pVCpu);174 VMM_INT_DECL(int) HMFlushT LBOnAllVCpus(PVM pVM);175 VMM_INT_DECL(int) HMFlushTlb(PVMCPU pVCpu); 176 VMM_INT_DECL(int) HMFlushTlbOnAllVCpus(PVM pVM); 175 177 VMM_INT_DECL(int) HMInvalidatePageOnAllVCpus(PVM pVM, RTGCPTR GCVirt); 176 178 VMM_INT_DECL(int) HMInvalidatePhysPage(PVM pVM, RTGCPHYS GCPhys); … … 183 185 /** @name R0, R3 SVM handlers. 184 186 * @{ */ 185 VMM_INT_DECL(bool) HM SvmIsVGifActive(PVM pVM);186 VMM_INT_DECL(uint64_t) HM SvmNstGstApplyTscOffset(PVMCPU pVCpu, uint64_t uTicks);187 VMM_INT_DECL(bool) HMIsSvmVGifActive(PVM pVM); 188 VMM_INT_DECL(uint64_t) HMApplySvmNstGstTscOffset(PVMCPU pVCpu, uint64_t uTicks); 187 189 # ifdef VBOX_WITH_NESTED_HWVIRT_SVM 188 VMM_INT_DECL(void) HM SvmNstGstVmExitNotify(PVMCPU pVCpu, PCPUMCTX pCtx);190 VMM_INT_DECL(void) HMNotifySvmNstGstVmexit(PVMCPU pVCpu, PCPUMCTX pCtx); 189 191 # endif 190 VMM_INT_DECL(int) HM SvmIsSubjectToErratum170(uint32_t *pu32Family, uint32_t *pu32Model, uint32_t *pu32Stepping);191 VMM_INT_DECL(int) HMHC SvmMaybeMovTprHypercall(PVMCPU pVCpu);192 VMM_INT_DECL(int) HMIsSubjectToSvmErratum170(uint32_t *pu32Family, uint32_t *pu32Model, uint32_t *pu32Stepping); 193 VMM_INT_DECL(int) HMHCMaybeMovTprSvmHypercall(PVMCPU pVCpu); 192 194 /** @} */ 193 195 … … 196 198 /** @name RC HM (VMX/SVM agnostic) handlers. 197 199 * @{ */ 198 # define HMFlushT LB(pVCpu) do { } while (0)199 # define HMFlushT LBOnAllVCpus(pVM) do { } while (0)200 # define HMFlushTlb(pVCpu) do { } while (0) 201 # define HMFlushTlbOnAllVCpus(pVM) do { } while (0) 200 202 # define HMInvalidatePageOnAllVCpus(pVM, GCVirt) do { } while (0) 201 203 # define HMInvalidatePhysPage(pVM, GCVirt) do { } while (0) … … 208 210 /** @name RC SVM handlers. 209 211 * @{ */ 210 # define HM SvmIsVGifActive(pVM) false211 # define HM SvmNstGstApplyTscOffset(pVCpu, uTicks) (uTicks)212 # define HM SvmNstGstVmExitNotify(pVCpu, pCtx) do { } while (0)213 # define HM SvmIsSubjectToErratum170(puFamily, puModel, puStepping) false214 # define HMHC SvmMaybeMovTprHypercall(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) 215 217 /** @} */ 216 218 … … 281 283 VMMR3_INT_DECL(bool) HMR3IsRescheduleRequired(PVM pVM, PCPUMCTX pCtx); 282 284 VMMR3_INT_DECL(bool) HMR3IsVmxPreemptionTimerUsed(PVM pVM); 283 VMMR3DECL(const char *) HMR3GetVmxExitName(uint32_t uExit);284 VMMR3DECL(const char *) HMR3GetSvmExitName(uint32_t uExit);285 285 /** @} */ 286 286 #endif /* IN_RING3 */ -
trunk/include/VBox/vmm/hm_svm.h
r76585 r76993 1162 1162 * @{ 1163 1163 */ 1164 VMM_INT_DECL(int) HM SvmGetMsrpmOffsetAndBit(uint32_t idMsr, uint16_t *pbOffMsrpm, uint8_t *puMsrpmBit);1165 VMM_INT_DECL(bool) HM SvmIsIOInterceptActive(void *pvIoBitmap, uint16_t u16Port, SVMIOIOTYPE enmIoType, uint8_t cbReg,1164 VMM_INT_DECL(int) HMGetSvmMsrpmOffsetAndBit(uint32_t idMsr, uint16_t *pbOffMsrpm, uint8_t *puMsrpmBit); 1165 VMM_INT_DECL(bool) HMIsSvmIoInterceptActive(void *pvIoBitmap, uint16_t u16Port, SVMIOIOTYPE enmIoType, uint8_t cbReg, 1166 1166 uint8_t cAddrSizeBits, uint8_t iEffSeg, bool fRep, bool fStrIo, 1167 1167 PSVMIOIOEXITINFO pIoExitInfo); -
trunk/include/VBox/vmm/hm_vmx.h
r76827 r76993 1400 1400 /** @name VMX abort reasons. 1401 1401 * See Intel spec. "27.7 VMX Aborts". 1402 * Update HMVmxGetAbortDesc() if new reasons are added. 1403 * @{ 1402 * Update HMGetVmxAbortDesc() if new reasons are added. @{ 1404 1403 */ 1405 1404 typedef enum … … 4094 4093 * @{ 4095 4094 */ 4096 VMM_INT_DECL(int) HM VmxGetMsrPermission(void const *pvMsrBitmap, uint32_t idMsr, PVMXMSREXITREAD penmRead,4095 VMM_INT_DECL(int) HMGetVmxMsrPermission(void const *pvMsrBitmap, uint32_t idMsr, PVMXMSREXITREAD penmRead, 4097 4096 PVMXMSREXITWRITE penmWrite); 4098 VMM_INT_DECL(bool) HM VmxGetIoBitmapPermission(void const *pvIoBitmapA, void const *pvIoBitmapB, uint16_t uPort,4097 VMM_INT_DECL(bool) HMGetVmxIoBitmapPermission(void const *pvIoBitmapA, void const *pvIoBitmapB, uint16_t uPort, 4099 4098 uint8_t cbAccess); 4100 4099 /** @} */ -
trunk/src/VBox/VMM/VMMAll/CPUMAllMsrs.cpp
r76678 r76993 6248 6248 { 6249 6249 /// @todo PGMFlushTLB(pVCpu, cr3, true /*fGlobal*/); 6250 HMFlushT LB(pVCpu);6250 HMFlushTlb(pVCpu); 6251 6251 6252 6252 /* Notify PGM about NXE changes. */ -
trunk/src/VBox/VMM/VMMAll/CPUMAllRegs.cpp
r76553 r76993 2985 2985 * @param uTicks The guest TSC. 2986 2986 * 2987 * @sa HM SvmNstGstApplyTscOffset.2987 * @sa HMApplySvmNstGstTscOffset. 2988 2988 */ 2989 2989 VMM_INT_DECL(uint64_t) CPUMApplyNestedGuestTscOffset(PVMCPU pVCpu, uint64_t uTicks) … … 3006 3006 return uTicks + pVmcb->ctrl.u64TSCOffset; 3007 3007 } 3008 return HM SvmNstGstApplyTscOffset(pVCpu, uTicks);3008 return HMApplySvmNstGstTscOffset(pVCpu, uTicks); 3009 3009 } 3010 3010 #else -
trunk/src/VBox/VMM/VMMAll/HMAll.cpp
r76797 r76993 39 39 40 40 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. */ 49 static 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(). */ 126 static 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 */ 286 DECLINLINE(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 41 300 /** 42 301 * Checks whether HM (VT-x/AMD-V) is being used by this VM. … … 86 345 } 87 346 88 return HM VmxCanExecuteGuest(pVCpu, pCtx);347 return HMCanExecuteVmxGuest(pVCpu, pCtx); 89 348 } 90 349 … … 192 451 * @param pVCpu The cross context virtual CPU structure. 193 452 */ 194 VMM_INT_DECL(int) HMFlushT LB(PVMCPU pVCpu)195 { 196 LogFlow(("HMFlushT LB\n"));453 VMM_INT_DECL(int) HMFlushTlb(PVMCPU pVCpu) 454 { 455 LogFlow(("HMFlushTlb\n")); 197 456 198 457 VMCPU_FF_SET(pVCpu, VMCPU_FF_TLB_FLUSH); … … 277 536 * @param pVM The cross context VM structure. 278 537 */ 279 VMM_INT_DECL(int) HMFlushT LBOnAllVCpus(PVM pVM)538 VMM_INT_DECL(int) HMFlushTlbOnAllVCpus(PVM pVM) 280 539 { 281 540 if (pVM->cCpus == 1) 282 return HMFlushT LB(&pVM->aCpus[0]);541 return HMFlushTlb(&pVM->aCpus[0]); 283 542 284 543 VMCPUID idThisCpu = VMMGetCpuId(pVM); … … 331 590 /** @todo Remove or figure out to way to update the Phys STAT counter. */ 332 591 /* STAM_COUNTER_INC(&pVCpu->hm.s.StatFlushTlbInvlpgPhys); */ 333 return HMFlushT LBOnAllVCpus(pVM);592 return HMFlushTlbOnAllVCpus(pVM); 334 593 } 335 594 … … 429 688 VMM_INT_DECL(bool) HMIsVmxActive(PVM pVM) 430 689 { 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); 446 691 } 447 692 … … 537 782 * @param enmGuestMode New guest paging mode. 538 783 */ 539 VMM_INT_DECL(void) HMHC PagingModeChanged(PVM pVM, PVMCPU pVCpu, PGMMODE enmShadowMode, PGMMODE enmGuestMode)784 VMM_INT_DECL(void) HMHCChangedPagingMode(PVM pVM, PVMCPU pVCpu, PGMMODE enmShadowMode, PGMMODE enmGuestMode) 540 785 { 541 786 # ifdef IN_RING3 … … 572 817 # endif 573 818 574 Log4(("HMHC PagingModeChanged: 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), 575 820 PGMGetModeName(enmShadowMode))); 576 821 } … … 587 832 * @param pVmxMsrs Where to store the VMX MSRs. 588 833 */ 589 VMM_INT_DECL(void) HM VmxGetVmxMsrsFromHwvirtMsrs(PCSUPHWVIRTMSRS pHwvirtMsrs, PVMXMSRS pVmxMsrs)834 VMM_INT_DECL(void) HMGetVmxMsrsFromHwvirtMsrs(PCSUPHWVIRTMSRS pHwvirtMsrs, PVMXMSRS pVmxMsrs) 590 835 { 591 836 AssertReturnVoid(pHwvirtMsrs); … … 622 867 * @param pSvmMsrs Where to store the SVM MSRs. 623 868 */ 624 VMM_INT_DECL(void) HM VmxGetSvmMsrsFromHwvirtMsrs(PCSUPHWVIRTMSRS pHwvirtMsrs, PSVMMSRS pSvmMsrs)869 VMM_INT_DECL(void) HMGetSvmMsrsFromHwvirtMsrs(PCSUPHWVIRTMSRS pHwvirtMsrs, PSVMMSRS pSvmMsrs) 625 870 { 626 871 AssertReturnVoid(pHwvirtMsrs); … … 629 874 } 630 875 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 */ 883 VMM_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 */ 900 VMM_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 130 130 * @sa hmR0SvmVmRunCacheVmcb. 131 131 */ 132 VMM_INT_DECL(void) HM SvmNstGstVmExitNotify(PVMCPU pVCpu, PCPUMCTX pCtx)132 VMM_INT_DECL(void) HMNotifySvmNstGstVmexit(PVMCPU pVCpu, PCPUMCTX pCtx) 133 133 { 134 134 PSVMNESTEDVMCBCACHE pVmcbNstGstCache = &pVCpu->hm.s.svm.NstGstVmcbCache; … … 184 184 * to change throughout the lifetime of the VM. 185 185 */ 186 VMM_INT_DECL(bool) HM SvmIsVGifActive(PVM pVM)186 VMM_INT_DECL(bool) HMIsSvmVGifActive(PVM pVM) 187 187 { 188 188 bool const fVGif = RT_BOOL(pVM->hm.s.svm.u32Features & X86_CPUID_SVM_FEATURE_EDX_VGIF); … … 209 209 * @sa CPUMApplyNestedGuestTscOffset(), hmR0SvmNstGstUndoTscOffset(). 210 210 */ 211 VMM_INT_DECL(uint64_t) HM SvmNstGstApplyTscOffset(PVMCPU pVCpu, uint64_t uTicks)211 VMM_INT_DECL(uint64_t) HMApplySvmNstGstTscOffset(PVMCPU pVCpu, uint64_t uTicks) 212 212 { 213 213 PCCPUMCTX pCtx = &pVCpu->cpum.GstCtx; … … 229 229 * @param pVCpu The cross context virtual CPU structure. 230 230 */ 231 VMM_INT_DECL(int) HMHC SvmMaybeMovTprHypercall(PVMCPU pVCpu)231 VMM_INT_DECL(int) HMHCMaybeMovTprSvmHypercall(PVMCPU pVCpu) 232 232 { 233 233 PVM pVM = pVCpu->CTX_SUFF(pVM); … … 252 252 * @returns true if the erratum applies, false otherwise. 253 253 */ 254 VMM_INT_DECL(int) HM SvmIsSubjectToErratum170(uint32_t *pu32Family, uint32_t *pu32Model, uint32_t *pu32Stepping)254 VMM_INT_DECL(int) HMIsSubjectToSvmErratum170(uint32_t *pu32Family, uint32_t *pu32Model, uint32_t *pu32Stepping) 255 255 { 256 256 /* … … 308 308 * returned in @a pbOffMsrpm. 309 309 */ 310 VMM_INT_DECL(int) HM SvmGetMsrpmOffsetAndBit(uint32_t idMsr, uint16_t *pbOffMsrpm, uint8_t *puMsrpmBit)310 VMM_INT_DECL(int) HMGetSvmMsrpmOffsetAndBit(uint32_t idMsr, uint16_t *pbOffMsrpm, uint8_t *puMsrpmBit) 311 311 { 312 312 Assert(pbOffMsrpm); … … 372 372 * Optional, can be NULL. 373 373 */ 374 VMM_INT_DECL(bool) HM SvmIsIOInterceptActive(void *pvIoBitmap, uint16_t u16Port, SVMIOIOTYPE enmIoType, uint8_t cbReg,374 VMM_INT_DECL(bool) HMIsSvmIoInterceptActive(void *pvIoBitmap, uint16_t u16Port, SVMIOIOTYPE enmIoType, uint8_t cbReg, 375 375 uint8_t cAddrSizeBits, uint8_t iEffSeg, bool fRep, bool fStrIo, 376 376 PSVMIOIOEXITINFO pIoExitInfo) -
trunk/src/VBox/VMM/VMMAll/HMVMXAll.cpp
r76888 r76993 370 370 * @param enmDiag The VMX diagnostic. 371 371 */ 372 VMM_INT_DECL(const char *) HM VmxGetDiagDesc(VMXVDIAG enmDiag)372 VMM_INT_DECL(const char *) HMGetVmxDiagDesc(VMXVDIAG enmDiag) 373 373 { 374 374 if (RT_LIKELY((unsigned)enmDiag < RT_ELEMENTS(g_apszVmxVDiagDesc))) … … 384 384 * @param enmAbort The VMX abort reason. 385 385 */ 386 VMM_INT_DECL(const char *) HM VmxGetAbortDesc(VMXABORT enmAbort)386 VMM_INT_DECL(const char *) HMGetVmxAbortDesc(VMXABORT enmAbort) 387 387 { 388 388 switch (enmAbort) … … 408 408 * @param fVmcsState The virtual-VMCS state. 409 409 */ 410 VMM_INT_DECL(const char *) HM VmxGetVmcsStateDesc(uint8_t fVmcsState)410 VMM_INT_DECL(const char *) HMGetVmxVmcsStateDesc(uint8_t fVmcsState) 411 411 { 412 412 switch (fVmcsState) … … 425 425 * @param uType The event type. 426 426 */ 427 VMM_INT_DECL(const char *) HM VmxGetEntryIntInfoTypeDesc(uint8_t uType)427 VMM_INT_DECL(const char *) HMGetVmxEntryIntInfoTypeDesc(uint8_t uType) 428 428 { 429 429 switch (uType) … … 449 449 * @param uType The event type. 450 450 */ 451 VMM_INT_DECL(const char *) HM VmxGetExitIntInfoTypeDesc(uint8_t uType)451 VMM_INT_DECL(const char *) HMGetVmxExitIntInfoTypeDesc(uint8_t uType) 452 452 { 453 453 switch (uType) … … 472 472 * @param uType The event type. 473 473 */ 474 VMM_INT_DECL(const char *) HM VmxGetIdtVectoringInfoTypeDesc(uint8_t uType)474 VMM_INT_DECL(const char *) HMGetVmxIdtVectoringInfoTypeDesc(uint8_t uType) 475 475 { 476 476 switch (uType) … … 649 649 * state, make sure REM (which supplies a partial state) is updated. 650 650 */ 651 VMM_INT_DECL(bool) HM VmxCanExecuteGuest(PVMCPU pVCpu, PCCPUMCTX pCtx)651 VMM_INT_DECL(bool) HMCanExecuteVmxGuest(PVMCPU pVCpu, PCCPUMCTX pCtx) 652 652 { 653 653 PVM pVM = pVCpu->CTX_SUFF(pVM); … … 831 831 * NULL. 832 832 */ 833 VMM_INT_DECL(int) HM VmxGetMsrPermission(void const *pvMsrBitmap, uint32_t idMsr, PVMXMSREXITREAD penmRead,833 VMM_INT_DECL(int) HMGetVmxMsrPermission(void const *pvMsrBitmap, uint32_t idMsr, PVMXMSREXITREAD penmRead, 834 834 PVMXMSREXITWRITE penmWrite) 835 835 { … … 906 906 * @param cbAccess The size of the I/O access in bytes (1, 2 or 4 bytes). 907 907 */ 908 VMM_INT_DECL(bool) HM VmxGetIoBitmapPermission(void const *pvIoBitmapA, void const *pvIoBitmapB, uint16_t uPort,908 VMM_INT_DECL(bool) HMGetVmxIoBitmapPermission(void const *pvIoBitmapA, void const *pvIoBitmapB, uint16_t uPort, 909 909 uint8_t cbAccess) 910 910 { … … 929 929 } 930 930 931 932 /** 933 * Dumps the virtual VMCS state to the release log. 934 * 935 * @param pVCpu The cross context virtual CPU structure. 936 */ 937 VMM_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 160 160 * writing the VMCB back to guest memory. 161 161 */ 162 HM SvmNstGstVmExitNotify(pVCpu, IEM_GET_CTX(pVCpu));162 HMNotifySvmNstGstVmexit(pVCpu, IEM_GET_CTX(pVCpu)); 163 163 164 164 Assert(CPUMSELREG_ARE_HIDDEN_PARTS_VALID(pVCpu, &pVCpu->cpum.GstCtx.es)); … … 341 341 /* CLGI/STGI may not have been intercepted and thus not executed in IEM. */ 342 342 if ( HMIsEnabled(pVCpu->CTX_SUFF(pVM)) 343 && HM SvmIsVGifActive(pVCpu->CTX_SUFF(pVM)))343 && HMIsSvmVGifActive(pVCpu->CTX_SUFF(pVM))) 344 344 return EMR3SetExecutionPolicy(pVCpu->CTX_SUFF(pVM)->pUVM, EMEXECPOLICY_IEM_ALL, false); 345 345 # endif … … 842 842 /* If CLGI/STGI isn't intercepted we force IEM-only nested-guest execution here. */ 843 843 if ( HMIsEnabled(pVM) 844 && HM SvmIsVGifActive(pVM))844 && HMIsSvmVGifActive(pVM)) 845 845 return EMR3SetExecutionPolicy(pVCpu->CTX_SUFF(pVM)->pUVM, EMEXECPOLICY_IEM_ALL, true); 846 846 # endif … … 990 990 SVMIOIOEXITINFO IoExitInfo; 991 991 void *pvIoBitmap = pVCpu->cpum.GstCtx.hwvirt.svm.CTX_SUFF(pvIoBitmap); 992 bool const fIntercept = HM SvmIsIOInterceptActive(pvIoBitmap, u16Port, enmIoType, cbReg, cAddrSizeBits, iEffSeg, fRep,992 bool const fIntercept = HMIsSvmIoInterceptActive(pvIoBitmap, u16Port, enmIoType, cbReg, cAddrSizeBits, iEffSeg, fRep, 993 993 fStrIo, &IoExitInfo); 994 994 if (fIntercept) … … 1039 1039 uint16_t offMsrpm; 1040 1040 uint8_t uMsrpmBit; 1041 int rc = HM SvmGetMsrpmOffsetAndBit(idMsr, &offMsrpm, &uMsrpmBit);1041 int rc = HMGetSvmMsrpmOffsetAndBit(idMsr, &offMsrpm, &uMsrpmBit); 1042 1042 if (RT_SUCCESS(rc)) 1043 1043 { … … 1417 1417 if (VM_IS_HM_ENABLED(pVCpu->CTX_SUFF(pVM))) 1418 1418 { 1419 int rc = HMHC SvmMaybeMovTprHypercall(pVCpu);1419 int rc = HMHCMaybeMovTprSvmHypercall(pVCpu); 1420 1420 if (RT_SUCCESS(rc)) 1421 1421 { -
trunk/src/VBox/VMM/VMMAll/IEMAllCImplVmxInstr.cpp.h
r76952 r76993 148 148 { \ 149 149 Log(("%s: VM-entry failed! enmDiag=%u (%s) -> %s\n", (a_pszInstr), (a_VmxDiag), \ 150 HM VmxGetDiagDesc(a_VmxDiag), (a_pszFailure))); \150 HMGetVmxDiagDesc(a_VmxDiag), (a_pszFailure))); \ 151 151 (a_pVCpu)->cpum.GstCtx.hwvirt.vmx.enmDiag = (a_VmxDiag); \ 152 152 return VERR_VMX_VMENTRY_FAILED; \ … … 158 158 { \ 159 159 Log(("VM-exit failed! uExitReason=%u enmDiag=%u (%s) -> %s\n", (a_uExitReason), (a_VmxDiag), \ 160 HM VmxGetDiagDesc(a_VmxDiag), (a_pszFailure))); \160 HMGetVmxDiagDesc(a_VmxDiag), (a_pszFailure))); \ 161 161 (a_pVCpu)->cpum.GstCtx.hwvirt.vmx.enmDiag = (a_VmxDiag); \ 162 162 return VERR_VMX_VMEXIT_FAILED; \ … … 2039 2039 * See Intel spec. 27.7 "VMX Aborts". 2040 2040 */ 2041 LogFunc(("enmAbort=%u (%s) -> RESET\n", enmAbort, HM VmxGetAbortDesc(enmAbort)));2041 LogFunc(("enmAbort=%u (%s) -> RESET\n", enmAbort, HMGetVmxAbortDesc(enmAbort))); 2042 2042 2043 2043 /* We don't support SMX yet. */ … … 3073 3073 Assert(pbIoBitmapA); 3074 3074 Assert(pbIoBitmapB); 3075 return HM VmxGetIoBitmapPermission(pbIoBitmapA, pbIoBitmapB, u16Port, cbAccess);3075 return HMGetVmxIoBitmapPermission(pbIoBitmapA, pbIoBitmapB, u16Port, cbAccess); 3076 3076 } 3077 3077 … … 7485 7485 { 7486 7486 VMXMSREXITREAD enmRead; 7487 int rc = HM VmxGetMsrPermission(pVCpu->cpum.GstCtx.hwvirt.vmx.CTX_SUFF(pvMsrBitmap), idMsr, &enmRead,7487 int rc = HMGetVmxMsrPermission(pVCpu->cpum.GstCtx.hwvirt.vmx.CTX_SUFF(pvMsrBitmap), idMsr, &enmRead, 7488 7488 NULL /* penmWrite */); 7489 7489 AssertRC(rc); … … 7494 7494 { 7495 7495 VMXMSREXITWRITE enmWrite; 7496 int rc = HM VmxGetMsrPermission(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 */, 7497 7497 &enmWrite); 7498 7498 AssertRC(rc); -
trunk/src/VBox/VMM/VMMAll/PGMAll.cpp
r76553 r76993 3422 3422 * Notify HM. 3423 3423 */ 3424 HMHC PagingModeChanged(pVM, pVCpu, pVCpu->pgm.s.enmShadowMode, pVCpu->pgm.s.enmGuestMode);3424 HMHCChangedPagingMode(pVM, pVCpu, pVCpu->pgm.s.enmShadowMode, pVCpu->pgm.s.enmGuestMode); 3425 3425 return rc; 3426 3426 } -
trunk/src/VBox/VMM/VMMAll/PGMAllHandler.cpp
r76553 r76993 732 732 PGM_INVL_VCPU_TLBS(VMMGetCpu0(pVM)); 733 733 #else 734 HMFlushT LBOnAllVCpus(pVM);734 HMFlushTlbOnAllVCpus(pVM); 735 735 #endif 736 736 -
trunk/src/VBox/VMM/VMMR0/HMR0.cpp
r76553 r76993 1176 1176 pVM->hm.s.vmx.u64HostEfer = g_HmR0.hwvirt.u.vmx.u64HostEfer; 1177 1177 pVM->hm.s.vmx.u64HostSmmMonitorCtl = g_HmR0.hwvirt.u.vmx.u64HostSmmMonitorCtl; 1178 HM VmxGetVmxMsrsFromHwvirtMsrs(&g_HmR0.hwvirt.Msrs, &pVM->hm.s.vmx.Msrs);1178 HMGetVmxMsrsFromHwvirtMsrs(&g_HmR0.hwvirt.Msrs, &pVM->hm.s.vmx.Msrs); 1179 1179 } 1180 1180 else if (pVM->hm.s.svm.fSupported) -
trunk/src/VBox/VMM/VMMR0/HMSVMR0.cpp
r76553 r76993 712 712 uint32_t u32Model; 713 713 uint32_t u32Stepping; 714 if (HM SvmIsSubjectToErratum170(&u32Family, &u32Model, &u32Stepping))714 if (HMIsSubjectToSvmErratum170(&u32Family, &u32Model, &u32Stepping)) 715 715 { 716 716 Log4Func(("AMD cpu with erratum 170 family %#x model %#x stepping %#x\n", u32Family, u32Model, u32Stepping)); … … 872 872 uint16_t offMsrpm; 873 873 uint8_t uMsrpmBit; 874 int rc = HM SvmGetMsrpmOffsetAndBit(idMsr, &offMsrpm, &uMsrpmBit);874 int rc = HMGetSvmMsrpmOffsetAndBit(idMsr, &offMsrpm, &uMsrpmBit); 875 875 AssertRC(rc); 876 876 … … 2453 2453 { 2454 2454 Assert(pVCpu->CTX_SUFF(pVM)->hm.s.svm.u32Features & X86_CPUID_SVM_FEATURE_EDX_VGIF); /* Hardware supports it. */ 2455 Assert(HM SvmIsVGifActive(pVCpu->CTX_SUFF(pVM))); /* VM has configured it. */2455 Assert(HMIsSvmVGifActive(pVCpu->CTX_SUFF(pVM))); /* VM has configured it. */ 2456 2456 pVmcb->ctrl.IntCtrl.n.u1VGif = CPUMGetGuestGif(pCtx); 2457 2457 } … … 2543 2543 * @param pVCpu The cross context virtual CPU structure. 2544 2544 * 2545 * @sa HM SvmNstGstVmExitNotify.2545 * @sa HMNotifySvmNstGstVmexit. 2546 2546 */ 2547 2547 static bool hmR0SvmCacheVmcbNested(PVMCPU pVCpu) … … 2806 2806 { 2807 2807 Assert(!CPUMIsGuestInSvmNestedHwVirtMode(pCtx)); /* We don't yet support passing VGIF feature to the guest. */ 2808 Assert(HM SvmIsVGifActive(pVCpu->CTX_SUFF(pVM))); /* VM has configured it. */2808 Assert(HMIsSvmVGifActive(pVCpu->CTX_SUFF(pVM))); /* VM has configured it. */ 2809 2809 CPUMSetGuestGif(pCtx, pVmcbCtrl->IntCtrl.n.u1VGif); 2810 2810 } … … 3337 3337 /* Apply the nested-guest VMCB's TSC offset over the guest TSC offset. */ 3338 3338 if (CPUMIsGuestInSvmNestedHwVirtMode(&pVCpu->cpum.GstCtx)) 3339 uTscOffset = HM SvmNstGstApplyTscOffset(pVCpu, uTscOffset);3339 uTscOffset = HMApplySvmNstGstTscOffset(pVCpu, uTscOffset); 3340 3340 #endif 3341 3341 … … 4686 4686 * hmR0SvmNstGstUndoTscOffset() needs adjusting. 4687 4687 * 4688 * @sa HM SvmNstGstApplyTscOffset().4688 * @sa HMApplySvmNstGstTscOffset(). 4689 4689 */ 4690 4690 DECLINLINE(uint64_t) hmR0SvmNstGstUndoTscOffset(PVMCPU pVCpu, uint64_t uTicks) … … 4727 4727 else 4728 4728 { 4729 /* The nested-guest VMCB TSC offset shall eventually be restored on #VMEXIT via HM SvmNstGstVmExitNotify(). */4729 /* The nested-guest VMCB TSC offset shall eventually be restored on #VMEXIT via HMNotifySvmNstGstVmexit(). */ 4730 4730 uint64_t const uGstTsc = hmR0SvmNstGstUndoTscOffset(pVCpu, uHostTsc + pVmcbCtrl->u64TSCOffset); 4731 4731 TMCpuTickSetLastSeen(pVCpu, uGstTsc); … … 5167 5167 const bool fStrIo = pIoExitInfo->n.u1Str; 5168 5168 5169 return HM SvmIsIOInterceptActive(pvIoBitmap, u16Port, enmIoType, cbReg, cAddrSizeBits, iEffSeg, fRep, fStrIo,5169 return HMIsSvmIoInterceptActive(pvIoBitmap, u16Port, enmIoType, cbReg, cAddrSizeBits, iEffSeg, fRep, fStrIo, 5170 5170 NULL /* pIoExitInfo */); 5171 5171 } … … 5259 5259 uint16_t offMsrpm; 5260 5260 uint8_t uMsrpmBit; 5261 int rc = HM SvmGetMsrpmOffsetAndBit(idMsr, &offMsrpm, &uMsrpmBit);5261 int rc = HMGetSvmMsrpmOffsetAndBit(idMsr, &offMsrpm, &uMsrpmBit); 5262 5262 if (RT_SUCCESS(rc)) 5263 5263 { -
trunk/src/VBox/VMM/VMMR0/HMVMXR0.cpp
r76876 r76993 1756 1756 VMXMSREXITREAD enmRead; 1757 1757 VMXMSREXITWRITE enmWrite; 1758 rc = HM VmxGetMsrPermission(pVCpu->hm.s.vmx.pvMsrBitmap, pGuestMsr->u32Msr, &enmRead, &enmWrite);1759 AssertMsgReturnVoid(rc == VINF_SUCCESS, ("HM VmxGetMsrPermission! 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)); 1760 1760 if (pGuestMsr->u32Msr == MSR_K6_EFER) 1761 1761 { … … 11986 11986 VMXMSREXITREAD enmRead; 11987 11987 VMXMSREXITWRITE enmWrite; 11988 int rc2 = HM VmxGetMsrPermission(pVCpu->hm.s.vmx.pvMsrBitmap, idMsr, &enmRead, &enmWrite);11988 int rc2 = HMGetVmxMsrPermission(pVCpu->hm.s.vmx.pvMsrBitmap, idMsr, &enmRead, &enmWrite); 11989 11989 AssertRCReturn(rc2, rc2); 11990 11990 if (enmRead == VMXMSREXIT_PASSTHRU_READ) … … 12131 12131 VMXMSREXITREAD enmRead; 12132 12132 VMXMSREXITWRITE enmWrite; 12133 int rc2 = HM VmxGetMsrPermission(pVCpu->hm.s.vmx.pvMsrBitmap, idMsr, &enmRead, &enmWrite);12133 int rc2 = HMGetVmxMsrPermission(pVCpu->hm.s.vmx.pvMsrBitmap, idMsr, &enmRead, &enmWrite); 12134 12134 AssertRCReturn(rc2, rc2); 12135 12135 if (enmWrite == VMXMSREXIT_PASSTHRU_WRITE) … … 13295 13295 * guest using hardware-assisted VMX. Otherwise, fall back to emulation. 13296 13296 */ 13297 if (HM VmxCanExecuteGuest(pVCpu, pCtx))13297 if (HMCanExecuteVmxGuest(pVCpu, pCtx)) 13298 13298 { 13299 13299 Log4Func(("Mode changed but guest still suitable for executing using VT-x\n")); -
trunk/src/VBox/VMM/VMMR3/CPUM.cpp
r76952 r76993 1763 1763 { 1764 1764 if (fCaps & SUPVTCAPS_VT_X) 1765 HM VmxGetVmxMsrsFromHwvirtMsrs(&HwvirtMsrs, &pMsrs->hwvirt.vmx);1765 HMGetVmxMsrsFromHwvirtMsrs(&HwvirtMsrs, &pMsrs->hwvirt.vmx); 1766 1766 else 1767 HM VmxGetSvmMsrsFromHwvirtMsrs(&HwvirtMsrs, &pMsrs->hwvirt.svm);1767 HMGetSvmMsrsFromHwvirtMsrs(&HwvirtMsrs, &pMsrs->hwvirt.svm); 1768 1768 return VINF_SUCCESS; 1769 1769 } … … 3390 3390 pHlp->pfnPrintf(pHlp, "%sHeader:\n", pszPrefix); 3391 3391 pHlp->pfnPrintf(pHlp, " %sVMCS revision id = %#RX32\n", pszPrefix, pVmcs->u32VmcsRevId); 3392 pHlp->pfnPrintf(pHlp, " %sVMX-abort id = %#RX32 (%s)\n", pszPrefix, pVmcs->enmVmxAbort, HM VmxGetAbortDesc(pVmcs->enmVmxAbort));3393 pHlp->pfnPrintf(pHlp, " %sVMCS state = %#x (%s)\n", pszPrefix, pVmcs->fVmcsState, HM VmxGetVmcsStateDesc(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)); 3394 3394 } 3395 3395 … … 3420 3420 uint8_t const uType = VMX_ENTRY_INT_INFO_TYPE(fInfo); 3421 3421 pHlp->pfnPrintf(pHlp, " %sValid = %RTbool\n", pszPrefix, VMX_ENTRY_INT_INFO_IS_VALID(fInfo)); 3422 pHlp->pfnPrintf(pHlp, " %sType = %#x (%s)\n", pszPrefix, uType, HM VmxGetEntryIntInfoTypeDesc(uType));3422 pHlp->pfnPrintf(pHlp, " %sType = %#x (%s)\n", pszPrefix, uType, HMGetVmxEntryIntInfoTypeDesc(uType)); 3423 3423 pHlp->pfnPrintf(pHlp, " %sVector = %#x\n", pszPrefix, VMX_ENTRY_INT_INFO_VECTOR(fInfo)); 3424 3424 pHlp->pfnPrintf(pHlp, " %sNMI-unblocking-IRET = %RTbool\n", pszPrefix, VMX_ENTRY_INT_INFO_IS_NMI_UNBLOCK_IRET(fInfo)); … … 3561 3561 3562 3562 /* 32-bit. */ 3563 pHlp->pfnPrintf(pHlp, " %sExit reason = %u (%s)\n", pszPrefix, pVmcs->u32RoExitReason, HM R3GetVmxExitName(pVmcs->u32RoExitReason));3563 pHlp->pfnPrintf(pHlp, " %sExit reason = %u (%s)\n", pszPrefix, pVmcs->u32RoExitReason, HMGetVmxExitName(pVmcs->u32RoExitReason)); 3564 3564 pHlp->pfnPrintf(pHlp, " %sExit qualification = %#RX64\n", pszPrefix, pVmcs->u64RoExitQual.u); 3565 3565 pHlp->pfnPrintf(pHlp, " %sVM-instruction error = %#RX32\n", pszPrefix, pVmcs->u32RoVmInstrError); … … 3569 3569 uint8_t const uType = VMX_EXIT_INT_INFO_TYPE(fInfo); 3570 3570 pHlp->pfnPrintf(pHlp, " %sValid = %RTbool\n", pszPrefix, VMX_EXIT_INT_INFO_IS_VALID(fInfo)); 3571 pHlp->pfnPrintf(pHlp, " %sType = %#x (%s)\n", pszPrefix, uType, HM VmxGetExitIntInfoTypeDesc(uType));3571 pHlp->pfnPrintf(pHlp, " %sType = %#x (%s)\n", pszPrefix, uType, HMGetVmxExitIntInfoTypeDesc(uType)); 3572 3572 pHlp->pfnPrintf(pHlp, " %sVector = %#x\n", pszPrefix, VMX_EXIT_INT_INFO_VECTOR(fInfo)); 3573 3573 pHlp->pfnPrintf(pHlp, " %sNMI-unblocking-IRET = %RTbool\n", pszPrefix, VMX_EXIT_INT_INFO_IS_NMI_UNBLOCK_IRET(fInfo)); … … 3580 3580 uint8_t const uType = VMX_IDT_VECTORING_INFO_TYPE(fInfo); 3581 3581 pHlp->pfnPrintf(pHlp, " %sValid = %RTbool\n", pszPrefix, VMX_IDT_VECTORING_INFO_IS_VALID(fInfo)); 3582 pHlp->pfnPrintf(pHlp, " %sType = %#x (%s)\n", pszPrefix, uType, HM VmxGetIdtVectoringInfoTypeDesc(uType));3582 pHlp->pfnPrintf(pHlp, " %sType = %#x (%s)\n", pszPrefix, uType, HMGetVmxIdtVectoringInfoTypeDesc(uType)); 3583 3583 pHlp->pfnPrintf(pHlp, " %sVector = %#x\n", pszPrefix, VMX_IDT_VECTORING_INFO_VECTOR(fInfo)); 3584 3584 pHlp->pfnPrintf(pHlp, " %sError-code valid = %RTbool\n", pszPrefix, VMX_IDT_VECTORING_INFO_IS_ERROR_CODE_VALID(fInfo)); … … 3707 3707 pHlp->pfnPrintf(pHlp, " GCPhysVmcs = %#RGp\n", pCtx->hwvirt.vmx.GCPhysVmcs); 3708 3708 pHlp->pfnPrintf(pHlp, " GCPhysShadowVmcs = %#RGp\n", pCtx->hwvirt.vmx.GCPhysShadowVmcs); 3709 pHlp->pfnPrintf(pHlp, " enmDiag = %u (%s)\n", pCtx->hwvirt.vmx.enmDiag, HM VmxGetDiagDesc(pCtx->hwvirt.vmx.enmDiag));3710 pHlp->pfnPrintf(pHlp, " enmAbort = %u (%s)\n", pCtx->hwvirt.vmx.enmAbort, HM VmxGetAbortDesc(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)); 3711 3711 pHlp->pfnPrintf(pHlp, " uAbortAux = %u (%#x)\n", pCtx->hwvirt.vmx.uAbortAux, pCtx->hwvirt.vmx.uAbortAux); 3712 3712 pHlp->pfnPrintf(pHlp, " fInVmxRootMode = %RTbool\n", pCtx->hwvirt.vmx.fInVmxRootMode); -
trunk/src/VBox/VMM/VMMR3/EMR3Dbg.cpp
r76553 r76993 130 130 131 131 case EMEXIT_F_KIND_VMX: 132 pszExitName = HM R3GetVmxExitName( uFlagsAndType & EMEXIT_F_TYPE_MASK);132 pszExitName = HMGetVmxExitName( uFlagsAndType & EMEXIT_F_TYPE_MASK); 133 133 break; 134 134 135 135 case EMEXIT_F_KIND_SVM: 136 pszExitName = HM R3GetSvmExitName( uFlagsAndType & EMEXIT_F_TYPE_MASK);136 pszExitName = HMGetSvmExitName( uFlagsAndType & EMEXIT_F_TYPE_MASK); 137 137 break; 138 138 -
trunk/src/VBox/VMM/VMMR3/HM.cpp
r76886 r76993 75 75 76 76 /********************************************************************************************************************************* 77 * Global Variables*77 * Defined Constants And Macros * 78 78 *********************************************************************************************************************************/ 79 #define EXIT_REASON(def, val, str) #def " - " #val " - " str80 #define EXIT_REASON_NIL() NULL81 /** Exit reason descriptions for VT-x, used to describe statistics and exit82 * 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 64153 154 /** A partial list of \#EXIT reason descriptions for AMD-V, used to describe155 * 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, we159 * 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 141307 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 @c315 * 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_NIL331 #undef EXIT_REASON332 333 79 /** @def HMVMX_REPORT_FEAT 334 80 * Reports VT-x feature to the release log. … … 1090 836 #undef HM_REG_COUNTER 1091 837 1092 const char *const *papszDesc = 1093 ASMIsIntelCpu() || ASMIsViaCentaurCpu() || ASMIsShanghaiCpu() 1094 ? &g_apszVmxExitReasons[0] 1095 : &g_apszSvmExitReasons[0]; 838 bool const fCpuSupportsVmx = ASMIsIntelCpu() || ASMIsViaCentaurCpu() || ASMIsShanghaiCpu(); 1096 839 1097 840 /* … … 1102 845 (void **)&pVCpu->hm.s.paStatExitReason); 1103 846 AssertRCReturn(rc, rc); 1104 for (int j = 0; j < MAX_EXITREASON_STAT; j++) 847 848 if (fCpuSupportsVmx) 1105 849 { 1106 if (papszDesc[j])850 for (int j = 0; j < MAX_EXITREASON_STAT; j++) 1107 851 { 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 } 1111 872 } 1112 873 } … … 1121 882 # endif 1122 883 1123 #if def VBOX_WITH_NESTED_HWVIRT_SVM884 #if defined(VBOX_WITH_NESTED_HWVIRT_SVM) || defined(VBOX_WITH_NESTED_HWVIRT_VMX) 1124 885 /* 1125 * Nested-guest Exit reason stats.886 * Nested-guest VM-exit reason stats. 1126 887 */ 1127 888 pVCpu->hm.s.paStatNestedExitReason = NULL; … … 1129 890 (void **)&pVCpu->hm.s.paStatNestedExitReason); 1130 891 AssertRCReturn(rc, rc); 1131 for (int j = 0; j < MAX_EXITREASON_STAT; j++)892 if (fCpuSupportsVmx) 1132 893 { 1133 if (papszDesc[j])894 for (int j = 0; j < MAX_EXITREASON_STAT; j++) 1134 895 { 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 } 1138 916 } 1139 917 } … … 1981 1759 uint32_t u32Model; 1982 1760 uint32_t u32Stepping; 1983 if (HM SvmIsSubjectToErratum170(&u32Family, &u32Model, &u32Stepping))1761 if (HMIsSubjectToSvmErratum170(&u32Family, &u32Model, &u32Stepping)) 1984 1762 LogRel(("HM: AMD Cpu with erratum 170 family %#x model %#x stepping %#x\n", u32Family, u32Model, u32Stepping)); 1985 1763 LogRel(("HM: Max resume loops = %u\n", pVM->hm.s.cMaxResumeLoops)); … … 3443 3221 3444 3222 /** 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 /**3473 3223 * Displays HM info. 3474 3224 * -
trunk/src/VBox/VMM/VMMR3/PGM.cpp
r76553 r76993 2181 2181 VMCPU_FF_SET(pVCpu, VMCPU_FF_PGM_SYNC_CR3); 2182 2182 pgmR3RefreshShadowModeAfterA20Change(pVCpu); 2183 HMFlushT LB(pVCpu);2183 HMFlushTlb(pVCpu); 2184 2184 #endif 2185 2185 } -
trunk/src/VBox/VMM/VMMR3/PGMPhys.cpp
r76553 r76993 4574 4574 VMCPU_FF_SET(pVCpu, VMCPU_FF_PGM_SYNC_CR3); 4575 4575 pgmR3RefreshShadowModeAfterA20Change(pVCpu); 4576 HMFlushT LB(pVCpu);4576 HMFlushTlb(pVCpu); 4577 4577 #endif 4578 4578 IEMTlbInvalidateAllPhysical(pVCpu); -
trunk/src/VBox/VMM/include/PGMInternal.h
r76585 r76993 418 418 # define PGM_INVL_BIG_PG(pVCpu, GCVirt) ASMReloadCR3() 419 419 #elif defined(IN_RING0) 420 # define PGM_INVL_BIG_PG(pVCpu, GCVirt) HMFlushT LB(pVCpu)420 # define PGM_INVL_BIG_PG(pVCpu, GCVirt) HMFlushTlb(pVCpu) 421 421 #else 422 # define PGM_INVL_BIG_PG(pVCpu, GCVirt) HMFlushT LB(pVCpu)422 # define PGM_INVL_BIG_PG(pVCpu, GCVirt) HMFlushTlb(pVCpu) 423 423 #endif 424 424 … … 431 431 # define PGM_INVL_VCPU_TLBS(pVCpu) ASMReloadCR3() 432 432 #elif defined(IN_RING0) 433 # define PGM_INVL_VCPU_TLBS(pVCpu) HMFlushT LB(pVCpu)433 # define PGM_INVL_VCPU_TLBS(pVCpu) HMFlushTlb(pVCpu) 434 434 #else 435 # define PGM_INVL_VCPU_TLBS(pVCpu) HMFlushT LB(pVCpu)435 # define PGM_INVL_VCPU_TLBS(pVCpu) HMFlushTlb(pVCpu) 436 436 #endif 437 437 … … 444 444 # define PGM_INVL_ALL_VCPU_TLBS(pVM) ASMReloadCR3() 445 445 #elif defined(IN_RING0) 446 # define PGM_INVL_ALL_VCPU_TLBS(pVM) HMFlushT LBOnAllVCpus(pVM)446 # define PGM_INVL_ALL_VCPU_TLBS(pVM) HMFlushTlbOnAllVCpus(pVM) 447 447 #else 448 # define PGM_INVL_ALL_VCPU_TLBS(pVM) HMFlushT LBOnAllVCpus(pVM)448 # define PGM_INVL_ALL_VCPU_TLBS(pVM) HMFlushTlbOnAllVCpus(pVM) 449 449 #endif 450 450
Note:
See TracChangeset
for help on using the changeset viewer.