VirtualBox

Changeset 78647 in vbox for trunk/src


Ignore:
Timestamp:
May 22, 2019 7:53:16 AM (6 years ago)
Author:
vboxsync
Message:

VMM/HMVMXR0: Nested VMX: bugref:9180 Unify several of the undefined VM-exits into one function and add comments to explain each of the cases.
Corrected VM-exit number for VMX_EXIT_PAUSE in comment.
Made INIT signal also an unexpected VM-exit rather than return VINF_SUCCESS.
ENCLS, RSM VM-exits shouldn't really occur but raise UD exception like we do for other such instructions.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/VMM/VMMR0/HMVMXR0.cpp

    r78640 r78647  
    362362static FNVMXEXITHANDLER            hmR0VmxExitExtInt;
    363363static FNVMXEXITHANDLER            hmR0VmxExitTripleFault;
    364 static FNVMXEXITHANDLERNSRC        hmR0VmxExitInitSignal;
    365 static FNVMXEXITHANDLERNSRC        hmR0VmxExitSipi;
    366 static FNVMXEXITHANDLERNSRC        hmR0VmxExitIoSmi;
    367 static FNVMXEXITHANDLERNSRC        hmR0VmxExitSmi;
    368364static FNVMXEXITHANDLERNSRC        hmR0VmxExitIntWindow;
    369365static FNVMXEXITHANDLERNSRC        hmR0VmxExitNmiWindow;
     
    389385#endif
    390386static FNVMXEXITHANDLER            hmR0VmxExitRdtsc;
    391 static FNVMXEXITHANDLERNSRC        hmR0VmxExitRsm;
    392 static FNVMXEXITHANDLERNSRC        hmR0VmxExitSetPendingXcptUD;
    393387static FNVMXEXITHANDLER            hmR0VmxExitMovCRx;
    394388static FNVMXEXITHANDLER            hmR0VmxExitMovDRx;
     
    396390static FNVMXEXITHANDLER            hmR0VmxExitRdmsr;
    397391static FNVMXEXITHANDLER            hmR0VmxExitWrmsr;
    398 static FNVMXEXITHANDLERNSRC        hmR0VmxExitErrInvalidGuestState;
    399 static FNVMXEXITHANDLERNSRC        hmR0VmxExitErrMsrLoad;
    400 static FNVMXEXITHANDLERNSRC        hmR0VmxExitErrUndefined;
    401392static FNVMXEXITHANDLER            hmR0VmxExitMwait;
    402393static FNVMXEXITHANDLER            hmR0VmxExitMtf;
    403394static FNVMXEXITHANDLER            hmR0VmxExitMonitor;
    404395static FNVMXEXITHANDLER            hmR0VmxExitPause;
    405 static FNVMXEXITHANDLERNSRC        hmR0VmxExitErrMachineCheck;
    406396static FNVMXEXITHANDLERNSRC        hmR0VmxExitTprBelowThreshold;
    407397static FNVMXEXITHANDLER            hmR0VmxExitApicAccess;
     
    415405static FNVMXEXITHANDLER            hmR0VmxExitRdrand;
    416406static FNVMXEXITHANDLER            hmR0VmxExitInvpcid;
     407static FNVMXEXITHANDLERNSRC        hmR0VmxExitSetPendingXcptUD;
     408static FNVMXEXITHANDLERNSRC        hmR0VmxExitErrInvalidGuestState;
     409static FNVMXEXITHANDLERNSRC        hmR0VmxExitErrUnexpected;
    417410/** @} */
    418411
     
    495488 /* 01  VMX_EXIT_EXT_INT                 */  hmR0VmxExitExtInt,
    496489 /* 02  VMX_EXIT_TRIPLE_FAULT            */  hmR0VmxExitTripleFault,
    497  /* 03  VMX_EXIT_INIT_SIGNAL             */  hmR0VmxExitInitSignal,
    498  /* 04  VMX_EXIT_SIPI                    */  hmR0VmxExitSipi,
    499  /* 05  VMX_EXIT_IO_SMI                  */  hmR0VmxExitIoSmi,
    500  /* 06  VMX_EXIT_SMI                     */  hmR0VmxExitSmi,
     490 /* 03  VMX_EXIT_INIT_SIGNAL             */  hmR0VmxExitErrUnexpected,
     491 /* 04  VMX_EXIT_SIPI                    */  hmR0VmxExitErrUnexpected,
     492 /* 05  VMX_EXIT_IO_SMI                  */  hmR0VmxExitErrUnexpected,
     493 /* 06  VMX_EXIT_SMI                     */  hmR0VmxExitErrUnexpected,
    501494 /* 07  VMX_EXIT_INT_WINDOW              */  hmR0VmxExitIntWindow,
    502495 /* 08  VMX_EXIT_NMI_WINDOW              */  hmR0VmxExitNmiWindow,
     
    509502 /* 15  VMX_EXIT_RDPMC                   */  hmR0VmxExitRdpmc,
    510503 /* 16  VMX_EXIT_RDTSC                   */  hmR0VmxExitRdtsc,
    511  /* 17  VMX_EXIT_RSM                     */  hmR0VmxExitRsm,
     504 /* 17  VMX_EXIT_RSM                     */  hmR0VmxExitSetPendingXcptUD,
    512505 /* 18  VMX_EXIT_VMCALL                  */  hmR0VmxExitVmcall,
    513506#ifdef VBOX_WITH_NESTED_HWVIRT_VMX
     
    538531 /* 32  VMX_EXIT_WRMSR                   */  hmR0VmxExitWrmsr,
    539532 /* 33  VMX_EXIT_ERR_INVALID_GUEST_STATE */  hmR0VmxExitErrInvalidGuestState,
    540  /* 34  VMX_EXIT_ERR_MSR_LOAD            */  hmR0VmxExitErrMsrLoad,
    541  /* 35  UNDEFINED                        */  hmR0VmxExitErrUndefined,
     533 /* 34  VMX_EXIT_ERR_MSR_LOAD            */  hmR0VmxExitErrUnexpected,
     534 /* 35  UNDEFINED                        */  hmR0VmxExitErrUnexpected,
    542535 /* 36  VMX_EXIT_MWAIT                   */  hmR0VmxExitMwait,
    543536 /* 37  VMX_EXIT_MTF                     */  hmR0VmxExitMtf,
    544  /* 38  UNDEFINED                        */  hmR0VmxExitErrUndefined,
     537 /* 38  UNDEFINED                        */  hmR0VmxExitErrUnexpected,
    545538 /* 39  VMX_EXIT_MONITOR                 */  hmR0VmxExitMonitor,
    546  /* 40  UNDEFINED                        */  hmR0VmxExitPause,
    547  /* 41  VMX_EXIT_PAUSE                   */  hmR0VmxExitErrMachineCheck,
    548  /* 42  VMX_EXIT_ERR_MACHINE_CHECK       */  hmR0VmxExitErrUndefined,
     539 /* 40  VMX_EXIT_PAUSE                   */  hmR0VmxExitPause,
     540 /* 41  VMX_EXIT_ERR_MACHINE_CHECK       */  hmR0VmxExitErrUnexpected,
     541 /* 42  UNDEFINED                        */  hmR0VmxExitErrUnexpected,
    549542 /* 43  VMX_EXIT_TPR_BELOW_THRESHOLD     */  hmR0VmxExitTprBelowThreshold,
    550543 /* 44  VMX_EXIT_APIC_ACCESS             */  hmR0VmxExitApicAccess,
    551  /* 45  UNDEFINED                        */  hmR0VmxExitErrUndefined,
     544 /* 45  VMX_EXIT_VIRTUALIZED_EOI         */  hmR0VmxExitErrUnexpected,
    552545 /* 46  VMX_EXIT_GDTR_IDTR_ACCESS        */  hmR0VmxExitXdtrAccess,
    553546 /* 47  VMX_EXIT_LDTR_TR_ACCESS          */  hmR0VmxExitXdtrAccess,
     
    564557 /* 54  VMX_EXIT_WBINVD                  */  hmR0VmxExitWbinvd,
    565558 /* 55  VMX_EXIT_XSETBV                  */  hmR0VmxExitXsetbv,
    566  /* 56  VMX_EXIT_APIC_WRITE              */  hmR0VmxExitErrUndefined,
     559 /* 56  VMX_EXIT_APIC_WRITE              */  hmR0VmxExitErrUnexpected,
    567560 /* 57  VMX_EXIT_RDRAND                  */  hmR0VmxExitRdrand,
    568561 /* 58  VMX_EXIT_INVPCID                 */  hmR0VmxExitInvpcid,
    569562 /* 59  VMX_EXIT_VMFUNC                  */  hmR0VmxExitSetPendingXcptUD,
    570  /* 60  VMX_EXIT_ENCLS                   */  hmR0VmxExitErrUndefined,
    571  /* 61  VMX_EXIT_RDSEED                  */  hmR0VmxExitErrUndefined, /* only spurious exits, so undefined */
    572  /* 62  VMX_EXIT_PML_FULL                */  hmR0VmxExitErrUndefined,
     563 /* 60  VMX_EXIT_ENCLS                   */  hmR0VmxExitSetPendingXcptUD,
     564 /* 61  VMX_EXIT_RDSEED                  */  hmR0VmxExitSetPendingXcptUD,
     565 /* 62  VMX_EXIT_PML_FULL                */  hmR0VmxExitErrUnexpected,
    573566 /* 63  VMX_EXIT_XSAVES                  */  hmR0VmxExitSetPendingXcptUD,
    574567 /* 64  VMX_EXIT_XRSTORS                 */  hmR0VmxExitSetPendingXcptUD,
     
    1064310636#ifdef HMVMX_ALWAYS_CHECK_GUEST_STATE
    1064410637    /** @todo r=ramshankar: We can now probably use iemVmxVmentryCheckGuestState here.
    10645      *        Add a PVMXMSRS parameter to it, so that IEM can look at the host MSRs. */
     10638     *        Add a PVMXMSRS parameter to it, so that IEM can look at the host MSRs,
     10639     *        see @bugref{9180#c54}. */
    1064610640    uint32_t const uInvalidReason = hmR0VmxCheckGuestState(pVCpu, pVmcsInfo);
    1064710641    if (uInvalidReason != VMX_IGS_REASON_NOT_FOUND)
     
    1169811692        case VMX_EXIT_ERR_MSR_LOAD:
    1169911693        case VMX_EXIT_ERR_MACHINE_CHECK:
     11694        case VMX_EXIT_PML_FULL:
     11695        case VMX_EXIT_VIRTUALIZED_EOI:
    1170011696            break;
    1170111697
     
    1200211998            case VMX_EXIT_ERR_MSR_LOAD:
    1200311999            case VMX_EXIT_ERR_MACHINE_CHECK:
     12000            case VMX_EXIT_PML_FULL:
     12001            case VMX_EXIT_VIRTUALIZED_EOI:
    1200412002            case VMX_EXIT_APIC_WRITE:  /* Some talk about this being fault like, so I guess we must process it? */
    1200512003                break;
     
    1243712435        case VMX_EXIT_INVD:                    VMEXIT_CALL_RET(0, hmR0VmxExitInvd(pVCpu, pVmxTransient));
    1243812436        case VMX_EXIT_INVLPG:                  VMEXIT_CALL_RET(0, hmR0VmxExitInvlpg(pVCpu, pVmxTransient));
    12439         case VMX_EXIT_RSM:                     VMEXIT_CALL_RET(0, hmR0VmxExitRsm(pVCpu, pVmxTransient));
    1244012437        case VMX_EXIT_MTF:                     VMEXIT_CALL_RET(0, hmR0VmxExitMtf(pVCpu, pVmxTransient));
    1244112438        case VMX_EXIT_PAUSE:                   VMEXIT_CALL_RET(0, hmR0VmxExitPause(pVCpu, pVmxTransient));
     
    1247512472        case VMX_EXIT_TRIPLE_FAULT:            return hmR0VmxExitTripleFault(pVCpu, pVmxTransient);
    1247612473        case VMX_EXIT_NMI_WINDOW:              return hmR0VmxExitNmiWindow(pVCpu, pVmxTransient);
    12477         case VMX_EXIT_INIT_SIGNAL:             return hmR0VmxExitInitSignal(pVCpu, pVmxTransient);
    12478         case VMX_EXIT_SIPI:                    return hmR0VmxExitSipi(pVCpu, pVmxTransient);
    12479         case VMX_EXIT_IO_SMI:                  return hmR0VmxExitIoSmi(pVCpu, pVmxTransient);
    12480         case VMX_EXIT_SMI:                     return hmR0VmxExitSmi(pVCpu, pVmxTransient);
    12481         case VMX_EXIT_ERR_MSR_LOAD:            return hmR0VmxExitErrMsrLoad(pVCpu, pVmxTransient);
    1248212474        case VMX_EXIT_ERR_INVALID_GUEST_STATE: return hmR0VmxExitErrInvalidGuestState(pVCpu, pVmxTransient);
    12483         case VMX_EXIT_ERR_MACHINE_CHECK:       return hmR0VmxExitErrMachineCheck(pVCpu, pVmxTransient);
    12484 
     12475
     12476        case VMX_EXIT_RSM:
     12477        case VMX_EXIT_RDSEED:
     12478        case VMX_EXIT_ENCLS:
    1248512479        case VMX_EXIT_INVEPT:
    1248612480        case VMX_EXIT_VMFUNC:
     
    1248912483            return hmR0VmxExitSetPendingXcptUD(pVCpu, pVmxTransient);
    1249012484
    12491         case VMX_EXIT_ENCLS:
    12492         case VMX_EXIT_RDSEED:
     12485        case VMX_EXIT_INIT_SIGNAL:
     12486        case VMX_EXIT_SIPI:
     12487        case VMX_EXIT_IO_SMI:
     12488        case VMX_EXIT_SMI:
     12489        case VMX_EXIT_ERR_MSR_LOAD:
     12490        case VMX_EXIT_ERR_MACHINE_CHECK:
    1249312491        case VMX_EXIT_PML_FULL:
     12492        case VMX_EXIT_VIRTUALIZED_EOI:
     12493        case VMX_EXIT_APIC_WRITE:
    1249412494        default:
    12495             return hmR0VmxExitErrUndefined(pVCpu, pVmxTransient);
     12495            return hmR0VmxExitErrUnexpected(pVCpu, pVmxTransient);
    1249612496    }
    1249712497#undef VMEXIT_CALL_RET
     
    1270712707        }
    1270812708
    12709         case VMX_EXIT_APIC_ACCESS:
    12710         case VMX_EXIT_XCPT_OR_NMI:
    12711         case VMX_EXIT_MOV_CRX:
    12712         case VMX_EXIT_EXT_INT:
    12713         case VMX_EXIT_INT_WINDOW:
    12714         case VMX_EXIT_TPR_BELOW_THRESHOLD:
    12715         case VMX_EXIT_MWAIT:
    12716         case VMX_EXIT_MONITOR:
    12717         case VMX_EXIT_PREEMPT_TIMER:
    12718 
    1271912709        case VMX_EXIT_RDMSR:
    1272012710        {
     
    1279012780        }
    1279112781
     12782        case VMX_EXIT_MTF:
     12783        {
     12784            /** @todo NSTVMX: Should consider debugging nested-guests using VM debugger. */
     12785            rcStrict = IEMExecVmxVmexit(pVCpu, uExitReason);
     12786            break;
     12787        }
     12788
     12789        case VMX_EXIT_APIC_ACCESS:
     12790        case VMX_EXIT_XCPT_OR_NMI:
     12791        case VMX_EXIT_MOV_CRX:
     12792        case VMX_EXIT_EXT_INT:
     12793        case VMX_EXIT_INT_WINDOW:
     12794        case VMX_EXIT_TPR_BELOW_THRESHOLD:
     12795        case VMX_EXIT_MWAIT:
     12796        case VMX_EXIT_MONITOR:
     12797        case VMX_EXIT_PAUSE:
     12798        case VMX_EXIT_PREEMPT_TIMER:
    1279212799        case VMX_EXIT_MOV_DRX:
    12793         case VMX_EXIT_RSM:
    12794         case VMX_EXIT_MTF:
    12795         case VMX_EXIT_PAUSE:
    1279612800        case VMX_EXIT_GDTR_IDTR_ACCESS:
    1279712801        case VMX_EXIT_LDTR_TR_ACCESS:
     
    1280012804        case VMX_EXIT_VMREAD:
    1280112805        case VMX_EXIT_VMWRITE:
     12806        case VMX_EXIT_RSM:
     12807        case VMX_EXIT_RDSEED:
     12808        case VMX_EXIT_ENCLS:
     12809        case VMX_EXIT_VMFUNC:
     12810        case VMX_EXIT_XSAVES:
     12811        case VMX_EXIT_XRSTORS:
     12812
    1280212813        case VMX_EXIT_TRIPLE_FAULT:
    1280312814        case VMX_EXIT_NMI_WINDOW:
     12815        case VMX_EXIT_ERR_INVALID_GUEST_STATE:
     12816
    1280412817        case VMX_EXIT_INIT_SIGNAL:
    1280512818        case VMX_EXIT_SIPI:
     
    1280712820        case VMX_EXIT_SMI:
    1280812821        case VMX_EXIT_ERR_MSR_LOAD:
    12809         case VMX_EXIT_ERR_INVALID_GUEST_STATE:
    1281012822        case VMX_EXIT_ERR_MACHINE_CHECK:
    12811 
    12812         case VMX_EXIT_VMFUNC:
    12813         case VMX_EXIT_XSAVES:
    12814         case VMX_EXIT_XRSTORS:
    12815 
    12816         case VMX_EXIT_ENCLS:
    12817         case VMX_EXIT_RDSEED:
    1281812823        case VMX_EXIT_PML_FULL:
     12824        case VMX_EXIT_VIRTUALIZED_EOI:
     12825        case VMX_EXIT_APIC_WRITE:
    1281912826        default:
    12820             rcStrict = hmR0VmxExitErrUndefined(pVCpu, pVmxTransient);
     12827            rcStrict = hmR0VmxExitErrUnexpected(pVCpu, pVmxTransient);
    1282112828            break;
    1282212829    }
     
    1364813655
    1364913656/**
    13650  * VM-exit handler for RSM (VMX_EXIT_RSM). Unconditional VM-exit.
    13651  */
    13652 HMVMX_EXIT_NSRC_DECL hmR0VmxExitRsm(PVMCPU pVCpu, PVMXTRANSIENT pVmxTransient)
    13653 {
    13654     /*
    13655      * Execution of RSM outside of SMM mode causes #UD regardless of VMX root or VMX non-root
    13656      * mode. In theory, we should never get this VM-exit. This can happen only if dual-monitor
    13657      * treatment of SMI and VMX is enabled, which can (only?) be done by executing VMCALL in
    13658      * VMX root operation. If we get here, something funny is going on.
    13659      *
    13660      * See Intel spec. 33.15.5 "Enabling the Dual-Monitor Treatment".
    13661      */
    13662     HMVMX_VALIDATE_EXIT_HANDLER_PARAMS(pVCpu, pVmxTransient);
    13663     AssertMsgFailed(("Unexpected RSM VM-exit\n"));
    13664     HMVMX_UNEXPECTED_EXIT_RET(pVCpu, pVmxTransient);
    13665 }
    13666 
    13667 
    13668 /**
    13669  * VM-exit handler for SMI (VMX_EXIT_SMI). Unconditional VM-exit.
    13670  */
    13671 HMVMX_EXIT_NSRC_DECL hmR0VmxExitSmi(PVMCPU pVCpu, PVMXTRANSIENT pVmxTransient)
    13672 {
    13673     /*
    13674      * This can only happen if we support dual-monitor treatment of SMI, which can be activated
    13675      * by executing VMCALL in VMX root operation. Only an STM (SMM transfer monitor) would get
    13676      * this VM-exit when we (the executive monitor) execute a VMCALL in VMX root mode or receive
    13677      * an SMI. If we get here, something funny is going on.
    13678      *
    13679      * See Intel spec. 33.15.6 "Activating the Dual-Monitor Treatment"
    13680      * See Intel spec. 25.3 "Other Causes of VM-Exits"
    13681      */
    13682     HMVMX_VALIDATE_EXIT_HANDLER_PARAMS(pVCpu, pVmxTransient);
    13683     AssertMsgFailed(("Unexpected SMI VM-exit\n"));
    13684     HMVMX_UNEXPECTED_EXIT_RET(pVCpu, pVmxTransient);
    13685 }
    13686 
    13687 
    13688 /**
    13689  * VM-exit handler for IO SMI (VMX_EXIT_IO_SMI). Unconditional VM-exit.
    13690  */
    13691 HMVMX_EXIT_NSRC_DECL hmR0VmxExitIoSmi(PVMCPU pVCpu, PVMXTRANSIENT pVmxTransient)
    13692 {
    13693     /* Same treatment as VMX_EXIT_SMI. See comment in hmR0VmxExitSmi(). */
    13694     HMVMX_VALIDATE_EXIT_HANDLER_PARAMS(pVCpu, pVmxTransient);
    13695     AssertMsgFailed(("Unexpected IO SMI VM-exit\n"));
    13696     HMVMX_UNEXPECTED_EXIT_RET(pVCpu, pVmxTransient);
    13697 }
    13698 
    13699 
    13700 /**
    13701  * VM-exit handler for SIPI (VMX_EXIT_SIPI). Conditional VM-exit.
    13702  */
    13703 HMVMX_EXIT_NSRC_DECL hmR0VmxExitSipi(PVMCPU pVCpu, PVMXTRANSIENT pVmxTransient)
    13704 {
    13705     /*
    13706      * SIPI exits can only occur in VMX non-root operation when the "wait-for-SIPI" guest activity state is used.
    13707      * We don't make use of it as our guests don't have direct access to the host LAPIC.
    13708      * See Intel spec. 25.3 "Other Causes of VM-exits".
    13709      */
    13710     HMVMX_VALIDATE_EXIT_HANDLER_PARAMS(pVCpu, pVmxTransient);
    13711     AssertMsgFailed(("Unexpected SIPI VM-exit\n"));
    13712     HMVMX_UNEXPECTED_EXIT_RET(pVCpu, pVmxTransient);
    13713 }
    13714 
    13715 
    13716 /**
    13717  * VM-exit handler for INIT signal (VMX_EXIT_INIT_SIGNAL). Unconditional
    13718  * VM-exit.
    13719  */
    13720 HMVMX_EXIT_NSRC_DECL hmR0VmxExitInitSignal(PVMCPU pVCpu, PVMXTRANSIENT pVmxTransient)
    13721 {
    13722     /*
    13723      * INIT signals are blocked in VMX root operation by VMXON and by SMI in SMM.
    13724      * See Intel spec. 33.14.1 Default Treatment of SMI Delivery" and Intel spec. 29.3 "VMX Instructions" for "VMXON".
    13725      *
    13726      * It is -NOT- blocked in VMX non-root operation so we can, in theory, still get these VM-exits.
    13727      * See Intel spec. "23.8 Restrictions on VMX operation".
    13728      */
    13729     HMVMX_VALIDATE_EXIT_HANDLER_PARAMS(pVCpu, pVmxTransient);
    13730     return VINF_SUCCESS;
    13731 }
    13732 
    13733 
    13734 /**
    1373513657 * VM-exit handler for triple faults (VMX_EXIT_TRIPLE_FAULT). Unconditional
    1373613658 * VM-exit.
     
    1388213804}
    1388313805
    13884 
    13885 /**
    13886  * VM-exit handler for VM-entry failure due to an MSR-load
    13887  * (VMX_EXIT_ERR_MSR_LOAD). Error VM-exit.
    13888  */
    13889 HMVMX_EXIT_NSRC_DECL hmR0VmxExitErrMsrLoad(PVMCPU pVCpu, PVMXTRANSIENT pVmxTransient)
    13890 {
    13891     AssertMsgFailed(("Unexpected MSR-load exit\n"));
     13806/**
     13807 * VM-exit handler for all undefined/unexpected reasons. Should never happen.
     13808 */
     13809HMVMX_EXIT_NSRC_DECL hmR0VmxExitErrUnexpected(PVMCPU pVCpu, PVMXTRANSIENT pVmxTransient)
     13810{
     13811    /*
     13812     * Cummulative notes of all recognized but unexpected VM-exits.
     13813     * This does -not- cover those VM-exits like a page-fault occurring when say nested-paging
     13814     * is used.
     13815     *
     13816     * VMX_EXIT_INIT_SIGNAL:
     13817     *    INIT signals are blocked in VMX root operation by VMXON and by SMI in SMM.
     13818     *    It is -NOT- blocked in VMX non-root operation so we can, in theory, still get these
     13819     *    VM-exits. However, we should not receive INIT signals VM-exit while executing a VM.
     13820     *
     13821     *    See Intel spec. 33.14.1 Default Treatment of SMI Delivery"
     13822     *    See Intel spec. 29.3 "VMX Instructions" for "VMXON".
     13823     *    See Intel spec. "23.8 Restrictions on VMX operation".
     13824     *
     13825     * VMX_EXIT_SIPI:
     13826     *    SIPI exits can only occur in VMX non-root operation when the "wait-for-SIPI" guest
     13827     *    activity state is used. We don't make use of it as our guests don't have direct
     13828     *    access to the host local APIC.
     13829     *
     13830     *    See Intel spec. 25.3 "Other Causes of VM-exits".
     13831     *
     13832     * VMX_EXIT_IO_SMI:
     13833     * VMX_EXIT_SMI:
     13834     *    This can only happen if we support dual-monitor treatment of SMI, which can be
     13835     *    activated by executing VMCALL in VMX root operation. Only an STM (SMM transfer
     13836     *    monitor) would get this VM-exit when we (the executive monitor) execute a VMCALL in
     13837     *    VMX root mode or receive an SMI. If we get here, something funny is going on.
     13838     *
     13839     *    See Intel spec. 33.15.6 "Activating the Dual-Monitor Treatment"
     13840     *    See Intel spec. 25.3 "Other Causes of VM-Exits"
     13841     *
     13842     * VMX_EXIT_ERR_MACHINE_CHECK:
     13843     *    Machine check exceptions indicates a fatal/unrecoverable hardware condition
     13844     *    including but not limited to system bus, ECC, parity, cache and TLB errors. A
     13845     *    #MC exception abort class exception is raised. We thus cannot assume a
     13846     *    reasonable chance of continuing any sort of execution and we bail.
     13847     *
     13848     *    See Intel spec. 15.1 "Machine-check Architecture".
     13849     *    See Intel spec. 27.1 "Architectural State Before A VM Exit".
     13850     *
     13851     * VMX_EXIT_ERR_MSR_LOAD:
     13852     *    Failures while loading MSRs are part of the VM-entry MSR-load area are unexpected
     13853     *    and typically indicates a bug in the hypervisor code. We thus cannot not resume
     13854     *    execution.
     13855     *
     13856     *    See Intel spec. 26.7 "VM-Entry Failures During Or After Loading Guest State".
     13857     *
     13858     * VMX_EXIT_PML_FULL:
     13859     * VMX_EXIT_VIRTUALIZED_EOI:
     13860     * VMX_EXIT_APIC_WRITE:
     13861     *    We do not currently support any of these features and thus they are all unexpected
     13862     *    VM-exits.
     13863     */
     13864    HMVMX_VALIDATE_EXIT_HANDLER_PARAMS(pVCpu, pVmxTransient);
     13865    AssertMsgFailed(("Unexpected VM-exit %u\n", pVmxTransient->uExitReason));
    1389213866    HMVMX_UNEXPECTED_EXIT_RET(pVCpu, pVmxTransient);
    13893 }
    13894 
    13895 
    13896 /**
    13897  * VM-exit handler for VM-entry failure due to a machine-check event
    13898  * (VMX_EXIT_ERR_MACHINE_CHECK). Error VM-exit.
    13899  */
    13900 HMVMX_EXIT_NSRC_DECL hmR0VmxExitErrMachineCheck(PVMCPU pVCpu, PVMXTRANSIENT pVmxTransient)
    13901 {
    13902     AssertMsgFailed(("Unexpected machine-check event exit\n"));
    13903     HMVMX_UNEXPECTED_EXIT_RET(pVCpu, pVmxTransient);
    13904 }
    13905 
    13906 
    13907 /**
    13908  * VM-exit handler for all undefined reasons. Should never ever happen.. in
    13909  * theory.
    13910  */
    13911 HMVMX_EXIT_NSRC_DECL hmR0VmxExitErrUndefined(PVMCPU pVCpu, PVMXTRANSIENT pVmxTransient)
    13912 {
    13913     RT_NOREF2(pVCpu, pVmxTransient);
    13914     AssertMsgFailed(("Huh!? Undefined VM-exit reason %d\n", pVmxTransient->uExitReason));
    13915     return VERR_VMX_UNDEFINED_EXIT_CODE;
    1391613867}
    1391713868
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette