- Timestamp:
- May 29, 2019 3:47:44 AM (6 years ago)
- svn:sync-xref-src-repo-rev:
- 130934
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/VMMR0/HMVMXR0.cpp
r78808 r78834 403 403 static FNVMXEXITHANDLERNSRC hmR0VmxExitWbinvd; 404 404 static FNVMXEXITHANDLER hmR0VmxExitXsetbv; 405 static FNVMXEXITHANDLER hmR0VmxExitRdrand;406 405 static FNVMXEXITHANDLER hmR0VmxExitInvpcid; 407 406 static FNVMXEXITHANDLERNSRC hmR0VmxExitSetPendingXcptUD; … … 456 455 static FNVMXEXITHANDLERNSRC hmR0VmxExitWbinvdNested; 457 456 //static FNVMXEXITHANDLER hmR0VmxExitXsetbv; 458 //static FNVMXEXITHANDLER hmR0VmxExit Rdrand;457 //static FNVMXEXITHANDLER hmR0VmxExitErrUnexpected; 459 458 static FNVMXEXITHANDLER hmR0VmxExitInvpcidNested; 460 459 //static FNVMXEXITHANDLERNSRC hmR0VmxExitSetPendingXcptUD; … … 562 561 /* 15 VMX_EXIT_RDPMC */ hmR0VmxExitRdpmc, 563 562 /* 16 VMX_EXIT_RDTSC */ hmR0VmxExitRdtsc, 564 /* 17 VMX_EXIT_RSM */ hmR0VmxExit SetPendingXcptUD,563 /* 17 VMX_EXIT_RSM */ hmR0VmxExitErrUnexpected, 565 564 /* 18 VMX_EXIT_VMCALL */ hmR0VmxExitVmcall, 566 565 #ifdef VBOX_WITH_NESTED_HWVIRT_VMX … … 618 617 /* 55 VMX_EXIT_XSETBV */ hmR0VmxExitXsetbv, 619 618 /* 56 VMX_EXIT_APIC_WRITE */ hmR0VmxExitErrUnexpected, 620 /* 57 VMX_EXIT_RDRAND */ hmR0VmxExit Rdrand,619 /* 57 VMX_EXIT_RDRAND */ hmR0VmxExitErrUnexpected, 621 620 /* 58 VMX_EXIT_INVPCID */ hmR0VmxExitInvpcid, 622 /* 59 VMX_EXIT_VMFUNC */ hmR0VmxExit SetPendingXcptUD,623 /* 60 VMX_EXIT_ENCLS */ hmR0VmxExit SetPendingXcptUD,624 /* 61 VMX_EXIT_RDSEED */ hmR0VmxExit SetPendingXcptUD,621 /* 59 VMX_EXIT_VMFUNC */ hmR0VmxExitErrUnexpected, 622 /* 60 VMX_EXIT_ENCLS */ hmR0VmxExitErrUnexpected, 623 /* 61 VMX_EXIT_RDSEED */ hmR0VmxExitErrUnexpected, 625 624 /* 62 VMX_EXIT_PML_FULL */ hmR0VmxExitErrUnexpected, 626 /* 63 VMX_EXIT_XSAVES */ hmR0VmxExit SetPendingXcptUD,627 /* 64 VMX_EXIT_XRSTORS */ hmR0VmxExit SetPendingXcptUD,625 /* 63 VMX_EXIT_XSAVES */ hmR0VmxExitErrUnexpected, 626 /* 64 VMX_EXIT_XRSTORS */ hmR0VmxExitErrUnexpected, 628 627 /* 65 UNDEFINED */ hmR0VmxExitErrUnexpected, 629 628 /* 66 VMX_EXIT_SPP_EVENT */ hmR0VmxExitErrUnexpected, 630 /* 67 VMX_EXIT_UMWAIT */ hmR0VmxExit SetPendingXcptUD,631 /* 68 VMX_EXIT_TPAUSE */ hmR0VmxExit SetPendingXcptUD,629 /* 67 VMX_EXIT_UMWAIT */ hmR0VmxExitErrUnexpected, 630 /* 68 VMX_EXIT_TPAUSE */ hmR0VmxExitErrUnexpected, 632 631 }; 633 632 #endif /* HMVMX_USE_FUNCTION_TABLE */ … … 12539 12538 case VMX_EXIT_WBINVD: VMEXIT_CALL_RET(0, hmR0VmxExitWbinvd(pVCpu, pVmxTransient)); 12540 12539 case VMX_EXIT_XSETBV: VMEXIT_CALL_RET(0, hmR0VmxExitXsetbv(pVCpu, pVmxTransient)); 12541 case VMX_EXIT_RDRAND: VMEXIT_CALL_RET(0, hmR0VmxExitRdrand(pVCpu, pVmxTransient));12542 12540 case VMX_EXIT_INVPCID: VMEXIT_CALL_RET(0, hmR0VmxExitInvpcid(pVCpu, pVmxTransient)); 12543 12541 case VMX_EXIT_GETSEC: VMEXIT_CALL_RET(0, hmR0VmxExitGetsec(pVCpu, pVmxTransient)); … … 12554 12552 case VMX_EXIT_VMXON: VMEXIT_CALL_RET(0, hmR0VmxExitVmxon(pVCpu, pVmxTransient)); 12555 12553 case VMX_EXIT_INVVPID: VMEXIT_CALL_RET(0, hmR0VmxExitInvvpid(pVCpu, pVmxTransient)); 12554 case VMX_EXIT_INVEPT: VMEXIT_CALL_RET(0, hmR0VmxExitSetPendingXcptUD(pVCpu, pVmxTransient)); 12556 12555 #else 12557 12556 case VMX_EXIT_VMCLEAR: … … 12565 12564 case VMX_EXIT_VMXON: 12566 12565 case VMX_EXIT_INVVPID: 12566 case VMX_EXIT_INVEPT: 12567 12567 return hmR0VmxExitSetPendingXcptUD(pVCpu, pVmxTransient); 12568 12568 #endif … … 12571 12571 case VMX_EXIT_NMI_WINDOW: return hmR0VmxExitNmiWindow(pVCpu, pVmxTransient); 12572 12572 case VMX_EXIT_ERR_INVALID_GUEST_STATE: return hmR0VmxExitErrInvalidGuestState(pVCpu, pVmxTransient); 12573 12574 case VMX_EXIT_RSM:12575 case VMX_EXIT_RDSEED:12576 case VMX_EXIT_ENCLS:12577 case VMX_EXIT_INVEPT:12578 case VMX_EXIT_VMFUNC:12579 case VMX_EXIT_XSAVES:12580 case VMX_EXIT_XRSTORS:12581 return hmR0VmxExitSetPendingXcptUD(pVCpu, pVmxTransient);12582 12573 12583 12574 case VMX_EXIT_INIT_SIGNAL: … … 12590 12581 case VMX_EXIT_VIRTUALIZED_EOI: 12591 12582 case VMX_EXIT_APIC_WRITE: 12583 case VMX_EXIT_RDRAND: 12584 case VMX_EXIT_RSM: 12585 case VMX_EXIT_VMFUNC: 12586 case VMX_EXIT_ENCLS: 12587 case VMX_EXIT_RDSEED: 12588 case VMX_EXIT_XSAVES: 12589 case VMX_EXIT_XRSTORS: 12590 case VMX_EXIT_UMWAIT: 12591 case VMX_EXIT_TPAUSE: 12592 12592 default: 12593 12593 return hmR0VmxExitErrUnexpected(pVCpu, pVmxTransient); … … 12696 12696 case VMX_EXIT_LDTR_TR_ACCESS: return hmR0VmxExitXdtrAccessNested(pVCpu, pVmxTransient); 12697 12697 12698 case VMX_EXIT_RDRAND:12699 12698 case VMX_EXIT_RDPMC: 12700 12699 case VMX_EXIT_VMREAD: 12701 12700 case VMX_EXIT_VMWRITE: 12702 case VMX_EXIT_RSM:12703 case VMX_EXIT_RDSEED:12704 case VMX_EXIT_ENCLS:12705 case VMX_EXIT_VMFUNC:12706 case VMX_EXIT_XSAVES:12707 case VMX_EXIT_XRSTORS:12708 12701 12709 12702 case VMX_EXIT_TRIPLE_FAULT: … … 12720 12713 case VMX_EXIT_VIRTUALIZED_EOI: 12721 12714 case VMX_EXIT_APIC_WRITE: 12715 case VMX_EXIT_RDRAND: 12716 case VMX_EXIT_RSM: 12717 case VMX_EXIT_VMFUNC: 12718 case VMX_EXIT_ENCLS: 12719 case VMX_EXIT_RDSEED: 12720 case VMX_EXIT_XSAVES: 12721 case VMX_EXIT_XRSTORS: 12722 case VMX_EXIT_UMWAIT: 12723 case VMX_EXIT_TPAUSE: 12722 12724 default: 12723 12725 { … … 13708 13710 /* 13709 13711 * Cummulative notes of all recognized but unexpected VM-exits. 13710 * This does -not- cover those VM-exits like a page-fault occurring when say nested-paging 13711 * is used. 13712 * 13713 * 1. This does -not- cover scenarios like like a page-fault VM-exit occurring when 13714 * nested-paging is used. 13715 * 13716 * 2. Any instruction that causes a VM-exit unconditionally (for e.g. VMXON) must be 13717 * emulated or a #UD must be raised in the guest. Therefore, we should -not- be using 13718 * this function (and thereby stop VM execution) for handling such instructions. 13719 * 13712 13720 * 13713 13721 * VMX_EXIT_INIT_SIGNAL: … … 13737 13745 * See Intel spec. 25.3 "Other Causes of VM-Exits" 13738 13746 * 13747 * VMX_EXIT_ERR_MSR_LOAD: 13748 * Failures while loading MSRs are part of the VM-entry MSR-load area are unexpected 13749 * and typically indicates a bug in the hypervisor code. We thus cannot not resume 13750 * execution. 13751 * 13752 * See Intel spec. 26.7 "VM-Entry Failures During Or After Loading Guest State". 13753 * 13739 13754 * VMX_EXIT_ERR_MACHINE_CHECK: 13740 13755 * Machine check exceptions indicates a fatal/unrecoverable hardware condition … … 13746 13761 * See Intel spec. 27.1 "Architectural State Before A VM Exit". 13747 13762 * 13748 * VMX_EXIT_ERR_MSR_LOAD:13749 * Failures while loading MSRs are part of the VM-entry MSR-load area are unexpected13750 * and typically indicates a bug in the hypervisor code. We thus cannot not resume13751 * execution.13752 *13753 * See Intel spec. 26.7 "VM-Entry Failures During Or After Loading Guest State".13754 *13755 13763 * VMX_EXIT_PML_FULL: 13756 13764 * VMX_EXIT_VIRTUALIZED_EOI: … … 13758 13766 * We do not currently support any of these features and thus they are all unexpected 13759 13767 * VM-exits. 13768 * 13769 * VMX_EXIT_RDRAND: 13770 * VMX_EXIT_RSM: 13771 * VMX_EXIT_VMFUNC: 13772 * VMX_EXIT_ENCLS: 13773 * VMX_EXIT_RDSEED: 13774 * VMX_EXIT_XSAVES: 13775 * VMX_EXIT_XRSTORS: 13776 * VMX_EXIT_UMWAIT: 13777 * VMX_EXIT_TPAUSE: 13778 * These VM-exits are -not- caused unconditionally by execution of the corresponding 13779 * instruction. Any VM-exit for these instructions indicate a hardware problem, 13780 * unsupported CPU modes (like SMM) or potentially corrupt VMCS controls. 13781 * 13782 * See Intel spec. 25.1.3 "Instructions That Cause VM Exits Conditionally". 13760 13783 */ 13761 13784 HMVMX_VALIDATE_EXIT_HANDLER_PARAMS(pVCpu, pVmxTransient); … … 13780 13803 return VERR_EM_INTERPRETER; 13781 13804 AssertMsgFailed(("Unexpected XDTR access\n")); 13782 HMVMX_UNEXPECTED_EXIT_RET(pVCpu, pVmxTransient->uExitReason);13783 }13784 13785 13786 /**13787 * VM-exit handler for RDRAND (VMX_EXIT_RDRAND). Conditional VM-exit.13788 */13789 HMVMX_EXIT_DECL hmR0VmxExitRdrand(PVMCPU pVCpu, PVMXTRANSIENT pVmxTransient)13790 {13791 HMVMX_VALIDATE_EXIT_HANDLER_PARAMS(pVCpu, pVmxTransient);13792 13793 /* By default, we don't enable VMX_PROC_CTLS2_RDRAND_EXIT. */13794 PCVMXVMCSINFO pVmcsInfo = pVmxTransient->pVmcsInfo;13795 if (pVmcsInfo->u32ProcCtls2 & VMX_PROC_CTLS2_RDRAND_EXIT)13796 return VERR_EM_INTERPRETER;13797 AssertMsgFailed(("Unexpected RDRAND exit\n"));13798 13805 HMVMX_UNEXPECTED_EXIT_RET(pVCpu, pVmxTransient->uExitReason); 13799 13806 }
Note:
See TracChangeset
for help on using the changeset viewer.