VirtualBox

Changeset 47066 in vbox for trunk


Ignore:
Timestamp:
Jul 10, 2013 9:50:29 AM (12 years ago)
Author:
vboxsync
Message:

VMM/HMVMXR0: More validations for the error code valid bit.

File:
1 edited

Legend:

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

    r47062 r47066  
    64306430    const uint32_t uIntrType = VMX_EXIT_INTERRUPTION_INFO_TYPE(u32IntrInfo);
    64316431
     6432#ifdef VBOX_STRICT
     6433    /* Validate the error-code-valid bit for hardware exceptions. */
     6434    if (uIntrType == VMX_EXIT_INTERRUPTION_INFO_TYPE_HW_XCPT)
     6435    {
     6436        switch (uVector)
     6437        {
     6438            case X86_XCPT_PF:
     6439            case X86_XCPT_DF:
     6440            case X86_XCPT_TS:
     6441            case X86_XCPT_NP:
     6442            case X86_XCPT_SS:
     6443            case X86_XCPT_GP:
     6444            case X86_XCPT_AC:
     6445                AssertMsg(VMX_EXIT_INTERRUPTION_INFO_ERROR_CODE_IS_VALID(u32IntrInfo),
     6446                          ("Error-code-valid bit not set for exception that has an error code uVector=%#x\n", uVector));
     6447                /* fallthru */
     6448            default:
     6449                break;
     6450        }
     6451    }
     6452#endif
     6453
    64326454    /* Cannot inject an NMI when block-by-MOV SS is in effect. */
    64336455    Assert(   uIntrType != VMX_EXIT_INTERRUPTION_INFO_TYPE_NMI
     
    64816503            /* Software exceptions (#BP and #OF exceptions thrown as a result of INT3 or INTO) */
    64826504            uint16_t uGuestIp = pMixedCtx->ip;
    6483             if (VMX_EXIT_INTERRUPTION_INFO_TYPE(u32IntrInfo) == VMX_EXIT_INTERRUPTION_INFO_TYPE_SW_XCPT)
     6505            if (uIntrType == VMX_EXIT_INTERRUPTION_INFO_TYPE_SW_XCPT)
    64846506            {
    64856507                Assert(uVector == X86_XCPT_BP || uVector == X86_XCPT_OF);
     
    64876509                uGuestIp = pMixedCtx->ip + (uint16_t)cbInstr;
    64886510            }
    6489             else if (VMX_EXIT_INTERRUPTION_INFO_TYPE(u32IntrInfo) == VMX_EXIT_INTERRUPTION_INFO_TYPE_SW_INT)
     6511            else if (uIntrType == VMX_EXIT_INTERRUPTION_INFO_TYPE_SW_INT)
    64906512                uGuestIp = pMixedCtx->ip + (uint16_t)cbInstr;
    64916513
     
    65116533                pMixedCtx->cs.Sel      = selIdtEntry;
    65126534                pMixedCtx->cs.u64Base  = selIdtEntry << cbIdtEntry;
    6513                 if (   VMX_EXIT_INTERRUPTION_INFO_TYPE(u32IntrInfo) == VMX_EXIT_INTERRUPTION_INFO_TYPE_HW_XCPT
    6514                     && uVector == X86_XCPT_PF)
     6535                if (   uIntrType == VMX_EXIT_INTERRUPTION_INFO_TYPE_HW_XCPT
     6536                    && uVector   == X86_XCPT_PF)
    65156537                {
    65166538                    pMixedCtx->cr2 = GCPtrFaultAddress;
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