Changeset 85188 in vbox
- Timestamp:
- Jul 10, 2020 1:24:21 PM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/VMMR0/HMVMXR0.cpp
r85121 r85188 736 736 * VMX_EXIT dispatch table. 737 737 */ 738 static const PFNVMXEXITHANDLER g_apfnVMExitHandlers[VMX_EXIT_MAX + 1] =739 { 740 /* 0 VMX_EXIT_XCPT_OR_NMI */ hmR0VmxExitXcptOrNmi,741 /* 1 VMX_EXIT_EXT_INT */ hmR0VmxExitExtInt,742 /* 2 VMX_EXIT_TRIPLE_FAULT */ hmR0VmxExitTripleFault,743 /* 3 VMX_EXIT_INIT_SIGNAL */ hmR0VmxExitErrUnexpected,744 /* 4 VMX_EXIT_SIPI */ hmR0VmxExitErrUnexpected,745 /* 5 VMX_EXIT_IO_SMI */ hmR0VmxExitErrUnexpected,746 /* 6 VMX_EXIT_SMI */ hmR0VmxExitErrUnexpected,747 /* 7 VMX_EXIT_INT_WINDOW */ hmR0VmxExitIntWindow,748 /* 8 VMX_EXIT_NMI_WINDOW */ hmR0VmxExitNmiWindow,749 /* 9 VMX_EXIT_TASK_SWITCH */ hmR0VmxExitTaskSwitch,750 /* 10 VMX_EXIT_CPUID */ hmR0VmxExitCpuid,751 /* 11 VMX_EXIT_GETSEC */ hmR0VmxExitGetsec,752 /* 12 VMX_EXIT_HLT */ hmR0VmxExitHlt,753 /* 13 VMX_EXIT_INVD */ hmR0VmxExitInvd,754 /* 14 VMX_EXIT_INVLPG */ hmR0VmxExitInvlpg,755 /* 15 VMX_EXIT_RDPMC */ hmR0VmxExitRdpmc,756 /* 16 VMX_EXIT_RDTSC */ hmR0VmxExitRdtsc,757 /* 17 VMX_EXIT_RSM */ hmR0VmxExitErrUnexpected,758 /* 18 VMX_EXIT_VMCALL */ hmR0VmxExitVmcall,738 static const struct CLANG11NOTHROWWEIRDNESS { PFNVMXEXITHANDLER pfn; } g_aVMExitHandlers[VMX_EXIT_MAX + 1] = 739 { 740 /* 0 VMX_EXIT_XCPT_OR_NMI */ { hmR0VmxExitXcptOrNmi }, 741 /* 1 VMX_EXIT_EXT_INT */ { hmR0VmxExitExtInt }, 742 /* 2 VMX_EXIT_TRIPLE_FAULT */ { hmR0VmxExitTripleFault }, 743 /* 3 VMX_EXIT_INIT_SIGNAL */ { hmR0VmxExitErrUnexpected }, 744 /* 4 VMX_EXIT_SIPI */ { hmR0VmxExitErrUnexpected }, 745 /* 5 VMX_EXIT_IO_SMI */ { hmR0VmxExitErrUnexpected }, 746 /* 6 VMX_EXIT_SMI */ { hmR0VmxExitErrUnexpected }, 747 /* 7 VMX_EXIT_INT_WINDOW */ { hmR0VmxExitIntWindow }, 748 /* 8 VMX_EXIT_NMI_WINDOW */ { hmR0VmxExitNmiWindow }, 749 /* 9 VMX_EXIT_TASK_SWITCH */ { hmR0VmxExitTaskSwitch }, 750 /* 10 VMX_EXIT_CPUID */ { hmR0VmxExitCpuid }, 751 /* 11 VMX_EXIT_GETSEC */ { hmR0VmxExitGetsec }, 752 /* 12 VMX_EXIT_HLT */ { hmR0VmxExitHlt }, 753 /* 13 VMX_EXIT_INVD */ { hmR0VmxExitInvd }, 754 /* 14 VMX_EXIT_INVLPG */ { hmR0VmxExitInvlpg }, 755 /* 15 VMX_EXIT_RDPMC */ { hmR0VmxExitRdpmc }, 756 /* 16 VMX_EXIT_RDTSC */ { hmR0VmxExitRdtsc }, 757 /* 17 VMX_EXIT_RSM */ { hmR0VmxExitErrUnexpected }, 758 /* 18 VMX_EXIT_VMCALL */ { hmR0VmxExitVmcall }, 759 759 #ifdef VBOX_WITH_NESTED_HWVIRT_VMX 760 /* 19 VMX_EXIT_VMCLEAR */ hmR0VmxExitVmclear,761 /* 20 VMX_EXIT_VMLAUNCH */ hmR0VmxExitVmlaunch,762 /* 21 VMX_EXIT_VMPTRLD */ hmR0VmxExitVmptrld,763 /* 22 VMX_EXIT_VMPTRST */ hmR0VmxExitVmptrst,764 /* 23 VMX_EXIT_VMREAD */ hmR0VmxExitVmread,765 /* 24 VMX_EXIT_VMRESUME */ hmR0VmxExitVmresume,766 /* 25 VMX_EXIT_VMWRITE */ hmR0VmxExitVmwrite,767 /* 26 VMX_EXIT_VMXOFF */ hmR0VmxExitVmxoff,768 /* 27 VMX_EXIT_VMXON */ hmR0VmxExitVmxon,760 /* 19 VMX_EXIT_VMCLEAR */ { hmR0VmxExitVmclear }, 761 /* 20 VMX_EXIT_VMLAUNCH */ { hmR0VmxExitVmlaunch }, 762 /* 21 VMX_EXIT_VMPTRLD */ { hmR0VmxExitVmptrld }, 763 /* 22 VMX_EXIT_VMPTRST */ { hmR0VmxExitVmptrst }, 764 /* 23 VMX_EXIT_VMREAD */ { hmR0VmxExitVmread }, 765 /* 24 VMX_EXIT_VMRESUME */ { hmR0VmxExitVmresume }, 766 /* 25 VMX_EXIT_VMWRITE */ { hmR0VmxExitVmwrite }, 767 /* 26 VMX_EXIT_VMXOFF */ { hmR0VmxExitVmxoff }, 768 /* 27 VMX_EXIT_VMXON */ { hmR0VmxExitVmxon }, 769 769 #else 770 /* 19 VMX_EXIT_VMCLEAR */ hmR0VmxExitSetPendingXcptUD,771 /* 20 VMX_EXIT_VMLAUNCH */ hmR0VmxExitSetPendingXcptUD,772 /* 21 VMX_EXIT_VMPTRLD */ hmR0VmxExitSetPendingXcptUD,773 /* 22 VMX_EXIT_VMPTRST */ hmR0VmxExitSetPendingXcptUD,774 /* 23 VMX_EXIT_VMREAD */ hmR0VmxExitSetPendingXcptUD,775 /* 24 VMX_EXIT_VMRESUME */ hmR0VmxExitSetPendingXcptUD,776 /* 25 VMX_EXIT_VMWRITE */ hmR0VmxExitSetPendingXcptUD,777 /* 26 VMX_EXIT_VMXOFF */ hmR0VmxExitSetPendingXcptUD,778 /* 27 VMX_EXIT_VMXON */ hmR0VmxExitSetPendingXcptUD,770 /* 19 VMX_EXIT_VMCLEAR */ { hmR0VmxExitSetPendingXcptUD }, 771 /* 20 VMX_EXIT_VMLAUNCH */ { hmR0VmxExitSetPendingXcptUD }, 772 /* 21 VMX_EXIT_VMPTRLD */ { hmR0VmxExitSetPendingXcptUD }, 773 /* 22 VMX_EXIT_VMPTRST */ { hmR0VmxExitSetPendingXcptUD }, 774 /* 23 VMX_EXIT_VMREAD */ { hmR0VmxExitSetPendingXcptUD }, 775 /* 24 VMX_EXIT_VMRESUME */ { hmR0VmxExitSetPendingXcptUD }, 776 /* 25 VMX_EXIT_VMWRITE */ { hmR0VmxExitSetPendingXcptUD }, 777 /* 26 VMX_EXIT_VMXOFF */ { hmR0VmxExitSetPendingXcptUD }, 778 /* 27 VMX_EXIT_VMXON */ { hmR0VmxExitSetPendingXcptUD }, 779 779 #endif 780 /* 28 VMX_EXIT_MOV_CRX */ hmR0VmxExitMovCRx,781 /* 29 VMX_EXIT_MOV_DRX */ hmR0VmxExitMovDRx,782 /* 30 VMX_EXIT_IO_INSTR */ hmR0VmxExitIoInstr,783 /* 31 VMX_EXIT_RDMSR */ hmR0VmxExitRdmsr,784 /* 32 VMX_EXIT_WRMSR */ hmR0VmxExitWrmsr,785 /* 33 VMX_EXIT_ERR_INVALID_GUEST_STATE */ hmR0VmxExitErrInvalidGuestState,786 /* 34 VMX_EXIT_ERR_MSR_LOAD */ hmR0VmxExitErrUnexpected,787 /* 35 UNDEFINED */ hmR0VmxExitErrUnexpected,788 /* 36 VMX_EXIT_MWAIT */ hmR0VmxExitMwait,789 /* 37 VMX_EXIT_MTF */ hmR0VmxExitMtf,790 /* 38 UNDEFINED */ hmR0VmxExitErrUnexpected,791 /* 39 VMX_EXIT_MONITOR */ hmR0VmxExitMonitor,792 /* 40 VMX_EXIT_PAUSE */ hmR0VmxExitPause,793 /* 41 VMX_EXIT_ERR_MACHINE_CHECK */ hmR0VmxExitErrUnexpected,794 /* 42 UNDEFINED */ hmR0VmxExitErrUnexpected,795 /* 43 VMX_EXIT_TPR_BELOW_THRESHOLD */ hmR0VmxExitTprBelowThreshold,796 /* 44 VMX_EXIT_APIC_ACCESS */ hmR0VmxExitApicAccess,797 /* 45 VMX_EXIT_VIRTUALIZED_EOI */ hmR0VmxExitErrUnexpected,798 /* 46 VMX_EXIT_GDTR_IDTR_ACCESS */ hmR0VmxExitErrUnexpected,799 /* 47 VMX_EXIT_LDTR_TR_ACCESS */ hmR0VmxExitErrUnexpected,800 /* 48 VMX_EXIT_EPT_VIOLATION */ hmR0VmxExitEptViolation,801 /* 49 VMX_EXIT_EPT_MISCONFIG */ hmR0VmxExitEptMisconfig,802 /* 50 VMX_EXIT_INVEPT */ hmR0VmxExitSetPendingXcptUD,803 /* 51 VMX_EXIT_RDTSCP */ hmR0VmxExitRdtscp,804 /* 52 VMX_EXIT_PREEMPT_TIMER */ hmR0VmxExitPreemptTimer,780 /* 28 VMX_EXIT_MOV_CRX */ { hmR0VmxExitMovCRx }, 781 /* 29 VMX_EXIT_MOV_DRX */ { hmR0VmxExitMovDRx }, 782 /* 30 VMX_EXIT_IO_INSTR */ { hmR0VmxExitIoInstr }, 783 /* 31 VMX_EXIT_RDMSR */ { hmR0VmxExitRdmsr }, 784 /* 32 VMX_EXIT_WRMSR */ { hmR0VmxExitWrmsr }, 785 /* 33 VMX_EXIT_ERR_INVALID_GUEST_STATE */ { hmR0VmxExitErrInvalidGuestState }, 786 /* 34 VMX_EXIT_ERR_MSR_LOAD */ { hmR0VmxExitErrUnexpected }, 787 /* 35 UNDEFINED */ { hmR0VmxExitErrUnexpected }, 788 /* 36 VMX_EXIT_MWAIT */ { hmR0VmxExitMwait }, 789 /* 37 VMX_EXIT_MTF */ { hmR0VmxExitMtf }, 790 /* 38 UNDEFINED */ { hmR0VmxExitErrUnexpected }, 791 /* 39 VMX_EXIT_MONITOR */ { hmR0VmxExitMonitor }, 792 /* 40 VMX_EXIT_PAUSE */ { hmR0VmxExitPause }, 793 /* 41 VMX_EXIT_ERR_MACHINE_CHECK */ { hmR0VmxExitErrUnexpected }, 794 /* 42 UNDEFINED */ { hmR0VmxExitErrUnexpected }, 795 /* 43 VMX_EXIT_TPR_BELOW_THRESHOLD */ { hmR0VmxExitTprBelowThreshold }, 796 /* 44 VMX_EXIT_APIC_ACCESS */ { hmR0VmxExitApicAccess }, 797 /* 45 VMX_EXIT_VIRTUALIZED_EOI */ { hmR0VmxExitErrUnexpected }, 798 /* 46 VMX_EXIT_GDTR_IDTR_ACCESS */ { hmR0VmxExitErrUnexpected }, 799 /* 47 VMX_EXIT_LDTR_TR_ACCESS */ { hmR0VmxExitErrUnexpected }, 800 /* 48 VMX_EXIT_EPT_VIOLATION */ { hmR0VmxExitEptViolation }, 801 /* 49 VMX_EXIT_EPT_MISCONFIG */ { hmR0VmxExitEptMisconfig }, 802 /* 50 VMX_EXIT_INVEPT */ { hmR0VmxExitSetPendingXcptUD }, 803 /* 51 VMX_EXIT_RDTSCP */ { hmR0VmxExitRdtscp }, 804 /* 52 VMX_EXIT_PREEMPT_TIMER */ { hmR0VmxExitPreemptTimer }, 805 805 #ifdef VBOX_WITH_NESTED_HWVIRT_VMX 806 /* 53 VMX_EXIT_INVVPID */ hmR0VmxExitInvvpid,806 /* 53 VMX_EXIT_INVVPID */ { hmR0VmxExitInvvpid }, 807 807 #else 808 /* 53 VMX_EXIT_INVVPID */ hmR0VmxExitSetPendingXcptUD,808 /* 53 VMX_EXIT_INVVPID */ { hmR0VmxExitSetPendingXcptUD }, 809 809 #endif 810 /* 54 VMX_EXIT_WBINVD */ hmR0VmxExitWbinvd,811 /* 55 VMX_EXIT_XSETBV */ hmR0VmxExitXsetbv,812 /* 56 VMX_EXIT_APIC_WRITE */ hmR0VmxExitErrUnexpected,813 /* 57 VMX_EXIT_RDRAND */ hmR0VmxExitErrUnexpected,814 /* 58 VMX_EXIT_INVPCID */ hmR0VmxExitInvpcid,815 /* 59 VMX_EXIT_VMFUNC */ hmR0VmxExitErrUnexpected,816 /* 60 VMX_EXIT_ENCLS */ hmR0VmxExitErrUnexpected,817 /* 61 VMX_EXIT_RDSEED */ hmR0VmxExitErrUnexpected,818 /* 62 VMX_EXIT_PML_FULL */ hmR0VmxExitErrUnexpected,819 /* 63 VMX_EXIT_XSAVES */ hmR0VmxExitErrUnexpected,820 /* 64 VMX_EXIT_XRSTORS */ hmR0VmxExitErrUnexpected,821 /* 65 UNDEFINED */ hmR0VmxExitErrUnexpected,822 /* 66 VMX_EXIT_SPP_EVENT */ hmR0VmxExitErrUnexpected,823 /* 67 VMX_EXIT_UMWAIT */ hmR0VmxExitErrUnexpected,824 /* 68 VMX_EXIT_TPAUSE */ hmR0VmxExitErrUnexpected,810 /* 54 VMX_EXIT_WBINVD */ { hmR0VmxExitWbinvd }, 811 /* 55 VMX_EXIT_XSETBV */ { hmR0VmxExitXsetbv }, 812 /* 56 VMX_EXIT_APIC_WRITE */ { hmR0VmxExitErrUnexpected }, 813 /* 57 VMX_EXIT_RDRAND */ { hmR0VmxExitErrUnexpected }, 814 /* 58 VMX_EXIT_INVPCID */ { hmR0VmxExitInvpcid }, 815 /* 59 VMX_EXIT_VMFUNC */ { hmR0VmxExitErrUnexpected }, 816 /* 60 VMX_EXIT_ENCLS */ { hmR0VmxExitErrUnexpected }, 817 /* 61 VMX_EXIT_RDSEED */ { hmR0VmxExitErrUnexpected }, 818 /* 62 VMX_EXIT_PML_FULL */ { hmR0VmxExitErrUnexpected }, 819 /* 63 VMX_EXIT_XSAVES */ { hmR0VmxExitErrUnexpected }, 820 /* 64 VMX_EXIT_XRSTORS */ { hmR0VmxExitErrUnexpected }, 821 /* 65 UNDEFINED */ { hmR0VmxExitErrUnexpected }, 822 /* 66 VMX_EXIT_SPP_EVENT */ { hmR0VmxExitErrUnexpected }, 823 /* 67 VMX_EXIT_UMWAIT */ { hmR0VmxExitErrUnexpected }, 824 /* 68 VMX_EXIT_TPAUSE */ { hmR0VmxExitErrUnexpected }, 825 825 }; 826 826 #endif /* HMVMX_USE_FUNCTION_TABLE */ … … 4249 4249 { 4250 4250 #ifdef HMVMX_USE_FUNCTION_TABLE 4251 AssertCompile(VMX_EXIT_MAX + 1 == RT_ELEMENTS(g_a pfnVMExitHandlers));4251 AssertCompile(VMX_EXIT_MAX + 1 == RT_ELEMENTS(g_aVMExitHandlers)); 4252 4252 # ifdef VBOX_STRICT 4253 for (unsigned i = 0; i < RT_ELEMENTS(g_a pfnVMExitHandlers); i++)4254 Assert(g_a pfnVMExitHandlers[i]);4253 for (unsigned i = 0; i < RT_ELEMENTS(g_aVMExitHandlers); i++) 4254 Assert(g_aVMExitHandlers[i].pfn); 4255 4255 # endif 4256 4256 #endif … … 11227 11227 */ 11228 11228 #ifdef HMVMX_USE_FUNCTION_TABLE 11229 rcStrict = g_a pfnVMExitHandlers[VmxTransient.uExitReason](pVCpu, &VmxTransient);11229 rcStrict = g_aVMExitHandlers[VmxTransient.uExitReason].pfn(pVCpu, &VmxTransient); 11230 11230 #else 11231 11231 rcStrict = hmR0VmxHandleExit(pVCpu, &VmxTransient); … … 12400 12400 */ 12401 12401 #ifdef HMVMX_USE_FUNCTION_TABLE 12402 return g_a pfnVMExitHandlers[uExitReason](pVCpu, pVmxTransient);12402 return g_aVMExitHandlers[uExitReason].pfn(pVCpu, pVmxTransient); 12403 12403 #else 12404 12404 return hmR0VmxHandleExit(pVCpu, pVmxTransient, uExitReason);
Note:
See TracChangeset
for help on using the changeset viewer.