VirtualBox

Ignore:
Timestamp:
Apr 10, 2013 8:25:33 PM (12 years ago)
Author:
vboxsync
Message:

VMM: Remove unused error codes, use more specific error codes. Restore CR4 on VMXON failures in the new VT-x code.

File:
1 edited

Legend:

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

    r45467 r45474  
    387387 * @param    pVM        Pointer to the VM.
    388388 * @param    pVCpu      Pointer to the VMCPU (can be NULL if @a rc is not
    389  *                      VERR_VMX_GENERIC).
     389 *                      VERR_VMX_UNABLE_TO_START_VM or
     390 *                      VERR_VMX_INVALID_VMCS_FIELD).
    390391 * @param    rc         The error code.
    391392 */
     
    393394{
    394395    AssertPtr(pVM);
    395     if (rc == VERR_VMX_GENERIC)
     396    if (   rc == VERR_VMX_INVALID_VMCS_FIELD
     397        || rc == VERR_VMX_UNABLE_TO_START_VM)
    396398    {
    397399        AssertPtrReturnVoid(pVCpu);
     
    603605    /* Enter VMXON root mode. */
    604606    int rc = VMXEnable(HCPhysCpuPage);
     607    if (RT_FAILURE(rc))
     608        ASMSetCR4(uCr4);
    605609
    606610    /* Restore interrupts. */
     
    15331537    /* Enable the VMX preemption timer. */
    15341538    if (pVM->hm.s.vmx.fUsePreemptTimer)
     1539    {
     1540        Assert(pVM->hm.s.vmx.msr.vmx_pin_ctls.n.allowed1 & VMX_VMCS_CTRL_PIN_EXEC_CONTROLS_PREEMPT_TIMER);
    15351541        val |= VMX_VMCS_CTRL_PIN_EXEC_CONTROLS_PREEMPT_TIMER;
     1542    }
    15361543
    15371544    if ((val & zap) != val)
     
    16571664     * Secondary processor-based VM-execution controls.
    16581665     */
    1659     if (pVCpu->hm.s.vmx.u32ProcCtls & VMX_VMCS_CTRL_PROC_EXEC_USE_SECONDARY_EXEC_CTRL)
     1666    if (RT_LIKELY(pVCpu->hm.s.vmx.u32ProcCtls & VMX_VMCS_CTRL_PROC_EXEC_USE_SECONDARY_EXEC_CTRL))
    16601667    {
    16611668        val = pVM->hm.s.vmx.msr.vmx_proc_ctls2.n.disallowed0;           /* Bits set here must be set in the VMCS. */
     
    37413748            AssertFailed();
    37423749            break;
    3743         case VINF_SUCCESS:      /* VMLAUNCH/VMRESUME succeeded but VM-entry failed... yeah, true story. */
    3744         case VERR_VMX_UNABLE_TO_START_VM:
    3745         case VERR_VMX_UNABLE_TO_RESUME_VM:
     3750        case VINF_SUCCESS:                  /* VMLAUNCH/VMRESUME succeeded but VM-entry failed... yeah, true story. */
     3751        case VERR_VMX_UNABLE_TO_START_VM:   /* VMLAUNCH/VMRESUME itself failed. */
    37463752        {
    37473753            int rc = VMXReadVmcs32(VMX_VMCS32_RO_EXIT_REASON, &pVCpu->hm.s.vmx.lasterror.u32ExitReason);
     
    40994105        ASMSetCR4(ASMGetCR4() & ~X86_CR4_VMXE);
    41004106        ASMSetFlags(uOldEFlags);
    4101         return VERR_VMX_VMXON_FAILED;
     4107        return rc2;
    41024108    }
    41034109
     
    69246930
    69256931/**
    6926  * VM-exit handler for WBINVD (VMX_EXIT_INVD). Unconditional VM-exit.
     6932 * VM-exit handler for INVD (VMX_EXIT_INVD). Unconditional VM-exit.
    69276933 */
    69286934static DECLCALLBACK(int) hmR0VmxExitInvd(PVM pVM, PVMCPU pVCpu, PCPUMCTX pMixedCtx, PVMXTRANSIENT pVmxTransient)
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