VirtualBox

Changeset 45618 in vbox for trunk/src/VBox/Main


Ignore:
Timestamp:
Apr 18, 2013 6:41:07 PM (12 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
85118
Message:

Do HMR3Init first in vmR3InitRing3 so the other components can skip raw-mode bits during init.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/src-client/ConsoleImpl2.cpp

    r45554 r45618  
    899899        }
    900900
    901         BOOL fHWVirtExEnabled;
    902         hrc = pMachine->GetHWVirtExProperty(HWVirtExPropertyType_Enabled, &fHWVirtExEnabled); H();
    903         if (cCpus > 1 && !fHWVirtExEnabled)
    904         {
    905             LogRel(("Forced fHWVirtExEnabled to TRUE by SMP guest.\n"));
    906             fHWVirtExEnabled = TRUE;
    907         }
    908         if (!fHWVirtExEnabled && fIsGuest64Bit)
     901        BOOL fHMEnabled;
     902        hrc = pMachine->GetHWVirtExProperty(HWVirtExPropertyType_Enabled, &fHMEnabled); H();
     903        if (cCpus > 1 && !fHMEnabled)
     904        {
     905            LogRel(("Forced fHMEnabled to TRUE by SMP guest.\n"));
     906            fHMEnabled = TRUE;
     907        }
     908        if (!fHMEnabled && fIsGuest64Bit)
    909909        {
    910910            LogRel(("WARNING! 64-bit guest type selected on host without hardware virtualization (VT-x or AMD-V).\n"));
     
    912912        }
    913913
    914         BOOL fHwVirtExtForced;
     914        BOOL fHMForced;
    915915#ifdef VBOX_WITH_RAW_MODE
    916916        /* - With more than 4GB PGM will use different RAMRANGE sizes for raw
     
    918918           - With more than one virtual CPU, raw-mode isn't a fallback option.
    919919           - With a 64-bit guest, raw-mode isn't a fallback option either. */
    920         fHwVirtExtForced = fHWVirtExEnabled
    921                         && (   cbRam + cbRamHole > _4G
    922                             || cCpus > 1
    923                             || fIsGuest64Bit);
     920        fHMForced = fHMEnabled
     921                 && (   cbRam + cbRamHole > _4G
     922                     || cCpus > 1
     923                     || fIsGuest64Bit);
    924924# ifdef RT_OS_DARWIN
    925         fHwVirtExtForced = fHWVirtExEnabled;
     925        fHMForced = fHMEnabled;
    926926# endif
    927         if (fHwVirtExtForced)
     927        if (fHMForced)
    928928        {
    929929            if (cbRam + cbRamHole > _4G)
    930                 LogRel(("fHwVirtExtForced=TRUE - Lots of RAM\n"));
     930                LogRel(("fHMForced=TRUE - Lots of RAM\n"));
    931931            if (cCpus > 1)
    932                 LogRel(("fHwVirtExtForced=TRUE - SMP\n"));
     932                LogRel(("fHMForced=TRUE - SMP\n"));
    933933            if (fIsGuest64Bit)
    934                 LogRel(("fHwVirtExtForced=TRUE - 64-bit guest\n"));
     934                LogRel(("fHMForced=TRUE - 64-bit guest\n"));
    935935# ifdef RT_OS_DARWIN
    936             LogRel(("fHwVirtExtForced=TRUE - Darwin host\n"));
     936            LogRel(("fHMForced=TRUE - Darwin host\n"));
    937937# endif
    938938        }
    939939#else  /* !VBOX_WITH_RAW_MODE */
    940         fHWVirtExEnabled = fHwVirtExtForced = TRUE;
    941         LogRel(("fHwVirtExtForced=TRUE - No raw-mode support in this build!\n"));
     940        fHMEnabled = fHMForced = TRUE;
     941        LogRel(("fHMForced=TRUE - No raw-mode support in this build!\n"));
    942942#endif /* !VBOX_WITH_RAW_MODE */
    943         if (!fHwVirtExtForced) /* No need to query if already forced above. */
    944         {
    945             hrc = pMachine->GetHWVirtExProperty(HWVirtExPropertyType_Force, &fHwVirtExtForced); H();
    946             if (fHwVirtExtForced)
    947                 LogRel(("fHwVirtExtForced=TRUE - HWVirtExPropertyType_Force\n"));
    948         }
    949         InsertConfigInteger(pRoot, "HwVirtExtForced", fHwVirtExtForced);
    950 
    951         /* /HWVirtExt/xzy */
    952         PCFGMNODE pHWVirtExt;
    953         InsertConfigNode(pRoot, "HWVirtExt", &pHWVirtExt);
    954         InsertConfigInteger(pHWVirtExt, "Enabled", fHWVirtExEnabled);
    955         if (fHWVirtExEnabled)
     943        if (!fHMForced) /* No need to query if already forced above. */
     944        {
     945            hrc = pMachine->GetHWVirtExProperty(HWVirtExPropertyType_Force, &fHMForced); H();
     946            if (fHMForced)
     947                LogRel(("fHMForced=TRUE - HWVirtExPropertyType_Force\n"));
     948        }
     949        InsertConfigInteger(pRoot, "HMEnabled", fHMEnabled);
     950
     951        /* /HM/xzy */
     952        PCFGMNODE pHM;
     953        InsertConfigNode(pRoot, "HM", &pHM);
     954        InsertConfigInteger(pRoot, "HMForced", fHMForced);
     955        if (fHMEnabled)
    956956        {
    957957            /* Indicate whether 64-bit guests are supported or not. */
    958             InsertConfigInteger(pHWVirtExt, "64bitEnabled", fIsGuest64Bit);
     958            InsertConfigInteger(pHM, "64bitEnabled", fIsGuest64Bit);
    959959#if ARCH_BITS == 32 /* The recompiler must use VBoxREM64 (32-bit host only). */
    960960            PCFGMNODE pREM;
     
    974974                 * We may want to consider adding more guest OSes (Solaris) later on.
    975975                 */
    976                 InsertConfigInteger(pHWVirtExt, "TPRPatchingEnabled", 1);
     976                InsertConfigInteger(pHM, "TPRPatchingEnabled", 1);
    977977            }
    978978        }
    979979
    980980        /* HWVirtEx exclusive mode */
    981         BOOL fHWVirtExExclusive = true;
    982         hrc = pMachine->GetHWVirtExProperty(HWVirtExPropertyType_Exclusive, &fHWVirtExExclusive); H();
    983         InsertConfigInteger(pHWVirtExt, "Exclusive", fHWVirtExExclusive);
     981        BOOL fHMExclusive = true;
     982        hrc = pMachine->GetHWVirtExProperty(HWVirtExPropertyType_Exclusive, &fHMExclusive); H();
     983        InsertConfigInteger(pHM, "Exclusive", fHMExclusive);
    984984
    985985        /* Nested paging (VT-x/AMD-V) */
    986986        BOOL fEnableNestedPaging = false;
    987987        hrc = pMachine->GetHWVirtExProperty(HWVirtExPropertyType_NestedPaging, &fEnableNestedPaging); H();
    988         InsertConfigInteger(pHWVirtExt, "EnableNestedPaging", fEnableNestedPaging);
     988        InsertConfigInteger(pHM, "EnableNestedPaging", fEnableNestedPaging);
    989989
    990990        /* Large pages; requires nested paging */
    991991        BOOL fEnableLargePages = false;
    992992        hrc = pMachine->GetHWVirtExProperty(HWVirtExPropertyType_LargePages, &fEnableLargePages); H();
    993         InsertConfigInteger(pHWVirtExt, "EnableLargePages", fEnableLargePages);
     993        InsertConfigInteger(pHM, "EnableLargePages", fEnableLargePages);
    994994
    995995        /* VPID (VT-x) */
    996996        BOOL fEnableVPID = false;
    997997        hrc = pMachine->GetHWVirtExProperty(HWVirtExPropertyType_VPID, &fEnableVPID);       H();
    998         InsertConfigInteger(pHWVirtExt, "EnableVPID", fEnableVPID);
     998        InsertConfigInteger(pHM, "EnableVPID", fEnableVPID);
    999999
    10001000        /*
     
    13351335        InsertConfigInteger(pCfg,  "MonitorCount",         cMonitorCount);
    13361336#ifdef VBOX_WITH_2X_4GB_ADDR_SPACE
    1337         InsertConfigInteger(pCfg,  "R0Enabled",            fHWVirtExEnabled);
     1337        InsertConfigInteger(pCfg,  "R0Enabled",            fHMEnabled);
    13381338#endif
    13391339
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