VirtualBox

Changeset 45474 in vbox


Ignore:
Timestamp:
Apr 10, 2013 8:25:33 PM (12 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
84919
Message:

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

Location:
trunk
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/VBox/err.h

    r45434 r45474  
    18581858/** Invalid VMXON pointer. */
    18591859#define VERR_VMX_INVALID_VMXON_PTR                  (-4002)
    1860 /** Generic VMX failure. */
    1861 #define VERR_VMX_GENERIC                            (-4003)
    18621860/** Invalid CPU mode for VMX execution. */
    18631861#define VERR_VMX_UNSUPPORTED_MODE                   (-4004)
    18641862/** Unable to start VM execution. */
    18651863#define VERR_VMX_UNABLE_TO_START_VM                 (-4005)
    1866 /** Unable to resume VM execution. */
    1867 #define VERR_VMX_UNABLE_TO_RESUME_VM                (-4006)
    18681864/** Unable to switch due to invalid host state. */
    18691865#define VERR_VMX_INVALID_HOST_STATE                 (-4007)
     
    18941890/** Resume guest execution after injecting a double-fault. */
    18951891#define VINF_VMX_DOUBLE_FAULT                       4020
     1892/** VMPTRLD failed; possibly because of invalid VMCS launch-state. */
     1893#define VERR_VMX_VMPTRLD_FAILED                     (-4021)
    18961894/** @} */
    18971895
  • trunk/include/VBox/err.mac

    r43387 r45474  
    682682%define VERR_VMX_INVALID_VMCS_PTR    (-4001)
    683683%define VERR_VMX_INVALID_VMXON_PTR    (-4002)
    684 %define VERR_VMX_GENERIC    (-4003)
    685684%define VERR_VMX_UNSUPPORTED_MODE    (-4004)
    686685%define VERR_VMX_UNABLE_TO_START_VM    (-4005)
     
    698697%define VERR_VMX_UNEXPECTED_INTERRUPTION_EXIT_CODE    (-4017)
    699698%define VERR_VMX_NOT_IN_VMX_ROOT_MODE    (-4018)
     699%define VERR_VMX_UNDEFINED_EXIT_CODE     (-4019)
     700%define VINF_VMX_DOUBLE_FAULT              4020
     701%define VERR_VMX_VMPTRLD_FAILED          (-4021)
    700702%define VERR_SVM_UNABLE_TO_START_VM    (-4050)
    701703%define VERR_SVM_ILLEGAL_EFER_MSR    (-4051)
  • trunk/include/VBox/vmm/hm_vmx.h

    r45411 r45474  
    14731473       "jmp      2f                                             \n\t"
    14741474       "1:                                                      \n\t"
    1475        "movl     $"STR(VERR_VMX_GENERIC)", %0                   \n\t"
     1475       "movl     $"STR(VERR_VMX_VMXON_FAILED)", %0              \n\t"
    14761476       "2:                                                      \n\t"
    14771477       "add      $8, %%esp                                      \n\t"
     
    14981498vmxon_good:
    14991499        jnz     the_end
    1500         mov     dword ptr [rc], VERR_VMX_GENERIC
     1500        mov     dword ptr [rc], VERR_VMX_VMXON_FAILED
    15011501the_end:
    15021502        add     esp, 8
  • trunk/src/VBox/VMM/VMMR0/HMR0A.asm

    r44771 r45474  
    567567.good:
    568568    jnz     .the_end
    569     mov     eax, VERR_VMX_GENERIC
     569    mov     eax, VERR_VMX_VMXON_FAILED
    570570
    571571.the_end:
  • 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)
  • trunk/src/VBox/VMM/VMMR0/HWVMXR0.cpp

    r45453 r45474  
    179179static void hmR0VmxCheckError(PVM pVM, PVMCPU pVCpu, int rc)
    180180{
    181     if (rc == VERR_VMX_GENERIC)
     181    if (   rc == VERR_VMX_UNABLE_TO_START_VM
     182        || rc == VERR_VMX_INVALID_VMCS_FIELD)
    182183    {
    183184        RTCCUINTREG instrError;
     
    535536                 */
    536537                pVM->hm.s.vmx.enmFlushEpt = VMX_FLUSH_EPT_NOT_SUPPORTED;
    537                 return VERR_VMX_GENERIC;
     538                return VERR_HM_UNSUPPORTED_CPU_FEATURE_COMBO;
    538539            }
    539540        }
     
    544545             */
    545546            pVM->hm.s.vmx.enmFlushEpt = VMX_FLUSH_EPT_NOT_SUPPORTED;
    546             return VERR_VMX_GENERIC;
     547            return VERR_HM_UNSUPPORTED_CPU_FEATURE_COMBO;
    547548        }
    548549    }
     
    52855286
    52865287        case VERR_VMX_UNABLE_TO_START_VM:
    5287         case VERR_VMX_UNABLE_TO_RESUME_VM:
    52885288        {
    52895289            int         rc2;
  • trunk/src/VBox/VMM/VMMR3/HM.cpp

    r45457 r45474  
    26342634                break;
    26352635
    2636             case VERR_VMX_UNABLE_TO_RESUME_VM:
    2637                 LogRel(("HM: VERR_VMX_UNABLE_TO_RESUME_VM:\n"));
    2638                 LogRel(("HM: CPU%d instruction error %x\n", i, pVM->aCpus[i].hm.s.vmx.lasterror.u32InstrError));
    2639                 LogRel(("HM: CPU%d exit reason       %x\n", i, pVM->aCpus[i].hm.s.vmx.lasterror.u32ExitReason));
    2640                 break;
    2641 
    26422636            case VERR_VMX_INVALID_VMXON_PTR:
    26432637                break;
  • trunk/src/VBox/VMM/VMMRC/HMRCA.asm

    r44771 r45474  
    113113.vmxon_success:
    114114    jnz     .vmxon_success2
    115     mov     rax, VERR_VMX_GENERIC
     115    mov     rax, VERR_VMX_VMXON_FAILED
    116116    jmp     .vmstart64_vmxon_failed
    117117
     
    125125.vmptrld_success:
    126126    jnz     .vmptrld_success2
    127     mov     rax, VERR_VMX_GENERIC
     127    mov     rax, VERR_VMX_VMPTRLD_FAILED
    128128    jmp     .vmstart64_vmxoff_end
    129129
  • trunk/src/VBox/VMM/include/EMHandleRCTmpl.h

    r44362 r45474  
    346346        case VERR_VMX_INVALID_GUEST_STATE:
    347347        case VERR_VMX_UNABLE_TO_START_VM:
    348         case VERR_VMX_UNABLE_TO_RESUME_VM:
    349348            HMR3CheckError(pVM, rc);
    350349            break;
Note: See TracChangeset for help on using the changeset viewer.

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