VirtualBox

Changeset 76490 in vbox for trunk/src/VBox/VMM/VMMR3


Ignore:
Timestamp:
Dec 27, 2018 5:12:59 AM (6 years ago)
Author:
vboxsync
Message:

VMM/CPUM: Nested VMX: bugref:9180 cpumR3IsHwAssistVmxNstGstExecAllowed is actually cpumR3IsHwAssistNstGstExecAllowed.

File:
1 edited

Legend:

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

    r76469 r76490  
    12341234
    12351235/**
    1236  * Checks whether VMX nested-guest may be executed using hardware-assisted VMX (e.g,
    1237  * using HM or NEM).
    1238  *
    1239  * @returns @c true if hardware-assisted VMX nested-guest is allowed, @c false
    1240  *        otherwise.
     1236 * Checks whether nested-guest execution using hardware-assisted VMX (e.g, using HM
     1237 * or NEM) is allowed.
     1238 *
     1239 * @returns @c true if hardware-assisted nested-guest execution is allowed, @c false
     1240 *          otherwise.
    12411241 * @param   pVM     The cross context VM structure.
    12421242 */
    1243 static bool cpumR3IsHwAssistVmxNstGstExecAllowed(PVM pVM)
     1243static bool cpumR3IsHwAssistNstGstExecAllowed(PVM pVM)
    12441244{
    12451245    AssertMsg(pVM->bMainExecutionEngine != VM_EXEC_ENGINE_NOT_SET, ("Calling this function too early!\n"));
     
    12701270static void cpumR3InitVmxGuestMsrs(PVM pVM, PCVMXMSRS pHostVmxMsrs, PCCPUMFEATURES pGuestFeatures, PVMXMSRS pGuestVmxMsrs)
    12711271{
    1272     Assert(!cpumR3IsHwAssistVmxNstGstExecAllowed(pVM) || pHostVmxMsrs);
     1272    bool const fIsNstGstHwExecAllowed = cpumR3IsHwAssistNstGstExecAllowed(pVM);
     1273
     1274    Assert(!fIsNstGstHwExecAllowed || pHostVmxMsrs);
    12731275    Assert(pGuestFeatures->fVmx);
    12741276
     
    14021404    /* Miscellaneous data. */
    14031405    {
    1404         uint64_t const uHostMsr = cpumR3IsHwAssistVmxNstGstExecAllowed(pVM) ? pHostVmxMsrs->u64Misc : 0;
     1406        uint64_t const uHostMsr = fIsNstGstHwExecAllowed ? pHostVmxMsrs->u64Misc : 0;
    14051407
    14061408        uint8_t const  cMaxMsrs       = RT_MIN(RT_BF_GET(uHostMsr, VMX_BF_MISC_MAX_MSRS), VMX_V_AUTOMSR_COUNT_MAX);
     
    14241426    /* CR0 Fixed-1. */
    14251427    {
    1426         uint64_t const uHostMsr = cpumR3IsHwAssistVmxNstGstExecAllowed(pVM) ? pHostVmxMsrs->u64Cr0Fixed1 : 0;
     1428        uint64_t const uHostMsr = fIsNstGstHwExecAllowed ? pHostVmxMsrs->u64Cr0Fixed1 : 0;
    14271429        pGuestVmxMsrs->u64Cr0Fixed1 = uHostMsr | VMX_V_CR0_FIXED0;   /* Make sure the CR0 MB1 bits are not clear. */
    14281430    }
     
    14331435    /* CR4 Fixed-1. */
    14341436    {
    1435         uint64_t const uHostMsr = cpumR3IsHwAssistVmxNstGstExecAllowed(pVM) ? pHostVmxMsrs->u64Cr4Fixed1 : 0;
     1437        uint64_t const uHostMsr = fIsNstGstHwExecAllowed ? pHostVmxMsrs->u64Cr4Fixed1 : 0;
    14361438        pGuestVmxMsrs->u64Cr4Fixed1 = uHostMsr | VMX_V_CR4_FIXED0;   /* Make sure the CR4 MB1 bits are not clear. */
    14371439    }
     
    16301632     * by the hardware, hence we merge our emulated features with the host features below.
    16311633     */
    1632     PCCPUMFEATURES pBaseFeat  = cpumR3IsHwAssistVmxNstGstExecAllowed(pVM) ? &pVM->cpum.s.HostFeatures : &EmuFeat;
     1634    PCCPUMFEATURES pBaseFeat  = cpumR3IsHwAssistNstGstExecAllowed(pVM) ? &pVM->cpum.s.HostFeatures : &EmuFeat;
    16331635    PCPUMFEATURES  pGuestFeat = &pVM->cpum.s.GuestFeatures;
    16341636    Assert(pBaseFeat->fVmx);
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