VirtualBox

Changeset 61042 in vbox for trunk


Ignore:
Timestamp:
May 19, 2016 11:57:10 AM (8 years ago)
Author:
vboxsync
Message:

Main/Machine+BIOSSettings: introduce APIC/X2APIC CPU feature settings and a BIOS setting what should be used.
Frontends/VBoxManage: corresponding changes to allow making the settings changes
Devices/BIOS+EFI: placeholder for the BIOS setting part, which isn't implemented yet

Location:
trunk
Files:
13 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/VBox/settings.h

    r61036 r61042  
    463463                    fIOAPICEnabled,
    464464                    fLogoFadeIn,
    465                     fLogoFadeOut;
     465                    fLogoFadeOut,
     466                    fPXEDebugEnabled;
    466467    uint32_t        ulLogoDisplayTime;
     468    BIOSBootMenuMode_T biosBootMenuMode;
     469    APICMode_T      apicMode;           // requires settings version 1.16 (VirtualBox 5.1)
     470    int64_t         llTimeOffset;
    467471    com::Utf8Str    strLogoImagePath;
    468     BIOSBootMenuMode_T  biosBootMenuMode;
    469     bool            fPXEDebugEnabled;
    470     int64_t         llTimeOffset;
    471472};
    472473
     
    892893                        fSyntheticCpu,
    893894                        fTripleFaultReset,
    894                         fPAE;
     895                        fPAE,
     896                        fAPIC,                  // requires settings version 1.16 (VirtualBox 5.1)
     897                        fX2APIC;                // requires settings version 1.16 (VirtualBox 5.1)
    895898    typedef enum LongModeType { LongMode_Enabled, LongMode_Disabled, LongMode_Legacy } LongModeType;
    896899    LongModeType        enmLongMode;
  • trunk/src/VBox/Devices/EFI/DevEFI.cpp

    r58170 r61042  
    55
    66/*
    7  * Copyright (C) 2006-2015 Oracle Corporation
     7 * Copyright (C) 2006-2016 Oracle Corporation
    88 *
    99 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    202202    /** I/O-APIC enabled? */
    203203    uint8_t                 u8IOAPIC;
     204
     205    /** APIC mode to be set up by firmware. */
     206    uint8_t                 u8APIC;
    204207
    205208    /** Boot parameters passed to the firmware. */
     
    21002103                              "UUID\0"
    21012104                              "IOAPIC\0"
     2105                              "APIC\0"
    21022106                              "DmiBIOSFirmwareMajor\0"
    21032107                              "DmiBIOSFirmwareMinor\0"
     
    21502154        return PDMDEV_SET_ERROR(pDevIns, rc,
    21512155                                N_("Configuration error: Failed to read \"IOAPIC\""));
     2156
     2157    rc = CFGMR3QueryU8Def(pCfg, "APIC", &pThis->u8APIC, 1);
     2158    if (RT_FAILURE (rc))
     2159        return PDMDEV_SET_ERROR(pDevIns, rc,
     2160                                N_("Configuration error: Failed to read \"APIC\""));
    21522161
    21532162    /*
  • trunk/src/VBox/Devices/PC/DevPcBios.cpp

    r60433 r61042  
    193193    /** I/O-APIC enabled? */
    194194    uint8_t         u8IOAPIC;
     195    /** APIC mode to be set up by BIOS */
     196    uint8_t         u8APIC;
    195197    /** PXE debug logging enabled? */
    196198    uint8_t         u8PXEDebug;
     
    11011103                              "UUID\0"
    11021104                              "IOAPIC\0"
     1105                              "APIC\0"
    11031106                              "NumCPUs\0"
    11041107                              "McfgBase\0"
     
    11771180        return PDMDEV_SET_ERROR(pDevIns, rc,
    11781181                                N_("Configuration error: Failed to read \"IOAPIC\""));
     1182
     1183    rc = CFGMR3QueryU8Def(pCfg, "APIC", &pThis->u8APIC, 1);
     1184    if (RT_FAILURE (rc))
     1185        return PDMDEV_SET_ERROR(pDevIns, rc,
     1186                                N_("Configuration error: Failed to read \"APIC\""));
    11791187
    11801188    static const char * const s_apszBootDevices[] = { "BootDevice0", "BootDevice1", "BootDevice2", "BootDevice3" };
  • trunk/src/VBox/Frontends/VBoxManage/VBoxManageHelp.cpp

    r60734 r61042  
    681681                     "                            [--hpet on|off]\n"
    682682                     "                            [--triplefaultreset on|off]\n"
     683                     "                            [--apic on|off]\n"
     684                     "                            [--x2apic on|off]\n"
    683685                     "                            [--paravirtprovider none|default|legacy|minimal|\n"
    684686                     "                                                hyperv|kvm]\n"
     
    720722                     "                            [--bioslogoimagepath <imagepath>]\n"
    721723                     "                            [--biosbootmenu disabled|menuonly|messageandmenu]\n"
     724                     "                            [--biosapic disabled|apic|x2apic]\n"
    722725                     "                            [--biossystemtimeoffset <msec>]\n"
    723726                     "                            [--biospxedebug on|off]\n"
  • trunk/src/VBox/Frontends/VBoxManage/VBoxManageInfo.cpp

    r60410 r61042  
    55
    66/*
    7  * Copyright (C) 2006-2015 Oracle Corporation
     7 * Copyright (C) 2006-2016 Oracle Corporation
    88 *
    99 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    618618    SHOW_BOOLEAN_METHOD(   machine, GetCPUProperty(CPUPropertyType_PAE, &f), "pae", "PAE");
    619619    SHOW_BOOLEAN_METHOD(   machine, GetCPUProperty(CPUPropertyType_LongMode, &f), "longmode", "Long Mode");
     620    SHOW_BOOLEAN_METHOD(   machine, GetCPUProperty(CPUPropertyType_TripleFaultReset, &f), "triplefaultreset", "Triple Fault Reset");
     621    SHOW_BOOLEAN_METHOD(   machine, GetCPUProperty(CPUPropertyType_APIC, &f), "apic", "APIC");
     622    SHOW_BOOLEAN_METHOD(   machine, GetCPUProperty(CPUPropertyType_X2APIC, &f), "x2apic", "X2APIC");
    620623    SHOW_ULONG_PROP(       machine, CPUIDPortabilityLevel, "cpuid-portability-level",   "CPUID Portability Level", "");
    621624
     
    738741    SHOW_BOOLEAN_PROP(biosSettings, ACPIEnabled,                "acpi",                 "ACPI");
    739742    SHOW_BOOLEAN_PROP(biosSettings, IOAPICEnabled,              "ioapic",               "IOAPIC");
     743
     744    APICMode_T apicMode;
     745    CHECK_ERROR2I_RET(biosSettings, COMGETTER(APICMode)(&apicMode), hrcCheck);
     746    const char *pszAPIC;
     747    switch (apicMode)
     748    {
     749        case APICMode_Disabled:
     750            pszAPIC = "disabled";
     751            break;
     752        case APICMode_APIC:
     753        default:
     754            if (details == VMINFO_MACHINEREADABLE)
     755                pszAPIC = "apic";
     756            else
     757                pszAPIC = "APIC";
     758            break;
     759        case APICMode_X2APIC:
     760            if (details == VMINFO_MACHINEREADABLE)
     761                pszBootMenu = "x2apic";
     762            else
     763                pszBootMenu = "x2APIC";
     764            break;
     765    }
     766    if (details == VMINFO_MACHINEREADABLE)
     767        RTPrintf("biosapic=\"%s\"\n", pszAPIC);
     768    else
     769        RTPrintf("BIOS APIC mode:  %s\n", pszAPIC);
     770
    740771    SHOW_LONG64_PROP(biosSettings,  TimeOffset,                 "biossystemtimeoffset", "Time offset",  "ms");
    741772    SHOW_BOOLEAN_PROP_EX(machine,   RTCUseUTC,                  "rtcuseutc",            "RTC",          "UTC", "local time");
  • trunk/src/VBox/Frontends/VBoxManage/VBoxManageModifyVM.cpp

    r60410 r61042  
    55
    66/*
    7  * Copyright (C) 2006-2015 Oracle Corporation
     7 * Copyright (C) 2006-2016 Oracle Corporation
    88 *
    99 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    6363    MODIFYVM_CPUID_PORTABILITY,
    6464    MODIFYVM_TFRESET,
     65    MODIFYVM_APIC,
     66    MODIFYVM_X2APIC,
    6567    MODIFYVM_PARAVIRTPROVIDER,
    6668    MODIFYVM_PARAVIRTDEBUG,
     
    8991    MODIFYVM_BIOSLOGOIMAGEPATH,
    9092    MODIFYVM_BIOSBOOTMENU,
     93    MODIFYVM_BIOSAPIC,
    9194    MODIFYVM_BIOSSYSTEMTIMEOFFSET,
    9295    MODIFYVM_BIOSPXEDEBUG,
     
    236239    { "--cpuid-portability-level",  MODIFYVM_CPUID_PORTABILITY,         RTGETOPT_REQ_UINT32 },
    237240    { "--triplefaultreset",         MODIFYVM_TFRESET,                   RTGETOPT_REQ_BOOL_ONOFF },
     241    { "--apic",                     MODIFYVM_APIC,                      RTGETOPT_REQ_BOOL_ONOFF },
     242    { "--x2apic",                   MODIFYVM_X2APIC,                    RTGETOPT_REQ_BOOL_ONOFF },
    238243    { "--paravirtprovider",         MODIFYVM_PARAVIRTPROVIDER,          RTGETOPT_REQ_STRING },
    239244    { "--paravirtdebug",            MODIFYVM_PARAVIRTDEBUG,             RTGETOPT_REQ_STRING },
     
    265270    { "--biosbootmenu",             MODIFYVM_BIOSBOOTMENU,              RTGETOPT_REQ_STRING },
    266271    { "--biossystemtimeoffset",     MODIFYVM_BIOSSYSTEMTIMEOFFSET,      RTGETOPT_REQ_INT64 },
     272    { "--biosapic",                 MODIFYVM_BIOSAPIC,                  RTGETOPT_REQ_STRING },
    267273    { "--biospxedebug",             MODIFYVM_BIOSPXEDEBUG,              RTGETOPT_REQ_BOOL_ONOFF },
    268274    { "--boot",                     MODIFYVM_BOOT,                      RTGETOPT_REQ_STRING | RTGETOPT_FLAG_INDEX },
     
    672678            }
    673679
     680            case MODIFYVM_APIC:
     681            {
     682                CHECK_ERROR(sessionMachine, SetCPUProperty(CPUPropertyType_APIC, ValueUnion.f));
     683                break;
     684            }
     685
     686            case MODIFYVM_X2APIC:
     687            {
     688                CHECK_ERROR(sessionMachine, SetCPUProperty(CPUPropertyType_X2APIC, ValueUnion.f));
     689                break;
     690            }
     691
    674692            case MODIFYVM_PARAVIRTPROVIDER:
    675693            {
     
    887905                {
    888906                    errorArgument("Invalid --biosbootmenu argument '%s'", ValueUnion.psz);
     907                    rc = E_FAIL;
     908                }
     909                break;
     910            }
     911
     912            case MODIFYVM_BIOSAPIC:
     913            {
     914                if (!RTStrICmp(ValueUnion.psz, "disabled"))
     915                {
     916                    CHECK_ERROR(biosSettings, COMSETTER(APICMode)(APICMode_Disabled));
     917                }
     918                else if (   !RTStrICmp(ValueUnion.psz, "apic")
     919                         || !RTStrICmp(ValueUnion.psz, "lapic")
     920                         || !RTStrICmp(ValueUnion.psz, "xapic"))
     921                {
     922                    CHECK_ERROR(biosSettings, COMSETTER(APICMode)(APICMode_APIC));
     923                }
     924                else if (!RTStrICmp(ValueUnion.psz, "x2apic"))
     925                {
     926                    CHECK_ERROR(biosSettings, COMSETTER(APICMode)(APICMode_X2APIC));
     927                }
     928                else
     929                {
     930                    errorArgument("Invalid --biosapic argument '%s'", ValueUnion.psz);
    889931                    rc = E_FAIL;
    890932                }
  • trunk/src/VBox/Main/idl/VirtualBox.xidl

    r61009 r61042  
    570570      <desc>Settings version "1.16", written by VirtualBox 5.1.x.</desc>
    571571      <!--
    572           Machine changes: NVMe storage controller.
     572          Machine changes: NVMe storage controller, paravirt debug options, CPU
     573          profile and BIOS/CPU APIC settings.
    573574          VirtualBox.xml: Add support for additional USB device sources (e.g. USB/IP)
    574575      -->
     
    952953  <enum
    953954    name="CPUPropertyType"
    954     uuid="ed4094c1-d00e-483a-93e9-7163549ebd6e"
     955    uuid="cc6ecdad-a07c-4e81-9c0e-d767e0678d5a"
    955956    >
    956957    <desc>
     
    979980        trigger an internal error condition and stop the VM (default) or reset
    980981        the virtual CPU/VM and continue execution.
     982      </desc>
     983    </const>
     984    <const name="APIC"                  value="4">
     985      <desc>
     986        This setting determines whether an APIC is part of the virtual CPU.
     987        This feature can only be turned off when the X2APIC feature is off.
     988      </desc>
     989    </const>
     990    <const name="X2APIC"                value="5">
     991      <desc>
     992        This setting determines whether an x2APIC is part of the virtual CPU.
     993        Since this feature implies that the APIC feature is present, it
     994        automatically enables the APIC feature when set.
    981995      </desc>
    982996    </const>
     
    12421256    <const name="MenuOnly"        value="1"/>
    12431257    <const name="MessageAndMenu"  value="2"/>
     1258  </enum>
     1259
     1260  <enum
     1261    name="APICMode"
     1262    uuid="c6884ba5-3cc4-4a92-a7f6-4410f9fd894e"
     1263    >
     1264    <desc>
     1265      BIOS APIC initialization mode. If the hardware does not support the
     1266      mode then the code falls back to a lower mode.
     1267    </desc>
     1268
     1269    <const name="Disabled"        value="0"/>
     1270    <const name="APIC"            value="1"/>
     1271    <const name="X2APIC"          value="2"/>
    12441272  </enum>
    12451273
     
    29923020    >
    29933021    <desc>
    2994         X.509 certificate version numbers.
     3022      X.509 certificate version numbers.
    29953023    </desc>
    29963024    <const name="V1"       value="1"/>
     
    40714099  <interface
    40724100    name="IBIOSSettings" extends="$unknown"
    4073     uuid="c5b5afe3-4a6f-05eb-c9b6-4dbf98538b67"
     4101    uuid="f13f667d-3624-4ac5-99c1-3d982ebd8d98"
    40744102    wsmap="managed"
    40754103    reservedMethods="1" reservedAttributes="8"
     
    41104138        IO APIC support flag. If set, VirtualBox will provide an IO APIC
    41114139        and support IRQs above 15.
     4140      </desc>
     4141    </attribute>
     4142
     4143    <attribute name="APICMode" type="APICMode">
     4144      <desc>
     4145        APIC mode to set up by the firmware.
    41124146      </desc>
    41134147    </attribute>
  • trunk/src/VBox/Main/include/BIOSSettingsImpl.h

    r49871 r61042  
    77
    88/*
    9  * Copyright (C) 2006-2013 Oracle Corporation
     9 * Copyright (C) 2006-2016 Oracle Corporation
    1010 *
    1111 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    7272    HRESULT getIOAPICEnabled(BOOL *aIOAPICEnabled);
    7373    HRESULT setIOAPICEnabled(BOOL aIOAPICEnabled);
     74    HRESULT getAPICMode(APICMode_T *aAPICMode);
     75    HRESULT setAPICMode(APICMode_T aAPICMode);
    7476    HRESULT getTimeOffset(LONG64 *offset);
    7577    HRESULT setTimeOffset(LONG64 offset);
  • trunk/src/VBox/Main/include/MachineImpl.h

    r61009 r61042  
    277277        settings::Hardware::LongModeType mLongMode;
    278278        BOOL                mTripleFaultReset;
     279        BOOL                mAPIC;
     280        BOOL                mX2APIC;
    279281        ULONG               mCPUCount;
    280282        BOOL                mCPUHotPlugEnabled;
  • trunk/src/VBox/Main/src-client/ConsoleImpl2.cpp

    r60743 r61042  
    1010
    1111/*
    12  * Copyright (C) 2006-2015 Oracle Corporation
     12 * Copyright (C) 2006-2016 Oracle Corporation
    1313 *
    1414 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    821821    hrc = biosSettings->COMGETTER(IOAPICEnabled)(&fIOAPIC);                                 H();
    822822
     823    APICMode_T apicMode;
     824    hrc = biosSettings->COMGETTER(APICMode)(&apicMode);                                     H();
     825    uint32_t uAPIC;
     826    switch (apicMode)
     827    {
     828        case APICMode_Disabled:
     829            uAPIC = 0;
     830            break;
     831        case APICMode_APIC:
     832            uAPIC = 1;
     833            break;
     834        case APICMode_X2APIC:
     835            uAPIC = 2;
     836            break;
     837        default:
     838            AssertMsgFailed(("Invalid APICMode=%d\n", apicMode));
     839            uAPIC = 1;
     840            break;
     841    }
     842
    823843    ComPtr<IGuestOSType> guestOSType;
    824844    hrc = virtualBox->GetGuestOSType(osTypeId.raw(), guestOSType.asOutParam());             H();
     
    979999        InsertConfigInteger(pRoot, "EnablePAE", fEnablePAE);
    9801000
     1001        /* APIC/X2APIC configuration */
     1002        BOOL fEnableAPIC = true;
     1003        BOOL fEnableX2APIC = true;
     1004        hrc = pMachine->GetCPUProperty(CPUPropertyType_APIC, &fEnableAPIC);                 H();
     1005        hrc = pMachine->GetCPUProperty(CPUPropertyType_X2APIC, &fEnableX2APIC);             H();
     1006        if (fEnableX2APIC)
     1007            Assert(fEnableAPIC);
     1008
    9811009        /* CPUM profile name. */
    9821010        hrc = pMachine->COMGETTER(CPUProfile)(bstr.asOutParam());                           H();
     
    9891017         * dead wrong on 8086 (see http://www.os2museum.com/wp/undocumented-8086-opcodes/).
    9901018         */
    991         bool fDisableApic = false;
    9921019        if (   bstr.equals("Intel 80386") /* just for now */
    9931020            || bstr.equals("Intel 80286")
     
    9991026            if (!bstr.equals("Intel 80386"))
    10001027            {
    1001                 fDisableApic = true;
    1002                 fIOAPIC      = false;
    1003             }
    1004         }
     1028                fEnableAPIC = false;
     1029                fIOAPIC     = false;
     1030            }
     1031            fEnableX2APIC = false;
     1032        }
     1033
     1034        /* /APIC/xzy */
     1035        PCFGMNODE pAPIC;
     1036        InsertConfigNode(pRoot, "APIC", &pAPIC);
     1037        uint32_t uAPICMode = 1;
     1038        if (fEnableX2APIC)
     1039            uAPICMode = 2;
     1040        else if (!fEnableAPIC)
     1041            uAPICMode = 0;
     1042        InsertConfigInteger(pAPIC, "Mode", uAPICMode);
    10051043
    10061044        /*
     
    15521590         *      thus only single insert
    15531591         */
    1554         if (!fDisableApic)
     1592        if (fEnableAPIC)
    15551593        {
    15561594            InsertConfigNode(pDevices, "apic", &pDev);
     
    16341672            InsertConfigString(pBiosCfg,   "FloppyDevice",         "i82078");
    16351673            InsertConfigInteger(pBiosCfg,  "IOAPIC",               fIOAPIC);
     1674            InsertConfigInteger(pBiosCfg,  "APIC",                 uAPIC);
    16361675            BOOL fPXEDebug;
    16371676            hrc = biosSettings->COMGETTER(PXEDebugEnabled)(&fPXEDebug);                     H();
     
    17381777            InsertConfigString(pCfg,   "DeviceProps",      deviceProps);
    17391778            InsertConfigInteger(pCfg,  "IOAPIC",           fIOAPIC);
     1779            InsertConfigInteger(pCfg,  "APIC",             uAPIC);
    17401780            InsertConfigBytes(pCfg,    "UUID", &HardwareUuid,sizeof(HardwareUuid));
    17411781            InsertConfigInteger(pCfg,  "64BitEntry", f64BitEntry); /* boolean */
  • trunk/src/VBox/Main/src-server/BIOSSettingsImpl.cpp

    r55401 r61042  
    66
    77/*
    8  * Copyright (C) 2006-2014 Oracle Corporation
     8 * Copyright (C) 2006-2016 Oracle Corporation
    99 *
    1010 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    380380
    381381    m->bd->fIOAPICEnabled = !!aIOAPICEnabled;
     382    alock.release();
     383    AutoWriteLock mlock(m->pMachine COMMA_LOCKVAL_SRC_POS);  // mParent is const, needs no locking
     384    m->pMachine->i_setModified(Machine::IsModified_BIOS);
     385
     386    return S_OK;
     387}
     388
     389
     390HRESULT BIOSSettings::getAPICMode(APICMode_T *aAPICMode)
     391{
     392    AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
     393
     394    *aAPICMode = m->bd->apicMode;
     395
     396    return S_OK;
     397}
     398
     399
     400HRESULT BIOSSettings::setAPICMode(APICMode_T aAPICMode)
     401{
     402    /* the machine needs to be mutable */
     403    AutoMutableStateDependency adep(m->pMachine);
     404    if (FAILED(adep.rc())) return adep.rc();
     405
     406    AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS);
     407
     408    m->bd.backup();
     409
     410    m->bd->apicMode = aAPICMode;
    382411    alock.release();
    383412    AutoWriteLock mlock(m->pMachine COMMA_LOCKVAL_SRC_POS);  // mParent is const, needs no locking
  • trunk/src/VBox/Main/src-server/MachineImpl.cpp

    r61009 r61042  
    193193    mLongMode =  HC_ARCH_BITS == 64 ? settings::Hardware::LongMode_Enabled : settings::Hardware::LongMode_Disabled;
    194194    mTripleFaultReset = false;
     195    mAPIC = true;
     196    mX2APIC = false;
    195197    mHPETEnabled = false;
    196198    mCpuExecutionCap = 100; /* Maximum CPU execution cap by default. */
     
    22492251            break;
    22502252
     2253        case CPUPropertyType_APIC:
     2254            *aValue = mHWData->mAPIC;
     2255            break;
     2256
     2257        case CPUPropertyType_X2APIC:
     2258            *aValue = mHWData->mX2APIC;
     2259            break;
     2260
    22512261        default:
    22522262            return E_INVALIDARG;
     
    22802290            mHWData.backup();
    22812291            mHWData->mTripleFaultReset = !!aValue;
     2292            break;
     2293
     2294        case CPUPropertyType_APIC:
     2295            if (mHWData->mX2APIC)
     2296                aValue = TRUE;
     2297            i_setModified(IsModified_MachineData);
     2298            mHWData.backup();
     2299            mHWData->mAPIC = !!aValue;
     2300            break;
     2301
     2302        case CPUPropertyType_X2APIC:
     2303            i_setModified(IsModified_MachineData);
     2304            mHWData.backup();
     2305            mHWData->mX2APIC = !!aValue;
     2306            if (aValue)
     2307                mHWData->mAPIC = !!aValue;
    22822308            break;
    22832309
     
    88408866        mHWData->mLongMode                    = data.enmLongMode;
    88418867        mHWData->mTripleFaultReset            = data.fTripleFaultReset;
     8868        mHWData->mAPIC                        = data.fAPIC;
     8869        mHWData->mX2APIC                      = data.fX2APIC;
    88428870        mHWData->mCPUCount                    = data.cCPUs;
    88438871        mHWData->mCPUHotPlugEnabled           = data.fCpuHotPlug;
     
    1015910187        data.enmLongMode            = mHWData->mLongMode;
    1016010188        data.fTripleFaultReset      = !!mHWData->mTripleFaultReset;
     10189        data.fAPIC                  = !!mHWData->mAPIC;
     10190        data.fX2APIC                = !!mHWData->mX2APIC;
    1016110191        data.cCPUs                  = mHWData->mCPUCount;
    1016210192        data.fCpuHotPlug            = !!mHWData->mCPUHotPlugEnabled;
  • trunk/src/VBox/Main/xml/Settings.cpp

    r61036 r61042  
    21552155    fLogoFadeIn(true),
    21562156    fLogoFadeOut(true),
     2157    fPXEDebugEnabled(false),
    21572158    ulLogoDisplayTime(0),
    21582159    biosBootMenuMode(BIOSBootMenuMode_MessageAndMenu),
    2159     fPXEDebugEnabled(false),
     2160    apicMode(APICMode_APIC),
    21602161    llTimeOffset(0)
    21612162{
     
    21712172        && fLogoFadeIn
    21722173        && fLogoFadeOut
     2174        && !fPXEDebugEnabled
    21732175        && ulLogoDisplayTime == 0
    21742176        && biosBootMenuMode == BIOSBootMenuMode_MessageAndMenu
    2175         && !fPXEDebugEnabled
    2176         && llTimeOffset == 0;
     2177        && apicMode == APICMode_APIC
     2178        && llTimeOffset == 0
     2179        && strLogoImagePath.isEmpty();
    21772180}
    21782181
     
    21892192            && fLogoFadeIn         == d.fLogoFadeIn
    21902193            && fLogoFadeOut        == d.fLogoFadeOut
     2194            && fPXEDebugEnabled    == d.fPXEDebugEnabled
    21912195            && ulLogoDisplayTime   == d.ulLogoDisplayTime
    2192             && strLogoImagePath    == d.strLogoImagePath
    21932196            && biosBootMenuMode    == d.biosBootMenuMode
    2194             && fPXEDebugEnabled    == d.fPXEDebugEnabled
    2195             && llTimeOffset        == d.llTimeOffset);
     2197            && apicMode            == d.apicMode
     2198            && llTimeOffset        == d.llTimeOffset
     2199            && strLogoImagePath    == d.strLogoImagePath);
    21962200}
    21972201
     
    26922696    fTripleFaultReset(false),
    26932697    fPAE(false),
     2698    fAPIC(true),
     2699    fX2APIC(false),
    26942700    enmLongMode(HC_ARCH_BITS == 64 ? Hardware::LongMode_Enabled : Hardware::LongMode_Disabled),
    26952701    cCPUs(1),
     
    28422848            && enmLongMode               == h.enmLongMode
    28432849            && fTripleFaultReset         == h.fTripleFaultReset
     2850            && fAPIC                     == h.fAPIC
     2851            && fX2APIC                   == h.fX2APIC
    28442852            && cCPUs                     == h.cCPUs
    28452853            && fCpuHotPlug               == h.fCpuHotPlug
     
    37953803                pelmCPUChild->getAttributeValue("enabled", hw.fTripleFaultReset);
    37963804
     3805            if ((pelmCPUChild = pelmHwChild->findChildElement("APIC")))
     3806                pelmCPUChild->getAttributeValue("enabled", hw.fAPIC);
     3807            if ((pelmCPUChild = pelmHwChild->findChildElement("X2APIC")))
     3808                pelmCPUChild->getAttributeValue("enabled", hw.fX2APIC);
     3809
    37973810            if ((pelmCPUChild = pelmHwChild->findChildElement("CpuIdTree")))
    37983811                readCpuIdTree(*pelmCPUChild, hw.llCpuIdLeafs);
     
    40784091            if ((pelmBIOSChild = pelmHwChild->findChildElement("IOAPIC")))
    40794092                pelmBIOSChild->getAttributeValue("enabled", hw.biosSettings.fIOAPICEnabled);
     4093            if ((pelmBIOSChild = pelmHwChild->findChildElement("APIC")))
     4094            {
     4095                Utf8Str strAPIC;
     4096                if (pelmBIOSChild->getAttributeValue("mode", strAPIC))
     4097                {
     4098                    strAPIC.toUpper();
     4099                    if (strAPIC == "DISABLED")
     4100                        hw.biosSettings.apicMode = APICMode_Disabled;
     4101                    else if (strAPIC == "APIC")
     4102                        hw.biosSettings.apicMode = APICMode_APIC;
     4103                    else if (strAPIC == "X2APIC")
     4104                        hw.biosSettings.apicMode = APICMode_X2APIC;
     4105                    else
     4106                        throw ConfigFileError(this, pelmBIOSChild, N_("Invalid value '%s' in APIC/@mode attribute"), strAPIC.c_str());
     4107                }
     4108            }
    40804109            if ((pelmBIOSChild = pelmHwChild->findChildElement("Logo")))
    40814110            {
     
    51005129    // PAE has too crazy default handling, must always save this setting.
    51015130    pelmCPU->createChild("PAE")->setAttribute("enabled", hw.fPAE);
     5131    if (m->sv >= SettingsVersion_v1_16)
     5132    {
     5133    }
    51025134    if (m->sv >= SettingsVersion_v1_14 && hw.enmLongMode != Hardware::LongMode_Legacy)
    51035135    {
     
    51085140    if (hw.fTripleFaultReset)
    51095141        pelmCPU->createChild("TripleFaultReset")->setAttribute("enabled", hw.fTripleFaultReset);
     5142    if (m->sv >= SettingsVersion_v1_14)
     5143    {
     5144        if (hw.fX2APIC)
     5145            pelmCPU->createChild("X2APIC")->setAttribute("enabled", hw.fX2APIC);
     5146        else if (!hw.fAPIC)
     5147            pelmCPU->createChild("APIC")->setAttribute("enabled", hw.fAPIC);
     5148    }
    51105149    if (hw.cCPUs > 1)
    51115150        pelmCPU->setAttribute("count", hw.cCPUs);
     
    54505489        if (hw.biosSettings.fIOAPICEnabled)
    54515490            pelmBIOS->createChild("IOAPIC")->setAttribute("enabled", hw.biosSettings.fIOAPICEnabled);
     5491        if (hw.biosSettings.apicMode != APICMode_APIC)
     5492        {
     5493            const char *pcszAPIC;
     5494            switch (hw.biosSettings.apicMode)
     5495            {
     5496                case APICMode_Disabled:
     5497                    pcszAPIC = "Disabled";
     5498                    break;
     5499                case APICMode_APIC:
     5500                default:
     5501                    pcszAPIC = "APIC";
     5502                    break;
     5503                case APICMode_X2APIC:
     5504                    pcszAPIC = "X2APIC";
     5505                    break;
     5506            }
     5507            pelmBIOS->createChild("APIC")->setAttribute("mode", pcszAPIC);
     5508        }
    54525509
    54535510        if (   !hw.biosSettings.fLogoFadeIn
     
    67266783    if (m->sv < SettingsVersion_v1_16)
    67276784    {
    6728         // VirtualBox 5.1 adds a NVMe storage controller, paravirt debug options, cpu profile.
     6785        // VirtualBox 5.1 adds a NVMe storage controller, paravirt debug
     6786        // options, cpu profile, APIC settings (CPU capability and BIOS).
    67296787
    67306788        if (   hardwareMachine.strParavirtDebug.isNotEmpty()
    6731             || (!hardwareMachine.strCpuProfile.equals("host") && hardwareMachine.strCpuProfile.isNotEmpty())
     6789            || (!hardwareMachine.strCpuProfile.equals("host") && hardwareMachine.strCpuProfile.isNotEmpty()
     6790            || hardwareMachine.biosSettings.apicMode != APICMode_APIC
     6791            || !hardwareMachine.fAPIC
     6792            || hardwareMachine.fX2APIC)
    67326793           )
    67336794        {
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