VirtualBox

Changeset 97515 in vbox for trunk/src/VBox/VMM


Ignore:
Timestamp:
Nov 11, 2022 2:30:36 PM (2 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
154538
Message:

VMM/IEM: Nested VMX: bugref:10318 The EFER LMA and LME bits must match the "host address-space size" VM-exit control bit only when "load IA32_EFER" VM-exit bit is set, not otherwise.

File:
1 edited

Legend:

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

    r97370 r97515  
    61366136
    61376137    /* EFER MSR. */
    6138     uint64_t const uValidEferMask = CPUMGetGuestEferMsrValidMask(pVCpu->CTX_SUFF(pVM));
    6139     if (   !(pVmcs->u32ExitCtls & VMX_EXIT_CTLS_LOAD_EFER_MSR)
    6140         || !(pVmcs->u64HostEferMsr.u & ~uValidEferMask))
    6141     { /* likely */ }
    6142     else
    6143         IEM_VMX_VMENTRY_FAILED_RET(pVCpu, pszInstr, pszFailure, kVmxVDiag_Vmentry_HostEferMsrRsvd);
    6144 
    6145     bool const fHostInLongMode = RT_BOOL(pVmcs->u32ExitCtls & VMX_EXIT_CTLS_HOST_ADDR_SPACE_SIZE);
    6146     bool const fHostLma        = RT_BOOL(pVmcs->u64HostEferMsr.u & MSR_K6_EFER_LMA);
    6147     bool const fHostLme        = RT_BOOL(pVmcs->u64HostEferMsr.u & MSR_K6_EFER_LME);
    6148     if (   fHostInLongMode == fHostLma
    6149         && fHostInLongMode == fHostLme)
    6150     { /* likely */ }
    6151     else
    6152         IEM_VMX_VMENTRY_FAILED_RET(pVCpu, pszInstr, pszFailure, kVmxVDiag_Vmentry_HostEferMsr);
     6138    bool const     fHostInLongMode = RT_BOOL(pVmcs->u32ExitCtls & VMX_EXIT_CTLS_HOST_ADDR_SPACE_SIZE);
     6139    uint64_t const uValidEferMask  = CPUMGetGuestEferMsrValidMask(pVCpu->CTX_SUFF(pVM));
     6140    if (pVmcs->u32ExitCtls & VMX_EXIT_CTLS_LOAD_EFER_MSR)
     6141    {
     6142        if (!(pVmcs->u64HostEferMsr.u & ~uValidEferMask))
     6143        { /* likely */ }
     6144        else
     6145            IEM_VMX_VMENTRY_FAILED_RET(pVCpu, pszInstr, pszFailure, kVmxVDiag_Vmentry_HostEferMsrRsvd);
     6146
     6147        bool const fHostLma = RT_BOOL(pVmcs->u64HostEferMsr.u & MSR_K6_EFER_LMA);
     6148        bool const fHostLme = RT_BOOL(pVmcs->u64HostEferMsr.u & MSR_K6_EFER_LME);
     6149        if (   fHostInLongMode == fHostLma
     6150            && fHostInLongMode == fHostLme)
     6151        { /* likely */ }
     6152        else
     6153            IEM_VMX_VMENTRY_FAILED_RET(pVCpu, pszInstr, pszFailure, kVmxVDiag_Vmentry_HostEferMsr);
     6154    }
    61536155
    61546156    /*
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