VirtualBox

Changeset 76952 in vbox for trunk/src/VBox/VMM/VMMAll


Ignore:
Timestamp:
Jan 23, 2019 11:00:57 AM (6 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
128329
Message:

VMM: Nested VMX: bugref:9180 Clear VM-entry interruption information's valid bit on VM-exit. Save EFER.LMA to VMCS on VM-exit if the feature is enabled. Be careful while converting boolean expressions to uint8_t.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/VMM/VMMAll/IEMAllCImplVmxInstr.cpp.h

    r76875 r76952  
    28202820
    28212821    /*
     2822     * We need to clear the VM-entry interruption information field's valid bit on VM-exit.
     2823     * See Intel spec. 24.8.3 "VM-Entry Controls for Event Injection".
     2824     */
     2825    pVmcs->u32EntryIntInfo &= ~VMX_ENTRY_INT_INFO_VALID;
     2826
     2827    /*
     2828     * If we support storing EFER.LMA into IA32e-mode guest field on VM-exit, we need to do that now.
     2829     * See Intel spec. 27.2 "Recording VM-exit Information And Updating VM-entry Control".
     2830     */
     2831    if (IEM_GET_GUEST_CPU_FEATURES(pVCpu)->fVmxExitSaveEferLma)
     2832    {
     2833        if (pVCpu->cpum.GstCtx.msrEFER & MSR_K6_EFER_LMA)
     2834            pVmcs->u32EntryCtls |= VMX_ENTRY_CTLS_IA32E_MODE_GUEST;
     2835        else
     2836            pVmcs->u32EntryCtls &= ~VMX_ENTRY_CTLS_IA32E_MODE_GUEST;
     2837    }
     2838
     2839    /*
    28222840     * Save the guest state back into the VMCS.
    28232841     * We only need to save the state when the VM-entry was successful.
     
    38543872        if (pVmcs->u32ExitCtls & VMX_EXIT_CTLS_ACK_EXT_INT)
    38553873        {
    3856             uint8_t  const fNmiUnblocking = pVCpu->cpum.GstCtx.hwvirt.vmx.fNmiUnblockingIret;
     3874            bool const    fNmiUnblocking = pVCpu->cpum.GstCtx.hwvirt.vmx.fNmiUnblockingIret;
    38573875            uint32_t const uExitIntInfo   = RT_BF_MAKE(VMX_BF_EXIT_INT_INFO_VECTOR,           uVector)
    38583876                                          | RT_BF_MAKE(VMX_BF_EXIT_INT_INFO_TYPE,             VMX_EXIT_INT_INFO_TYPE_EXT_INT)
     
    39343952        /* Update the IDT-vectoring event in the VMCS as the source of the upcoming event. */
    39353953        uint8_t  const uIdtVectoringType = iemVmxGetEventType(uVector, fFlags);
    3936         uint8_t  const fErrCodeValid     = (fFlags & IEM_XCPT_FLAGS_ERR);
     3954        bool     const fErrCodeValid     = RT_BOOL(fFlags & IEM_XCPT_FLAGS_ERR);
    39373955        uint32_t const uIdtVectoringInfo = RT_BF_MAKE(VMX_BF_IDT_VECTORING_INFO_VECTOR,         uVector)
    39383956                                         | RT_BF_MAKE(VMX_BF_IDT_VECTORING_INFO_TYPE,           uIdtVectoringType)
     
    40164034
    40174035        uint8_t  const fNmiUnblocking = pVCpu->cpum.GstCtx.hwvirt.vmx.fNmiUnblockingIret;
    4018         uint8_t  const fErrCodeValid  = (fFlags & IEM_XCPT_FLAGS_ERR);
     4036        bool     const fErrCodeValid  = RT_BOOL(fFlags & IEM_XCPT_FLAGS_ERR);
    40194037        uint8_t  const uIntInfoType   = iemVmxGetEventType(uVector, fFlags);
    40204038        uint32_t const uExitIntInfo   = RT_BF_MAKE(VMX_BF_EXIT_INT_INFO_VECTOR,           uVector)
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