VirtualBox

Changeset 74360 in vbox for trunk


Ignore:
Timestamp:
Sep 19, 2018 8:43:05 AM (6 years ago)
Author:
vboxsync
Message:

VMM/HMVMXR0: Use VMX_ENTRY macros now that we have them in places where we are dealing with VM-entry interruption information.
Makes code easier to use despite the macros being mostly the same.

File:
1 edited

Legend:

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

    r74307 r74360  
    76837683         * See Intel spec. 26.6.5 "Interrupt-Window Exiting and Virtual-Interrupt Delivery".
    76847684         */
    7685         uint32_t const uIntType = VMX_EXIT_INT_INFO_TYPE(pVCpu->hm.s.Event.u64IntInfo);
     7685        uint32_t const uIntType = VMX_ENTRY_INT_INFO_TYPE(pVCpu->hm.s.Event.u64IntInfo);
    76867686#ifdef VBOX_STRICT
    7687         if (uIntType == VMX_EXIT_INT_INFO_TYPE_EXT_INT)
     7687        if (uIntType == VMX_ENTRY_INT_INFO_TYPE_EXT_INT)
    76887688        {
    76897689            bool const fBlockInt = !(pCtx->eflags.u32 & X86_EFL_IF);
     
    76927692            Assert(!fBlockMovSS);
    76937693        }
    7694         else if (uIntType == VMX_EXIT_INT_INFO_TYPE_NMI)
     7694        else if (uIntType == VMX_ENTRY_INT_INFO_TYPE_NMI)
    76957695        {
    76967696            bool const fBlockNmi = RT_BOOL(fIntrState & VMX_VMCS_GUEST_INT_STATE_BLOCK_NMI);
     
    77127712        fBlockSti   = RT_BOOL(fIntrState & VMX_VMCS_GUEST_INT_STATE_BLOCK_STI);
    77137713
    7714         if (uIntType == VMX_EXIT_INT_INFO_TYPE_EXT_INT)
     7714        if (uIntType == VMX_ENTRY_INT_INFO_TYPE_EXT_INT)
    77157715            STAM_COUNTER_INC(&pVCpu->hm.s.StatInjectInterrupt);
    77167716        else
     
    78727872    PCPUMCTX       pCtx       = &pVCpu->cpum.GstCtx;
    78737873    uint32_t       u32IntInfo = (uint32_t)u64IntInfo;
    7874     uint32_t const uVector    = VMX_EXIT_INT_INFO_VECTOR(u32IntInfo);
    7875     uint32_t const uIntType   = VMX_EXIT_INT_INFO_TYPE(u32IntInfo);
     7874    uint32_t const uVector    = VMX_ENTRY_INT_INFO_VECTOR(u32IntInfo);
     7875    uint32_t const uIntType   = VMX_ENTRY_INT_INFO_TYPE(u32IntInfo);
    78767876
    78777877#ifdef VBOX_STRICT
     
    78947894            case X86_XCPT_GP:
    78957895            case X86_XCPT_AC:
    7896                 AssertMsg(VMX_EXIT_INT_INFO_IS_ERROR_CODE_VALID(u32IntInfo),
     7896                AssertMsg(VMX_ENTRY_INT_INFO_IS_ERROR_CODE_VALID(u32IntInfo),
    78977897                          ("Error-code-valid bit not set for exception that has an error code uVector=%#x\n", uVector));
    78987898                RT_FALL_THRU();
     
    79277927             * See Intel spec. 26.2.1.3 "VM-Entry Control Fields".
    79287928             */
    7929             u32IntInfo &= ~VMX_EXIT_INT_INFO_ERROR_CODE_VALID;
     7929            u32IntInfo &= ~VMX_ENTRY_INT_INFO_ERROR_CODE_VALID;
    79307930        }
    79317931        else
     
    79637963            /* Software exceptions (#BP and #OF exceptions thrown as a result of INT3 or INTO) */
    79647964            uint16_t uGuestIp = pCtx->ip;
    7965             if (uIntType == VMX_EXIT_INT_INFO_TYPE_SW_XCPT)
     7965            if (uIntType == VMX_ENTRY_INT_INFO_TYPE_SW_XCPT)
    79667966            {
    79677967                Assert(uVector == X86_XCPT_BP || uVector == X86_XCPT_OF);
     
    79697969                uGuestIp = pCtx->ip + (uint16_t)cbInstr;
    79707970            }
    7971             else if (uIntType == VMX_EXIT_INT_INFO_TYPE_SW_INT)
     7971            else if (uIntType == VMX_ENTRY_INT_INFO_TYPE_SW_INT)
    79727972                uGuestIp = pCtx->ip + (uint16_t)cbInstr;
    79737973
     
    79947994                pCtx->cs.ValidSel = IdtEntry.uSel;
    79957995                pCtx->cs.u64Base  = IdtEntry.uSel << cbIdtEntry;
    7996                 if (   uIntType == VMX_EXIT_INT_INFO_TYPE_HW_XCPT
     7996                if (   uIntType == VMX_ENTRY_INT_INFO_TYPE_HW_XCPT
    79977997                    && uVector  == X86_XCPT_PF)
    79987998                    pCtx->cr2 = GCPtrFaultAddress;
     
    80078007                if (*pfIntrState & VMX_VMCS_GUEST_INT_STATE_BLOCK_STI)
    80088008                {
    8009                     Assert(   uIntType != VMX_EXIT_INT_INFO_TYPE_NMI
    8010                            && uIntType != VMX_EXIT_INT_INFO_TYPE_EXT_INT);
     8009                    Assert(   uIntType != VMX_ENTRY_INT_INFO_TYPE_NMI
     8010                           && uIntType != VMX_ENTRY_INT_INFO_TYPE_EXT_INT);
    80118011                    Log4Func(("Clearing inhibition due to STI\n"));
    80128012                    *pfIntrState &= ~VMX_VMCS_GUEST_INT_STATE_BLOCK_STI;
     
    80358035    /* Inject. */
    80368036    int rc = VMXWriteVmcs32(VMX_VMCS32_CTRL_ENTRY_INTERRUPTION_INFO, u32IntInfo);
    8037     if (VMX_EXIT_INT_INFO_IS_ERROR_CODE_VALID(u32IntInfo))
     8037    if (VMX_ENTRY_INT_INFO_IS_ERROR_CODE_VALID(u32IntInfo))
    80388038        rc |= VMXWriteVmcs32(VMX_VMCS32_CTRL_ENTRY_EXCEPTION_ERRCODE, u32ErrCode);
    80398039    rc |= VMXWriteVmcs32(VMX_VMCS32_CTRL_ENTRY_INSTR_LENGTH, cbInstr);
     
    80418041
    80428042    /* Update CR2. */
    8043     if (   VMX_EXIT_INT_INFO_TYPE(u32IntInfo) == VMX_EXIT_INT_INFO_TYPE_HW_XCPT
     8043    if (   VMX_ENTRY_INT_INFO_TYPE(u32IntInfo) == VMX_EXIT_INT_INFO_TYPE_HW_XCPT
    80448044        && uVector == X86_XCPT_PF)
    80458045        pCtx->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