VirtualBox

Changeset 33504 in vbox for trunk


Ignore:
Timestamp:
Oct 27, 2010 1:19:37 PM (14 years ago)
Author:
vboxsync
Message:

Default large page support to on for new VMs or VMs that didn't specify this setting before. (only relevant for nested paging)

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

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/MachineImpl.cpp

    r33458 r33504  
    6666#include <iprt/cpp/xml.h>               /* xml::XmlFileWriter::s_psz*Suff. */
    6767#include <iprt/string.h>
     68#include <iprt/system.h>
    6869
    6970#include <VBox/com/array.h>
     
    155156#if HC_ARCH_BITS == 64
    156157    /* Default value decision pending. */
    157     mHWVirtExLargePagesEnabled = false;
     158    uint64_t cbRam = 0;
     159
     160    if (    RTSystemQueryTotalRam(&cbRam) == VINF_SUCCESS
     161        &&  cbRam >= (UINT64_C(6) * _1G))
     162    {
     163        mHWVirtExLargePagesEnabled = true;
     164    }
     165    else
     166        mHWVirtExLargePagesEnabled = false;
    158167#else
    159168    /* Not supported on 32 bits hosts. */
  • trunk/src/VBox/Main/xml/Settings.cpp

    r33396 r33504  
    7272#include <iprt/ldr.h>
    7373#include <iprt/cpp/lock.h>
     74#include <iprt/system.h>
    7475
    7576// generated header
     
    15311532          fHardwareVirtExclusive(HWVIRTEXCLUSIVEDEFAULT),
    15321533          fNestedPaging(true),
    1533           fLargePages(false),
    15341534          fVPID(true),
    15351535          fHardwareVirtForce(false),
     
    15631563#if HC_ARCH_BITS == 64 || defined(RT_OS_WINDOWS) || defined(RT_OS_DARWIN)
    15641564    fPAE = true;
     1565#endif
     1566
     1567    /* The default value of large page supports depends on the host:
     1568     * - 64 bits host -> true if sufficient RAM available.
     1569     * - 32 bits host -> false
     1570     */
     1571#if HC_ARCH_BITS == 64
     1572    uint64_t cbRam = 0;
     1573
     1574    if (    RTSystemQueryTotalRam(&cbRam) == VINF_SUCCESS
     1575        &&  cbRam >= (UINT64_C(6) * _1G))
     1576    {
     1577        fLargePages = true;
     1578    }
     1579    else
     1580        fLargePages = false;
     1581#else
     1582    /* Not supported on 32 bits hosts. */
     1583    fLargePages = false;
    15651584#endif
    15661585}
     
    31963215        pelmCPU->setAttribute("executionCap", hw.ulCpuExecutionCap);
    31973216
    3198     if (hw.fLargePages)
    3199         pelmCPU->createChild("HardwareVirtExLargePages")->setAttribute("enabled", hw.fLargePages);
     3217    /* Always save this setting as we have changed the default in 4.0 (on for large memory 64-bit systems). */
     3218    pelmCPU->createChild("HardwareVirtExLargePages")->setAttribute("enabled", hw.fLargePages);
    32003219
    32013220    if (m->sv >= SettingsVersion_v1_9)
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