VirtualBox

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


Ignore:
Timestamp:
Dec 13, 2018 1:02:49 PM (6 years ago)
Author:
vboxsync
Message:

VMM: Nested VMX: bugref:9180 If hardware-assisted VMX nested-guest execution is not allowed, don't bother deriving guest features based on host features. Initialize with purely emulated features.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/VMM/VMMR3/CPUM.cpp

    r76206 r76207  
    13901390    {
    13911391        uint64_t uHostMsr = 0;
    1392         HMVmxGetHostMsr(pVM, MSR_IA32_VMX_MISC, &uHostMsr);
     1392        if (cpumR3IsHwAssistVmxNstGstExecAllowed(pVM))
     1393            HMVmxGetHostMsr(pVM, MSR_IA32_VMX_MISC, &uHostMsr);
    13931394        uint8_t const cMaxMsrs       = RT_MIN(RT_BF_GET(uHostMsr, VMX_BF_MISC_MAX_MSRS), VMX_V_AUTOMSR_COUNT_MAX);
    13941395        uint8_t const fActivityState = RT_BF_GET(uHostMsr, VMX_BF_MISC_ACTIVITY_STATES) & VMX_V_GUEST_ACTIVITY_STATE_MASK;
     
    14121413    {
    14131414        uint64_t uHostMsr = 0;
    1414         HMVmxGetHostMsr(pVM, MSR_IA32_VMX_CR0_FIXED1, &uHostMsr);
     1415        if (cpumR3IsHwAssistVmxNstGstExecAllowed(pVM))
     1416            HMVmxGetHostMsr(pVM, MSR_IA32_VMX_CR0_FIXED1, &uHostMsr);
    14151417        pVmxMsrs->u64Cr0Fixed1 = uHostMsr | VMX_V_CR0_FIXED0;   /* Make sure the CR0 MB1 bits are not clear. */
    14161418    }
     
    14221424    {
    14231425        uint64_t uHostMsr = 0;
    1424         HMVmxGetHostMsr(pVM, MSR_IA32_VMX_CR4_FIXED1, &uHostMsr);
     1426        if (cpumR3IsHwAssistVmxNstGstExecAllowed(pVM))
     1427            HMVmxGetHostMsr(pVM, MSR_IA32_VMX_CR4_FIXED1, &uHostMsr);
    14251428        pVmxMsrs->u64Cr4Fixed1 = uHostMsr | VMX_V_CR4_FIXED0;   /* Make sure the CR4 MB1 bits are not clear. */
    14261429    }
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