VirtualBox

Changeset 85854 in vbox


Ignore:
Timestamp:
Aug 21, 2020 7:14:06 AM (4 years ago)
Author:
vboxsync
Message:

VMM/HM: Don't need to store fAllowNestedPaging and fAllowUnrestricted (both are unused outside the HM.cpp) in the VM or VMCPU struct.
Makes room for future bools in their place.

Location:
trunk/src/VBox/VMM
Files:
2 edited

Legend:

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

    r85121 r85854  
    315315    /** @cfgm{/HM/EnableNestedPaging, bool, false}
    316316     * Enables nested paging (aka extended page tables). */
    317     rc = CFGMR3QueryBoolDef(pCfgHm, "EnableNestedPaging", &pVM->hm.s.fAllowNestedPaging, false);
     317    bool fAllowNestedPaging = false;
     318    rc = CFGMR3QueryBoolDef(pCfgHm, "EnableNestedPaging", &fAllowNestedPaging, false);
    318319    AssertRCReturn(rc, rc);
    319320
    320321    /** @cfgm{/HM/EnableUX, bool, true}
    321322     * Enables the VT-x unrestricted execution feature. */
    322     rc = CFGMR3QueryBoolDef(pCfgHm, "EnableUX", &pVM->hm.s.vmx.fAllowUnrestricted, true);
     323    bool fAllowUnrestricted = true;
     324    rc = CFGMR3QueryBoolDef(pCfgHm, "EnableUX", &fAllowUnrestricted, true);
    323325    AssertRCReturn(rc, rc);
    324326
     
    568570             * configured so that CPUM can make decisions based on our configuration.
    569571             */
    570             Assert(!pVM->hm.s.fNestedPaging);
    571             if (pVM->hm.s.fAllowNestedPaging)
     572            if (   fAllowNestedPaging
     573                && (fCaps & SUPVTCAPS_NESTED_PAGING))
    572574            {
    573                 if (fCaps & SUPVTCAPS_NESTED_PAGING)
    574                     pVM->hm.s.fNestedPaging = true;
    575                 else
    576                     pVM->hm.s.fAllowNestedPaging = false;
    577             }
    578 
    579             if (fCaps & SUPVTCAPS_VT_X)
    580             {
    581                 Assert(!pVM->hm.s.vmx.fUnrestrictedGuest);
    582                 if (pVM->hm.s.vmx.fAllowUnrestricted)
     575                pVM->hm.s.fNestedPaging = true;
     576                if (fCaps & SUPVTCAPS_VT_X)
    583577                {
    584                     if (   (fCaps & SUPVTCAPS_VTX_UNRESTRICTED_GUEST)
    585                         && pVM->hm.s.fNestedPaging)
     578                    if (   fAllowUnrestricted
     579                        && (fCaps & SUPVTCAPS_VTX_UNRESTRICTED_GUEST))
    586580                        pVM->hm.s.vmx.fUnrestrictedGuest = true;
    587581                    else
    588                         pVM->hm.s.vmx.fAllowUnrestricted = false;
     582                        Assert(!pVM->hm.s.vmx.fUnrestrictedGuest);
    589583                }
    590584            }
     585            else
     586                Assert(!pVM->hm.s.fNestedPaging);
    591587        }
    592588        else
  • trunk/src/VBox/VMM/include/HMInternal.h

    r85121 r85854  
    452452    /** Set when we've initialized VMX or SVM. */
    453453    bool                        fInitialized;
    454     /** Set if nested paging is allowed. */
    455     bool                        fAllowNestedPaging;
    456454    /** Set if large pages are enabled (requires nested paging). */
    457455    bool                        fLargePages;
     
    486484    bool                        fMdsClearOnSched;
    487485    /** Alignment padding. */
    488     bool                        afPaddingMinus1[6];
     486    bool                        afPaddingMinus1[7];
    489487
    490488    /** Maximum ASID allowed. */
     
    518516         *  without paging). */
    519517        bool                        fUnrestrictedGuest;
    520         /** Set if unrestricted guest execution is allowed to be used. */
    521         bool                        fAllowUnrestricted;
    522518        /** Set if the preemption timer is in use or not. */
    523519        bool                        fUsePreemptTimer;
    524520        /** The shift mask employed by the VMX-Preemption timer. */
    525521        uint8_t                     cPreemptTimerShift;
     522        /** Padding. */
     523        bool                        afPadding0;
    526524
    527525        /** Virtual address of the APIC-access page. */
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