VirtualBox

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


Ignore:
Timestamp:
Sep 7, 2023 8:59:15 AM (17 months ago)
Author:
vboxsync
Message:

Initial commit (based draft v2 / on patch v5) for implementing platform architecture support for x86 and ARM. bugref:10384

Location:
trunk/src/VBox/Main
Files:
15 added
2 deleted
32 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/Makefile.kmk

    r100606 r101035  
    570570        $(if $(VBOX_WITH_TPM),VBOX_WITH_TPM,) \
    571571        $(if $(VBOX_WITH_FULL_VM_ENCRYPTION),VBOX_WITH_FULL_VM_ENCRYPTION,) \
    572         $(if-expr defined(VBOX_WITH_SDS),VBOX_WITH_SDS,)
     572        $(if-expr defined(VBOX_WITH_SDS),VBOX_WITH_SDS,) \
     573        $(if $(VBOX_WITH_VIRT_ARMV8),VBOX_WITH_VIRT_ARMV8,)
    573574 ifdef VBOX_WITH_USB
    574575  VBoxSVC_DEFS += \
     
    637638        src-all/NvramStoreImpl.cpp \
    638639        src-all/PCIDeviceAttachmentImpl.cpp \
     640        src-all/PlatformPropertiesImpl.cpp \
    639641        src-all/ProgressImpl.cpp \
    640642        src-all/SecretKeyStore.cpp \
     
    653655        src-server/BandwidthControlImpl.cpp \
    654656        src-server/BandwidthGroupImpl.cpp \
    655         src-server/BIOSSettingsImpl.cpp \
     657        src-server/FirmwareSettingsImpl.cpp \
    656658        src-server/RecordingSettingsImpl.cpp \
    657659        src-server/RecordingScreenSettingsImpl.cpp \
     
    674676        src-server/HostDnsService.cpp \
    675677        src-server/HostImpl.cpp \
     678        src-server/HostX86Impl.cpp \
    676679        src-server/HostAudioDeviceImpl.cpp \
    677680        src-server/HostNetworkInterfaceImpl.cpp \
     
    697700        src-server/NetworkAdapterImpl.cpp \
    698701        src-server/ParallelPortImpl.cpp \
     702        src-server/PlatformBase.cpp \
     703        src-server/PlatformImpl.cpp \
     704        $(if $(VBOX_WITH_VIRT_ARMV8), src-server/PlatformARMImpl.cpp,) \
     705        src-server/PlatformX86Impl.cpp \
    699706        src-server/ProgressProxyImpl.cpp \
    700707        src-server/SerialPortImpl.cpp \
     
    11391146        src-all/NvramStoreImpl.cpp \
    11401147        src-all/PCIDeviceAttachmentImpl.cpp \
     1148        src-all/PlatformPropertiesImpl.cpp \
    11411149        src-all/ProgressImpl.cpp \
    11421150        src-all/SecretKeyStore.cpp \
  • trunk/src/VBox/Main/idl/VirtualBox.xidl

    r100807 r101035  
    297297<application
    298298  name="VirtualBox"
    299   uuid="819B4D85-9CEE-493C-B6FC-64FFE759B3C9"
     299  uuid="a89ce63a-c7c9-4380-a62a-ffb9052ddb37"
    300300  supportsErrorInfo="yes"
    301301>
     
    464464  </result>
    465465
     466  <result name="VBOX_E_PLATFORM_ARCH_NOT_SUPPORTED" value="0x80BB0012">
     467    <desc>
     468      Platform architecture is not supported.
     469    </desc>
     470  </result>
     471
    466472  <!--
    467473    Note that src/VBox/Runtime/common/err/errmsgvboxcom.xsl will ignore
     
    479485  <enum
    480486    name="SettingsVersion"
    481     uuid="b4cc23c2-96f2-419d-830b-bd13c1135dfb"
     487    uuid="6ad3da60-5ed2-49cd-b882-96a72308ebf6"
    482488    >
    483489    <desc>
     
    629635      -->
    630636    </const>
     637    <const name="v1_20" value="22">
     638      <desc>Settings version "1.20", written by VirtualBox 7.1.x.</desc>
     639      <!--
     640          Adds VM platform support: Non-platform-specific
     641          settings were moved to the new Platform element, which now contains
     642          the platform architecture for this VM. x86-specific
     643          settings were moved from Machine to a new, dedicated Platform/x86 element.
     644          BIOSSettings were renamed to FirmwareSettings.
     645      -->
     646    </const>
    631647    <const name="Future" value="99999">
    632       <desc>Settings version greater than "1.19", written by a future VirtualBox version.</desc>
     648      <desc>Settings version greater than "1.20", written by a future VirtualBox version.</desc>
    633649    </const>
    634650  </enum>
     
    10141030
    10151031  <enum
     1032    name="PlatformArchitecture"
     1033    uuid="36e21926-1713-413d-8cf5-2f169b2cbcf3"
     1034    >
     1035    <desc>
     1036      Platform architecture.
     1037      <note>
     1038        <para>This does not specify the CPU type.
     1039          See <link to="CPUArchitecture"/> for more information.</para>
     1040      </note>
     1041    </desc>
     1042    <const name="None" value="0">
     1043      <desc>No platform selected. Never used by the API.</desc>
     1044    </const>
     1045    <const name="x86"  value="1">
     1046      <desc>
     1047        x86-based platform (AMD64 / x86).
     1048        Valid CPUArchitecture choices: <link to="CPUArchitecture_AMD64"/>, <link to="CPUArchitecture_x86"/>
     1049      </desc>
     1050    </const>
     1051    <const name="ARM"  value="2">
     1052      <desc>
     1053        ARM-based platform (AArch32, AArch64).
     1054        Valid CPUArchitecture choices: <link to="CPUArchitecture_ARMv8_32"/>, <link to="CPUArchitecture_ARMv8_64"/>
     1055      </desc>
     1056    </const>
     1057  </enum>
     1058
     1059  <enum
    10161060    name="CPUArchitecture"
    1017     uuid="4a2c9915-12f1-43b2-bb84-e4bd4d5ca227"
     1061    uuid="12906c63-9967-49c8-ba5a-6521adaf0185"
    10181062    >
    10191063    <desc>Basic CPU architecture types.</desc>
     
    10271071      <desc>64-bit x86.  (Also known as x86-64 or x64.)</desc>
    10281072    </const>
     1073    <const name="ARMv8_32"            value="3">
     1074      <desc>32-bit only ARMv8. (Also known as AArch32 or ARM32.)</desc>
     1075    </const>
     1076    <const name="ARMv8_64"            value="4">
     1077      <desc>64-bit only ARMv8. (Also known as AArch64 or ARM64.)</desc>
     1078    </const>
    10291079  </enum>
    10301080
    10311081  <enum
    1032     name="CPUPropertyType"
    1033     uuid="3fcfe589-ca66-468f-e313-656f9d0b2eb6"
    1034     >
    1035     <desc>
    1036       Virtual CPU property type. This enumeration represents possible values of the
    1037       IMachine get- and setCPUProperty methods.
     1082    name="CPUPropertyTypeX86"
     1083    uuid="a754b765-3687-4a68-abb9-78dcf4c07d5f"
     1084    >
     1085    <desc>
     1086      Virtual CPU property type for x86-based CPUs. This enumeration represents possible values of the
     1087      IPlatformX86 get- and setCPUProperty methods.
    10381088    </desc>
    10391089    <const name="Null"                  value="0">
     
    11441194  </enum>
    11451195
    1146 
    11471196  <enum
    11481197    name="HWVirtExPropertyType"
     
    11511200    <desc>
    11521201      Hardware virtualization property type. This enumeration represents possible values
    1153       for the <link to="IMachine::getHWVirtExProperty"/> and
    1154       <link to="IMachine::setHWVirtExProperty"/> methods.
     1202      for the <link to="IPlatformX86::getHWVirtExProperty"/> and
     1203      <link to="IPlatformX86::setHWVirtExProperty"/> methods.
    11551204    </desc>
    11561205    <const name="Null"                  value="0">
     
    13901439
    13911440  <enum
    1392     name="BIOSBootMenuMode"
    1393     uuid="ae4fb9f7-29d2-45b4-b2c7-d579603135d5"
     1441    name="FirmwareBootMenuMode"
     1442    uuid="bf88ec90-7fbb-4c78-bd71-5f8751d71450"
    13941443    >
    13951444    <desc>
     
    14411490    </desc>
    14421491    <const name="BIOS"              value="1">
    1443       <desc>BIOS Firmware.</desc>
     1492      <desc>BIOS Firmware. Only applicable to x86 platforms.</desc>
    14441493    </const>
    14451494    <const name="EFI"               value="2">
     
    26522701  <interface
    26532702    name="IVirtualBox" extends="$unknown"
    2654     uuid="7682d5eb-f00e-44f1-8ca2-99d08b1cd607"
     2703    uuid="0f22e6d1-07f5-4168-b3ef-167c57670c17"
    26552704    wsmap="managed"
    26562705    rest="managed"
     
    29502999    </method>
    29513000
     3001    <method name="getPlatformProperties">
     3002      <rest name="getPlatformProperties" request="get" path="/platform/properties"/>
     3003      <desc>
     3004        Gets the associated properties object for the given VM platform architecture.
     3005      </desc>
     3006      <param name="architecture" type="PlatformArchitecture" dir="in">
     3007        <desc>
     3008          The platform architecture to return the platform properties for.
     3009        </desc>
     3010      </param>
     3011      <param name="properties" type="IPlatformProperties" dir="return">
     3012        <desc>
     3013          Returned platform properties.
     3014        </desc>
     3015      </param>
     3016    </method>
     3017
    29523018    <method name="createMachine">
    29533019      <rest name="create" request="post" path="/vms/"/>
     
    30333099      <param name="name" type="wstring" dir="in">
    30343100        <desc>Machine name.</desc>
     3101      </param>
     3102      <param name="platform" type="PlatformArchitecture" dir="in">
     3103        <desc>The platform architecture for the new VM.</desc>
    30353104      </param>
    30363105      <param name="groups" type="wstring" safearray="yes" dir="in">
     
    56285697
    56295698  <interface
    5630     name="IBIOSSettings" extends="$unknown"
    5631     uuid="a0a7f210-b857-4468-be26-c29f36a84345"
     5699    name="IFirmwareSettings" extends="$unknown"
     5700    uuid="7831C899-DF5D-456A-A37B-0D4EC05D54D0"
    56325701    wsmap="managed"
    56335702    rest="managed"
     
    56355704    >
    56365705    <desc>
    5637         The IBIOSSettings interface represents BIOS settings of the virtual
    5638         machine. This is used only in the <link to="IMachine::BIOSSettings" /> attribute.
    5639     </desc>
     5706        The IFirmwareSettings interface represents firmware settings of the virtual
     5707        machine. This is used only in the <link to="IMachine::firmwareSettings" /> attribute.
     5708    </desc>
     5709
     5710    <attribute name="firmwareType" type="FirmwareType">
     5711      <desc>Type of firmware (such as legacy BIOS or EFI), used for initial
     5712        bootstrap in this VM.</desc>
     5713    </attribute>
     5714
    56405715    <attribute name="logoFadeIn" type="boolean">
    56415716      <desc>Fade in flag for BIOS logo animation.</desc>
     
    56575732    </attribute>
    56585733
    5659     <attribute name="bootMenuMode" type="BIOSBootMenuMode">
    5660       <desc>Mode of the BIOS boot device menu.</desc>
     5734    <attribute name="bootMenuMode" type="FirmwareBootMenuMode">
     5735      <desc>Mode of the firmware boot device menu.</desc>
    56615736    </attribute>
    56625737
     
    66986773    <desc>
    66996774      The IOMMU type. This enumeration represents possible
    6700       values for the <link to="IMachine::iommuType"/> attribute.
     6775      values for the <link to="IPlatform::iommuType"/> attribute.
    67016776    </desc>
    67026777    <const name="None"      value="0">
     
    67156790
    67166791  <interface
     6792    name="IPlatform" extends="$unknown"
     6793    uuid="a670a023-e172-452c-b731-14ef855f4da6"
     6794    wsmap="managed"
     6795    rest="managed"
     6796    reservedMethods="8" reservedAttributes="16">
     6797
     6798    <desc>
     6799      Platform object for a virtual machine.
     6800
     6801      Accessed via <link to="IMachine::platform"/>.
     6802    </desc>
     6803
     6804    <attribute name="architecture" type="PlatformArchitecture" readonly="no">
     6805      <desc>
     6806        Returns the platform architecture.
     6807
     6808        Changing this means settings for the previously selected architecture
     6809        will be discarded and replaced by defaults.
     6810
     6811        <note>Setting the platform architecture currently is
     6812          not implemented yet.</note>
     6813
     6814        <result name="E_NOTIMPL">
     6815          Not implemented yet.
     6816        </result>
     6817      </desc>
     6818    </attribute>
     6819
     6820    <attribute name="properties" type="IPlatformProperties" readonly="yes">
     6821      <desc>
     6822        Returns the platform properties.
     6823      </desc>
     6824    </attribute>
     6825
     6826    <attribute name="x86" type="IPlatformX86" readonly="yes">
     6827      <desc>
     6828        Platform object for x86-specific platform properties.
     6829
     6830        Changes to this object will not necessarily be preserved unless
     6831        <link to="IPlatform::architecture"/> is set to <link to="PlatformArchitecture_x86"/>.
     6832      </desc>
     6833
     6834      <result name="VBOX_E_PLATFORM_ARCH_NOT_SUPPORTED">
     6835        Current platform  architecture is not x86.
     6836      </result>
     6837    </attribute>
     6838
     6839    <attribute name="ARM" type="IPlatformARM" readonly="yes">
     6840      <desc>
     6841        Platform object for ARM-specific platform properties.
     6842
     6843        Changes to this object will not necessarily be preserved unless
     6844        <link to="IPlatform::architecture"/> is set to <link to="PlatformArchitecture_ARM"/>.
     6845      </desc>
     6846
     6847      <result name="VBOX_E_PLATFORM_ARCH_NOT_SUPPORTED">
     6848        Current platform  architecture is not ARM.
     6849      </result>
     6850    </attribute>
     6851
     6852    <!-- Properties common to both (placed here to reduce IMachine bloat): -->
     6853
     6854    <attribute name="chipsetType" type="ChipsetType">
     6855      <desc>Chipset type used in this VM.</desc>
     6856    </attribute>
     6857
     6858    <attribute name="iommuType" type="IommuType">
     6859      <desc>IOMMU type used in this VM.</desc>
     6860    </attribute>
     6861
     6862    <attribute name="RTCUseUTC" type="boolean">
     6863      <desc>
     6864        When set to @a true, the RTC device of the virtual machine will run
     6865        in UTC time, otherwise in local time. Especially Unix guests prefer
     6866        the time in UTC.
     6867      </desc>
     6868    </attribute>
     6869
     6870  </interface>
     6871
     6872  <interface
     6873    name="IPlatformX86" extends="$unknown"
     6874    uuid="5ada589f-09c9-4604-b700-9ab3a5572e3a"
     6875    wsmap="managed"
     6876    rest="managed"
     6877    reservedMethods="8" reservedAttributes="16">
     6878
     6879    <desc>
     6880      The x86 specific platform properties for a virtual machine.
     6881
     6882      Accessed via <link to="IMachine::platform"/> and <link to="IPlatform::x86"/>.
     6883    </desc>
     6884
     6885    <attribute name="HPETEnabled" type="boolean">
     6886      <desc>This attribute controls if High Precision Event Timer (HPET) is
     6887        enabled in this VM. Use this property if you want to provide guests
     6888        with additional time source, or if guest requires HPET to function correctly.
     6889        Default is false.</desc>
     6890    </attribute>
     6891
     6892    <method name="getCPUProperty" const="yes">
     6893      <rest request="get" path="/vms/{vmid}/configuration/"/>
     6894      <desc>
     6895        Returns the virtual CPU boolean value of the specified property.
     6896
     6897        <result name="E_INVALIDARG">
     6898          Invalid property.
     6899        </result>
     6900
     6901      </desc>
     6902      <param name="property" type="CPUPropertyTypeX86" dir="in">
     6903        <desc>
     6904          Property type to query.
     6905        </desc>
     6906      </param>
     6907      <param name="value" type="boolean" dir="return">
     6908        <desc>
     6909          Property value.
     6910        </desc>
     6911      </param>
     6912    </method>
     6913
     6914    <method name="setCPUProperty">
     6915      <rest request="post" path="/vms/{vmid}/configuration/"/>
     6916      <desc>
     6917        Sets the virtual CPU boolean value of the specified property.
     6918
     6919        <result name="E_INVALIDARG">
     6920          Invalid property.
     6921        </result>
     6922
     6923      </desc>
     6924      <param name="property" type="CPUPropertyTypeX86" dir="in">
     6925        <desc>
     6926          Property type to query.
     6927        </desc>
     6928      </param>
     6929      <param name="value" type="boolean" dir="in">
     6930        <desc>
     6931          Property value.
     6932        </desc>
     6933      </param>
     6934    </method>
     6935
     6936    <method name="getCPUIDLeafByOrdinal" const="yes">
     6937      <desc>
     6938        Used to enumerate CPUID information override values.
     6939
     6940        <result name="E_INVALIDARG">
     6941          Invalid ordinal number is out of range.
     6942        </result>
     6943      </desc>
     6944      <param name="ordinal" type="unsigned long" dir="in">
     6945        <desc>
     6946          The ordinal number of the leaf to get.
     6947        </desc>
     6948      </param>
     6949      <param name="idx" type="unsigned long" dir="out">
     6950        <desc>
     6951          CPUID leaf index.
     6952        </desc>
     6953      </param>
     6954      <param name="idxSub" type="unsigned long" dir="out">
     6955        <desc>
     6956          CPUID leaf sub-index.
     6957        </desc>
     6958      </param>
     6959      <param name="valEax" type="unsigned long" dir="out">
     6960        <desc>
     6961          CPUID leaf value for register eax.
     6962        </desc>
     6963      </param>
     6964      <param name="valEbx" type="unsigned long" dir="out">
     6965        <desc>
     6966          CPUID leaf value for register ebx.
     6967        </desc>
     6968      </param>
     6969      <param name="valEcx" type="unsigned long" dir="out">
     6970        <desc>
     6971          CPUID leaf value for register ecx.
     6972        </desc>
     6973      </param>
     6974      <param name="valEdx" type="unsigned long" dir="out">
     6975        <desc>
     6976          CPUID leaf value for register edx.
     6977        </desc>
     6978      </param>
     6979    </method>
     6980
     6981    <method name="getCPUIDLeaf" const="yes">
     6982      <desc>
     6983        Returns the virtual CPU cpuid information for the specified leaf.
     6984
     6985        Currently supported index values for cpuid:
     6986        Standard CPUID leaves: 0 - 0x1f
     6987        Extended CPUID leaves: 0x80000000 - 0x8000001f
     6988        VIA CPUID leaves:      0xc0000000 - 0xc000000f
     6989
     6990        See the Intel, AMD and VIA programmer's manuals for detailed information
     6991        about the CPUID instruction and its leaves.
     6992        <result name="E_INVALIDARG">
     6993          Invalid index.
     6994        </result>
     6995
     6996      </desc>
     6997      <param name="idx" type="unsigned long" dir="in">
     6998        <desc>
     6999          CPUID leaf index.
     7000        </desc>
     7001      </param>
     7002      <param name="idxSub" type="unsigned long" dir="in">
     7003        <desc>
     7004          CPUID leaf sub-index (ECX).  Set to 0xffffffff (or 0) if not applicable.
     7005        </desc>
     7006      </param>
     7007      <param name="valEax" type="unsigned long" dir="out">
     7008        <desc>
     7009          CPUID leaf value for register eax.
     7010        </desc>
     7011      </param>
     7012      <param name="valEbx" type="unsigned long" dir="out">
     7013        <desc>
     7014          CPUID leaf value for register ebx.
     7015        </desc>
     7016      </param>
     7017      <param name="valEcx" type="unsigned long" dir="out">
     7018        <desc>
     7019          CPUID leaf value for register ecx.
     7020        </desc>
     7021      </param>
     7022      <param name="valEdx" type="unsigned long" dir="out">
     7023        <desc>
     7024          CPUID leaf value for register edx.
     7025        </desc>
     7026      </param>
     7027    </method>
     7028
     7029    <method name="setCPUIDLeaf">
     7030      <desc>
     7031        Sets the virtual CPU cpuid information for the specified leaf. Note that these values
     7032        are not passed unmodified. VirtualBox clears features that it doesn't support.
     7033
     7034        Currently supported index values for cpuid:
     7035        Standard CPUID leaves: 0 - 0x1f
     7036        Extended CPUID leaves: 0x80000000 - 0x8000001f
     7037        VIA CPUID leaves:      0xc0000000 - 0xc000000f
     7038
     7039        The subleaf index is only applicable to certain leaves (see manuals as this is
     7040        subject to change).
     7041
     7042        See the Intel, AMD and VIA programmer's manuals for detailed information
     7043        about the cpuid instruction and its leaves.
     7044
     7045        Do not use this method unless you know exactly what you're doing. Misuse can lead to
     7046        random crashes inside VMs.
     7047        <result name="E_INVALIDARG">
     7048          Invalid index.
     7049        </result>
     7050
     7051      </desc>
     7052      <param name="idx" type="unsigned long" dir="in">
     7053        <desc>
     7054          CPUID leaf index.
     7055        </desc>
     7056      </param>
     7057      <param name="idxSub" type="unsigned long" dir="in">
     7058        <desc>
     7059          CPUID leaf sub-index (ECX).  Set to 0xffffffff (or 0) if not applicable.
     7060          The 0xffffffff causes it to remove all other subleaves before adding one
     7061          with sub-index 0.
     7062        </desc>
     7063      </param>
     7064      <param name="valEax" type="unsigned long" dir="in">
     7065        <desc>
     7066          CPUID leaf value for register eax.
     7067        </desc>
     7068      </param>
     7069      <param name="valEbx" type="unsigned long" dir="in">
     7070        <desc>
     7071          CPUID leaf value for register ebx.
     7072        </desc>
     7073      </param>
     7074      <param name="valEcx" type="unsigned long" dir="in">
     7075        <desc>
     7076          CPUID leaf value for register ecx.
     7077        </desc>
     7078      </param>
     7079      <param name="valEdx" type="unsigned long" dir="in">
     7080        <desc>
     7081          CPUID leaf value for register edx.
     7082        </desc>
     7083      </param>
     7084    </method>
     7085
     7086    <method name="removeCPUIDLeaf">
     7087      <desc>
     7088        Removes the virtual CPU cpuid leaf for the specified index
     7089
     7090        <result name="E_INVALIDARG">
     7091          Invalid index.
     7092        </result>
     7093
     7094      </desc>
     7095      <param name="idx" type="unsigned long" dir="in">
     7096        <desc>
     7097          CPUID leaf index.
     7098        </desc>
     7099      </param>
     7100      <param name="idxSub" type="unsigned long" dir="in">
     7101        <desc>
     7102          CPUID leaf sub-index (ECX).  Set to 0xffffffff (or 0) if not applicable.
     7103          The 0xffffffff value works like a wildcard.
     7104        </desc>
     7105      </param>
     7106    </method>
     7107
     7108    <method name="removeAllCPUIDLeaves">
     7109      <desc>
     7110        Removes all the virtual CPU cpuid leaves
     7111      </desc>
     7112    </method>
     7113
     7114    <method name="getHWVirtExProperty" const="yes">
     7115      <rest request="get" path="/vms/{vmid}/configuration/"/>
     7116      <desc>
     7117        Returns the value of the specified hardware virtualization boolean property.
     7118
     7119        <result name="E_INVALIDARG">
     7120          Invalid property.
     7121        </result>
     7122
     7123      </desc>
     7124      <param name="property" type="HWVirtExPropertyType" dir="in">
     7125        <desc>
     7126          Property type to query.
     7127        </desc>
     7128      </param>
     7129      <param name="value" type="boolean" dir="return">
     7130        <desc>
     7131          Property value.
     7132        </desc>
     7133      </param>
     7134    </method>
     7135
     7136    <method name="setHWVirtExProperty">
     7137      <rest request="post" path="/vms/{vmid}/configuration/"/>
     7138      <desc>
     7139        Sets a new value for the specified hardware virtualization boolean property.
     7140
     7141        <result name="E_INVALIDARG">
     7142          Invalid property.
     7143        </result>
     7144
     7145      </desc>
     7146      <param name="property" type="HWVirtExPropertyType" dir="in">
     7147        <desc>
     7148          Property type to set.
     7149        </desc>
     7150      </param>
     7151      <param name="value" type="boolean" dir="in">
     7152        <desc>
     7153          New property value.
     7154        </desc>
     7155      </param>
     7156    </method>
     7157
     7158  </interface>
     7159
     7160  <interface
     7161    name="IPlatformARM" extends="$unknown"
     7162    uuid="75dff9be-6cb3-4857-bde6-2faf82ed9a8d"
     7163    wsmap="managed"
     7164    rest="managed"
     7165    reservedMethods="8" reservedAttributes="16">
     7166
     7167    <desc>
     7168      The x86 specific platform properties for a virtual machine.
     7169
     7170      Accessed via <link to="IMachine::platform"/> and <link to="IPlatform::ARM"/>.
     7171    </desc>
     7172
     7173    <!-- Currently empty, but that should change before long... -->
     7174    <attribute name="midlDoesNotLikeEmptyInterfaces" readonly="yes" type="boolean"/>
     7175
     7176  </interface>
     7177
     7178  <interface
    67177179    name="IMachine" extends="$unknown"
    6718     uuid="300763af-5d6b-46e6-aa96-273eac15538a"
     7180    uuid="8161d51b-17b4-4598-add2-eb1fe1de6230"
    67197181    wsmap="managed"
    67207182    rest="managed"
     
    69727434    </attribute>
    69737435
    6974     <attribute name="BIOSSettings" type="IBIOSSettings" readonly="yes">
    6975       <desc>Object containing all BIOS settings.</desc>
     7436    <attribute name="platform" type="IPlatform" readonly="yes">
     7437      <desc>Associated platform object.</desc>
     7438    </attribute>
     7439
     7440    <attribute name="firmwareSettings" type="IFirmwareSettings" readonly="yes">
     7441      <desc>Object containing all firmware settings.</desc>
    69767442    </attribute>
    69777443
     
    69867452    <attribute name="recordingSettings" type="IRecordingSettings" readonly="yes">
    69877453      <desc>Object containing all recording settings.</desc>
    6988     </attribute>
    6989 
    6990     <attribute name="firmwareType" type="FirmwareType">
    6991       <desc>Type of firmware (such as legacy BIOS or EFI), used for initial
    6992         bootstrap in this VM.</desc>
    69937454    </attribute>
    69947455
     
    70037464        The default is typically "PS2Keyboard" but can vary depending on the
    70047465        requirements of the guest operating system.</desc>
    7005     </attribute>
    7006 
    7007     <attribute name="HPETEnabled" type="boolean">
    7008       <desc>This attribute controls if High Precision Event Timer (HPET) is
    7009         enabled in this VM. Use this property if you want to provide guests
    7010         with additional time source, or if guest requires HPET to function correctly.
    7011         Default is false.</desc>
    7012     </attribute>
    7013 
    7014     <attribute name="chipsetType" type="ChipsetType">
    7015       <desc>Chipset type used in this VM.</desc>
    7016     </attribute>
    7017 
    7018     <attribute name="iommuType" type="IommuType">
    7019       <desc>IOMMU type used in this VM.</desc>
    70207466    </attribute>
    70217467
     
    73217767    </attribute>
    73227768
    7323     <attribute name="RTCUseUTC" type="boolean">
    7324       <desc>
    7325         When set to @a true, the RTC device of the virtual machine will run
    7326         in UTC time, otherwise in local time. Especially Unix guests prefer
    7327         the time in UTC.
    7328       </desc>
    7329     </attribute>
    7330 
    73317769    <attribute name="IOCacheEnabled" type="boolean">
    73327770      <desc>
     
    77328170          Position in the boot order (@c 1 to the total number of
    77338171          devices the machine can boot from, as returned by
    7734           <link to="ISystemProperties::maxBootPosition"/>).
     8172          <link to="IPlatformProperties::maxBootPosition"/>).
    77358173        </desc>
    77368174      </param>
     
    77678205          Position in the boot order (@c 1 to the total number of
    77688206          devices the machine can boot from, as returned by
    7769           <link to="ISystemProperties::maxBootPosition"/>).
     8207          <link to="IPlatformProperties::maxBootPosition"/>).
    77708208        </desc>
    77718209      </param>
     
    85008938        Slots are numbered sequentially, starting with zero. The total
    85018939        number of adapters per machine is defined by the
    8502         <link to="ISystemProperties::getMaxNetworkAdapters"/> property,
     8940        <link to="IPlatformProperties::getMaxNetworkAdapters"/> property,
    85038941        so the maximum slot number is one less than that property's value.
    85048942
     
    86589096        Slots are numbered sequentially, starting with zero. The total
    86599097        number of serial ports per machine is defined by the
    8660         <link to="ISystemProperties::serialPortCount"/> property,
     9098        <link to="IPlatformProperties::serialPortCount"/> property,
    86619099        so the maximum slot number is one less than that property's value.
    86629100
     
    86769114        Slots are numbered sequentially, starting with zero. The total
    86779115        number of parallel ports per machine is defined by the
    8678         <link to="ISystemProperties::parallelPortCount"/> property,
     9116        <link to="IPlatformProperties::parallelPortCount"/> property,
    86799117        so the maximum slot number is one less than that property's value.
    86809118
     
    87729210    </method>
    87739211
    8774     <method name="getCPUProperty" const="yes">
    8775       <rest request="get" path="/vms/{vmid}/configuration/"/>
    8776       <desc>
    8777         Returns the virtual CPU boolean value of the specified property.
    8778 
    8779         <result name="E_INVALIDARG">
    8780           Invalid property.
    8781         </result>
    8782 
    8783       </desc>
    8784       <param name="property" type="CPUPropertyType" dir="in">
    8785         <desc>
    8786           Property type to query.
    8787         </desc>
    8788       </param>
    8789       <param name="value" type="boolean" dir="return">
    8790         <desc>
    8791           Property value.
    8792         </desc>
    8793       </param>
    8794     </method>
    8795 
    8796     <method name="setCPUProperty">
    8797       <rest request="post" path="/vms/{vmid}/configuration/"/>
    8798       <desc>
    8799         Sets the virtual CPU boolean value of the specified property.
    8800 
    8801         <result name="E_INVALIDARG">
    8802           Invalid property.
    8803         </result>
    8804 
    8805       </desc>
    8806       <param name="property" type="CPUPropertyType" dir="in">
    8807         <desc>
    8808           Property type to query.
    8809         </desc>
    8810       </param>
    8811       <param name="value" type="boolean" dir="in">
    8812         <desc>
    8813           Property value.
    8814         </desc>
    8815       </param>
    8816     </method>
    8817 
    8818     <method name="getCPUIDLeafByOrdinal" const="yes">
    8819       <desc>
    8820         Used to enumerate CPUID information override values.
    8821 
    8822         <result name="E_INVALIDARG">
    8823           Invalid ordinal number is out of range.
    8824         </result>
    8825       </desc>
    8826       <param name="ordinal" type="unsigned long" dir="in">
    8827         <desc>
    8828           The ordinal number of the leaf to get.
    8829         </desc>
    8830       </param>
    8831       <param name="idx" type="unsigned long" dir="out">
    8832         <desc>
    8833           CPUID leaf index.
    8834         </desc>
    8835       </param>
    8836       <param name="idxSub" type="unsigned long" dir="out">
    8837         <desc>
    8838           CPUID leaf sub-index.
    8839         </desc>
    8840       </param>
    8841       <param name="valEax" type="unsigned long" dir="out">
    8842         <desc>
    8843           CPUID leaf value for register eax.
    8844         </desc>
    8845       </param>
    8846       <param name="valEbx" type="unsigned long" dir="out">
    8847         <desc>
    8848           CPUID leaf value for register ebx.
    8849         </desc>
    8850       </param>
    8851       <param name="valEcx" type="unsigned long" dir="out">
    8852         <desc>
    8853           CPUID leaf value for register ecx.
    8854         </desc>
    8855       </param>
    8856       <param name="valEdx" type="unsigned long" dir="out">
    8857         <desc>
    8858           CPUID leaf value for register edx.
    8859         </desc>
    8860       </param>
    8861     </method>
    8862 
    8863     <method name="getCPUIDLeaf" const="yes">
    8864       <desc>
    8865         Returns the virtual CPU cpuid information for the specified leaf.
    8866 
    8867         Currently supported index values for cpuid:
    8868         Standard CPUID leaves: 0 - 0x1f
    8869         Extended CPUID leaves: 0x80000000 - 0x8000001f
    8870         VIA CPUID leaves:      0xc0000000 - 0xc000000f
    8871 
    8872         See the Intel, AMD and VIA programmer's manuals for detailed information
    8873         about the CPUID instruction and its leaves.
    8874         <result name="E_INVALIDARG">
    8875           Invalid index.
    8876         </result>
    8877 
    8878       </desc>
    8879       <param name="idx" type="unsigned long" dir="in">
    8880         <desc>
    8881           CPUID leaf index.
    8882         </desc>
    8883       </param>
    8884       <param name="idxSub" type="unsigned long" dir="in">
    8885         <desc>
    8886           CPUID leaf sub-index (ECX).  Set to 0xffffffff (or 0) if not applicable.
    8887         </desc>
    8888       </param>
    8889       <param name="valEax" type="unsigned long" dir="out">
    8890         <desc>
    8891           CPUID leaf value for register eax.
    8892         </desc>
    8893       </param>
    8894       <param name="valEbx" type="unsigned long" dir="out">
    8895         <desc>
    8896           CPUID leaf value for register ebx.
    8897         </desc>
    8898       </param>
    8899       <param name="valEcx" type="unsigned long" dir="out">
    8900         <desc>
    8901           CPUID leaf value for register ecx.
    8902         </desc>
    8903       </param>
    8904       <param name="valEdx" type="unsigned long" dir="out">
    8905         <desc>
    8906           CPUID leaf value for register edx.
    8907         </desc>
    8908       </param>
    8909     </method>
    8910 
    8911     <method name="setCPUIDLeaf">
    8912       <desc>
    8913         Sets the virtual CPU cpuid information for the specified leaf. Note that these values
    8914         are not passed unmodified. VirtualBox clears features that it doesn't support.
    8915 
    8916         Currently supported index values for cpuid:
    8917         Standard CPUID leaves: 0 - 0x1f
    8918         Extended CPUID leaves: 0x80000000 - 0x8000001f
    8919         VIA CPUID leaves:      0xc0000000 - 0xc000000f
    8920 
    8921         The subleaf index is only applicable to certain leaves (see manuals as this is
    8922         subject to change).
    8923 
    8924         See the Intel, AMD and VIA programmer's manuals for detailed information
    8925         about the cpuid instruction and its leaves.
    8926 
    8927         Do not use this method unless you know exactly what you're doing. Misuse can lead to
    8928         random crashes inside VMs.
    8929         <result name="E_INVALIDARG">
    8930           Invalid index.
    8931         </result>
    8932 
    8933       </desc>
    8934       <param name="idx" type="unsigned long" dir="in">
    8935         <desc>
    8936           CPUID leaf index.
    8937         </desc>
    8938       </param>
    8939       <param name="idxSub" type="unsigned long" dir="in">
    8940         <desc>
    8941           CPUID leaf sub-index (ECX).  Set to 0xffffffff (or 0) if not applicable.
    8942           The 0xffffffff causes it to remove all other subleaves before adding one
    8943           with sub-index 0.
    8944         </desc>
    8945       </param>
    8946       <param name="valEax" type="unsigned long" dir="in">
    8947         <desc>
    8948           CPUID leaf value for register eax.
    8949         </desc>
    8950       </param>
    8951       <param name="valEbx" type="unsigned long" dir="in">
    8952         <desc>
    8953           CPUID leaf value for register ebx.
    8954         </desc>
    8955       </param>
    8956       <param name="valEcx" type="unsigned long" dir="in">
    8957         <desc>
    8958           CPUID leaf value for register ecx.
    8959         </desc>
    8960       </param>
    8961       <param name="valEdx" type="unsigned long" dir="in">
    8962         <desc>
    8963           CPUID leaf value for register edx.
    8964         </desc>
    8965       </param>
    8966     </method>
    8967 
    8968     <method name="removeCPUIDLeaf">
    8969       <desc>
    8970         Removes the virtual CPU cpuid leaf for the specified index
    8971 
    8972         <result name="E_INVALIDARG">
    8973           Invalid index.
    8974         </result>
    8975 
    8976       </desc>
    8977       <param name="idx" type="unsigned long" dir="in">
    8978         <desc>
    8979           CPUID leaf index.
    8980         </desc>
    8981       </param>
    8982       <param name="idxSub" type="unsigned long" dir="in">
    8983         <desc>
    8984           CPUID leaf sub-index (ECX).  Set to 0xffffffff (or 0) if not applicable.
    8985           The 0xffffffff value works like a wildcard.
    8986         </desc>
    8987       </param>
    8988     </method>
    8989 
    8990     <method name="removeAllCPUIDLeaves">
    8991       <desc>
    8992         Removes all the virtual CPU cpuid leaves
    8993       </desc>
    8994     </method>
    8995 
    8996     <method name="getHWVirtExProperty" const="yes">
    8997       <rest request="get" path="/vms/{vmid}/configuration/"/>
    8998       <desc>
    8999         Returns the value of the specified hardware virtualization boolean property.
    9000 
    9001         <result name="E_INVALIDARG">
    9002           Invalid property.
    9003         </result>
    9004 
    9005       </desc>
    9006       <param name="property" type="HWVirtExPropertyType" dir="in">
    9007         <desc>
    9008           Property type to query.
    9009         </desc>
    9010       </param>
    9011       <param name="value" type="boolean" dir="return">
    9012         <desc>
    9013           Property value.
    9014         </desc>
    9015       </param>
    9016     </method>
    9017 
    9018     <method name="setHWVirtExProperty">
    9019       <rest request="post" path="/vms/{vmid}/configuration/"/>
    9020       <desc>
    9021         Sets a new value for the specified hardware virtualization boolean property.
    9022 
    9023         <result name="E_INVALIDARG">
    9024           Invalid property.
    9025         </result>
    9026 
    9027       </desc>
    9028       <param name="property" type="HWVirtExPropertyType" dir="in">
    9029         <desc>
    9030           Property type to set.
    9031         </desc>
    9032       </param>
    9033       <param name="value" type="boolean" dir="in">
    9034         <desc>
    9035           New property value.
    9036         </desc>
    9037       </param>
    9038     </method>
    9039 
    90409212    <method name="setSettingsFilePath">
    90419213      <rest request="post" path="/vms/{vmid}/configuration/"/>
     
    1187212044
    1187312045  <interface
     12046    name="IHostX86" extends="$unknown"
     12047    uuid="50c97996-9cf8-417f-bd79-1e0471367cd3"
     12048    wsmap="managed"
     12049    rest="managed"
     12050    reservedMethods="6" reservedAttributes="12"
     12051    >
     12052
     12053    <desc>
     12054      The x86 specific interface for the physical host machine.
     12055    </desc>
     12056
     12057    <method name="getProcessorCPUIDLeaf">
     12058      <desc>
     12059        Returns the CPU cpuid information for the specified leaf.
     12060      </desc>
     12061      <param name="cpuId" type="unsigned long" dir="in">
     12062        <desc>
     12063          Identifier of the CPU. The CPU must be online.
     12064          <note>
     12065            The current implementation might not necessarily return the
     12066            description for this exact CPU.
     12067          </note>
     12068        </desc>
     12069      </param>
     12070      <param name="leaf" type="unsigned long" dir="in">
     12071        <desc>
     12072          CPUID leaf index (eax).
     12073        </desc>
     12074      </param>
     12075      <param name="subLeaf" type="unsigned long" dir="in">
     12076        <desc>
     12077          CPUID leaf sub index (ecx). This currently only applies to cache
     12078          information on Intel CPUs. Use 0 if retrieving values for
     12079          <link to="IPlatformX86::setCPUIDLeaf"/>.
     12080        </desc>
     12081      </param>
     12082      <param name="valEax" type="unsigned long" dir="out">
     12083        <desc>
     12084          CPUID leaf value for register eax.
     12085        </desc>
     12086      </param>
     12087      <param name="valEbx" type="unsigned long" dir="out">
     12088        <desc>
     12089          CPUID leaf value for register ebx.
     12090        </desc>
     12091      </param>
     12092      <param name="valEcx" type="unsigned long" dir="out">
     12093        <desc>
     12094          CPUID leaf value for register ecx.
     12095        </desc>
     12096      </param>
     12097      <param name="valEdx" type="unsigned long" dir="out">
     12098        <desc>
     12099          CPUID leaf value for register edx.
     12100        </desc>
     12101      </param>
     12102    </method>
     12103
     12104  </interface>
     12105
     12106  <interface
    1187412107    name="IHost" extends="$unknown"
    1187512108    uuid="e54f6256-97a7-4947-8a78-10c013ddf4b8"
     
    1189012123
    1189112124    </desc>
     12125
     12126    <attribute name="architecture" type="PlatformArchitecture" readonly="yes">
     12127      <desc>Platform architecture type.</desc>
     12128    </attribute>
     12129
     12130    <attribute name="x86" type="IHostX86" readonly="yes">
     12131      <desc>Associated object for x86 host specifics.</desc>
     12132    </attribute>
     12133
    1189212134    <attribute name="DVDDrives" type="IMedium" readonly="yes" safearray="yes">
    1189312135      <desc>List of DVD drives available on the host.</desc>
     
    1202512267          Model string. An empty string is returned if value is not known or
    1202612268          @a cpuId is invalid.
    12027         </desc>
    12028       </param>
    12029     </method>
    12030 
    12031     <method name="getProcessorCPUIDLeaf">
    12032       <desc>
    12033         Returns the CPU cpuid information for the specified leaf.
    12034       </desc>
    12035       <param name="cpuId" type="unsigned long" dir="in">
    12036         <desc>
    12037           Identifier of the CPU. The CPU most be online.
    12038           <note>
    12039             The current implementation might not necessarily return the
    12040             description for this exact CPU.
    12041           </note>
    12042         </desc>
    12043       </param>
    12044       <param name="leaf" type="unsigned long" dir="in">
    12045         <desc>
    12046           CPUID leaf index (eax).
    12047         </desc>
    12048       </param>
    12049       <param name="subLeaf" type="unsigned long" dir="in">
    12050         <desc>
    12051           CPUID leaf sub index (ecx). This currently only applies to cache
    12052           information on Intel CPUs. Use 0 if retrieving values for
    12053           <link to="IMachine::setCPUIDLeaf"/>.
    12054         </desc>
    12055       </param>
    12056       <param name="valEax" type="unsigned long" dir="out">
    12057         <desc>
    12058           CPUID leaf value for register eax.
    12059         </desc>
    12060       </param>
    12061       <param name="valEbx" type="unsigned long" dir="out">
    12062         <desc>
    12063           CPUID leaf value for register ebx.
    12064         </desc>
    12065       </param>
    12066       <param name="valEcx" type="unsigned long" dir="out">
    12067         <desc>
    12068           CPUID leaf value for register ecx.
    12069         </desc>
    12070       </param>
    12071       <param name="valEdx" type="unsigned long" dir="out">
    12072         <desc>
    12073           CPUID leaf value for register edx.
    1207412269        </desc>
    1207512270      </param>
     
    1242212617  </interface>
    1242312618
     12619  <interface
     12620    name="IPlatformProperties"
     12621    extends="$unknown"
     12622    uuid="fb682653-c51d-42d4-bc30-db7c3e8bf75d"
     12623    wsmap="managed"
     12624    rest="managed"
     12625    reservedMethods="4" reservedAttributes="16"
     12626    >
     12627    <desc>
     12628      Properties of a specific virtualization platform.
     12629    </desc>
     12630
     12631    <attribute name="rawModeSupported" type="boolean" readonly="yes">
     12632      <desc>
     12633        Indicates whether VirtualBox was built with raw-mode support.
     12634
     12635        When this reads as False, the <link to="HWVirtExPropertyType_Enabled"/>
     12636        setting will be ignored and assumed to be True.
     12637
     12638        <note>For guest platform properties, this attribute is being
     12639          ignored.</note>
     12640      </desc>
     12641    </attribute>
     12642
     12643    <attribute name="exclusiveHwVirt" type="boolean">
     12644      <desc>
     12645        Exclusive use of hardware virtualization by VirtualBox. When enabled,
     12646        VirtualBox assumes it can obtain full and exclusive access to the VT-x
     12647        or AMD-V feature of the host. To share hardware virtualization with
     12648        other hypervisors, this property must be disabled.
     12649
     12650        <note>For hosts running on macOS this is being ignored, as the kernel
     12651          mediates hardware access there.</note>
     12652        <note>For guest platform properties, this attribute is being
     12653          ignored.</note>
     12654      </desc>
     12655    </attribute>
     12656
     12657    <attribute name="serialPortCount" type="unsigned long" readonly="yes">
     12658      <desc>
     12659        Maximum number of serial ports associated with every
     12660        <link to="IMachine"/> instance.
     12661      </desc>
     12662    </attribute>
     12663
     12664    <attribute name="parallelPortCount" type="unsigned long" readonly="yes">
     12665      <desc>
     12666        Maximum number of parallel ports associated with every
     12667        <link to="IMachine"/> instance.
     12668      </desc>
     12669    </attribute>
     12670
     12671    <attribute name="maxBootPosition" type="unsigned long" readonly="yes">
     12672      <desc>
     12673        Maximum device position in the boot order. This value corresponds
     12674        to the total number of devices a machine can boot from, to make it
     12675        possible to include all possible devices to the boot list.
     12676        <see><link to="IMachine::setBootOrder"/></see>
     12677      </desc>
     12678    </attribute>
     12679
     12680    <attribute name="supportedParavirtProviders" type="ParavirtProvider" safearray="yes" readonly="yes">
     12681      <desc>
     12682        Returns an array of officially supported values for enum <link to="ParavirtProvider"/>,
     12683        in the sense of what is e.g. worth offering in the VirtualBox GUI.
     12684      </desc>
     12685    </attribute>
     12686
     12687    <attribute name="supportedFirmwareTypes" type="FirmwareType" safearray="yes" readonly="yes">
     12688      <desc>
     12689        Returns an array of officially supported values for enum <link to="FirmwareType"/>,
     12690        in the sense of what is e.g. worth offering in the VirtualBox GUI.
     12691      </desc>
     12692    </attribute>
     12693
     12694    <attribute name="supportedGraphicsControllerTypes" type="GraphicsControllerType" safearray="yes" readonly="yes">
     12695      <desc>
     12696        Returns an array of officially supported values for enum <link to="GraphicsControllerType"/>,
     12697        in the sense of what is e.g. worth offering in the VirtualBox GUI.
     12698      </desc>
     12699    </attribute>
     12700
     12701    <attribute name="supportedNetworkAdapterTypes" type="NetworkAdapterType" safearray="yes" readonly="yes">
     12702      <desc>
     12703        Returns an array of officially supported values for enum <link to="NetworkAdapterType"/>,
     12704        in the sense of what is e.g. worth offering in the VirtualBox GUI.
     12705      </desc>
     12706    </attribute>
     12707
     12708    <attribute name="supportedUartTypes" type="UartType" safearray="yes" readonly="yes">
     12709      <desc>
     12710        Returns an array of officially supported values for enum <link to="UartType"/>,
     12711        in the sense of what is e.g. worth offering in the VirtualBox GUI.
     12712      </desc>
     12713    </attribute>
     12714
     12715    <attribute name="supportedUSBControllerTypes" type="USBControllerType" safearray="yes" readonly="yes">
     12716      <desc>
     12717        Returns an array of officially supported values for enum <link to="USBControllerType"/>,
     12718        in the sense of what is e.g. worth offering in the VirtualBox GUI.
     12719      </desc>
     12720    </attribute>
     12721
     12722    <attribute name="supportedAudioControllerTypes" type="AudioControllerType" safearray="yes" readonly="yes">
     12723      <desc>
     12724        Returns an array of officially supported values for enum <link to="AudioControllerType"/>,
     12725        in the sense of what is e.g. worth offering in the VirtualBox GUI.
     12726      </desc>
     12727    </attribute>
     12728
     12729    <attribute name="supportedStorageBuses" type="StorageBus" safearray="yes" readonly="yes">
     12730      <desc>
     12731        Returns an array of officially supported values for enum <link to="StorageBus"/>,
     12732        in the sense of what is e.g. worth offering in the VirtualBox GUI.
     12733      </desc>
     12734    </attribute>
     12735
     12736    <attribute name="supportedStorageControllerTypes" type="StorageControllerType" safearray="yes" readonly="yes">
     12737      <desc>
     12738        Returns an array of officially supported values for enum <link to="StorageControllerType"/>,
     12739        in the sense of what is e.g. worth offering in the VirtualBox GUI.
     12740      </desc>
     12741    </attribute>
     12742
     12743    <attribute name="supportedChipsetTypes" type="ChipsetType" safearray="yes" readonly="yes">
     12744      <desc>
     12745        Returns an array of officially supported values for enum <link to="ChipsetType"/>,
     12746        in the sense of what is e.g. worth offering in the VirtualBox GUI.
     12747      </desc>
     12748    </attribute>
     12749
     12750    <attribute name="supportedIommuTypes" type="IommuType" safearray="yes" readonly="yes">
     12751      <desc>
     12752        Returns an array of officially supported values for enum <link to="IommuType"/>,
     12753        in the sense of what is e.g. worth offering in the VirtualBox GUI.
     12754      </desc>
     12755    </attribute>
     12756
     12757    <attribute name="supportedTpmTypes" type="TpmType" safearray="yes" readonly="yes">
     12758      <desc>
     12759        Returns an array of officially supported values for enum <link to="TpmType"/>,
     12760        in the sense of what is e.g. worth offering in the VirtualBox GUI.
     12761      </desc>
     12762    </attribute>
     12763
     12764    <method name="getMaxNetworkAdapters">
     12765      <desc>
     12766        Maximum total number of network adapters associated with every
     12767        <link to="IMachine"/> instance.
     12768      </desc>
     12769
     12770      <param name="chipset" type="ChipsetType" dir="in">
     12771        <desc>The chipset type to get the value for.</desc>
     12772      </param>
     12773
     12774
     12775      <param name="maxNetworkAdapters" type="unsigned long" dir="return">
     12776        <desc>The maximum total number of network adapters allowed.</desc>
     12777      </param>
     12778
     12779    </method>
     12780
     12781    <method name="getMaxNetworkAdaptersOfType">
     12782      <desc>
     12783        Maximum number of network adapters of a given attachment type,
     12784        associated with every <link to="IMachine"/> instance.
     12785      </desc>
     12786
     12787      <param name="chipset" type="ChipsetType" dir="in">
     12788        <desc>The chipset type to get the value for.</desc>
     12789      </param>
     12790
     12791      <param name="type" type="NetworkAttachmentType" dir="in">
     12792        <desc>Type of attachment.</desc>
     12793      </param>
     12794
     12795      <param name="maxNetworkAdapters" type="unsigned long" dir="return">
     12796        <desc>The maximum number of network adapters allowed for
     12797          particular chipset and attachment type.</desc>
     12798      </param>
     12799
     12800    </method>
     12801
     12802    <method name="getMaxDevicesPerPortForStorageBus">
     12803      <desc>Returns the maximum number of devices which can be attached to a port
     12804      for the given storage bus.</desc>
     12805
     12806      <param name="bus" type="StorageBus" dir="in">
     12807        <desc>The storage bus type to get the value for.</desc>
     12808      </param>
     12809
     12810      <param name="maxDevicesPerPort" type="unsigned long" dir="return">
     12811        <desc>The maximum number of devices which can be attached to the port for the given
     12812        storage bus.</desc>
     12813      </param>
     12814    </method>
     12815
     12816    <method name="getMinPortCountForStorageBus">
     12817      <desc>Returns the minimum number of ports the given storage bus supports.</desc>
     12818
     12819      <param name="bus" type="StorageBus" dir="in">
     12820        <desc>The storage bus type to get the value for.</desc>
     12821      </param>
     12822
     12823      <param name="minPortCount" type="unsigned long" dir="return">
     12824        <desc>The minimum number of ports for the given storage bus.</desc>
     12825      </param>
     12826    </method>
     12827
     12828    <method name="getMaxPortCountForStorageBus">
     12829      <desc>Returns the maximum number of ports the given storage bus supports.</desc>
     12830
     12831      <param name="bus" type="StorageBus" dir="in">
     12832        <desc>The storage bus type to get the value for.</desc>
     12833      </param>
     12834
     12835      <param name="maxPortCount" type="unsigned long" dir="return">
     12836        <desc>The maximum number of ports for the given storage bus.</desc>
     12837      </param>
     12838    </method>
     12839
     12840    <method name="getMaxInstancesOfStorageBus">
     12841      <desc>Returns the maximum number of storage bus instances which
     12842        can be configured for each VM. This corresponds to the number of
     12843        storage controllers one can have. Value may depend on chipset type
     12844        used.</desc>
     12845
     12846      <param name="chipset" type="ChipsetType" dir="in">
     12847        <desc>The chipset type to get the value for.</desc>
     12848      </param>
     12849
     12850      <param name="bus" type="StorageBus" dir="in">
     12851        <desc>The storage bus type to get the value for.</desc>
     12852      </param>
     12853
     12854      <param name="maxInstances" type="unsigned long" dir="return">
     12855        <desc>The maximum number of instances for the given storage bus.</desc>
     12856      </param>
     12857    </method>
     12858
     12859    <method name="getDeviceTypesForStorageBus">
     12860      <desc>Returns list of all the supported device types
     12861        (<link to="DeviceType"/>) for the given type of storage
     12862        bus.</desc>
     12863
     12864      <param name="bus" type="StorageBus" dir="in">
     12865        <desc>The storage bus type to get the value for.</desc>
     12866      </param>
     12867
     12868      <param name="deviceTypes" type="DeviceType" safearray="yes" dir="return">
     12869        <desc>The list of all supported device types for the given storage bus.</desc>
     12870      </param>
     12871    </method>
     12872
     12873    <method name="getStorageBusForStorageControllerType">
     12874      <desc>Returns the <link to="StorageBus"/> enum value
     12875        for a given storage controller type.</desc>
     12876
     12877      <param name="storageControllerType" type="StorageControllerType" dir="in">
     12878        <desc>The storage controller type to get the value for.</desc>
     12879      </param>
     12880
     12881      <param name="storageBus" type="StorageBus" dir="return">
     12882        <desc>The storage bus which is applicable.</desc>
     12883      </param>
     12884    </method>
     12885
     12886    <method name="getStorageControllerTypesForStorageBus">
     12887      <desc>Returns the possible <link to="StorageControllerType"/> enum values
     12888        for a given storage bus.</desc>
     12889
     12890      <param name="storageBus" type="StorageBus" dir="in">
     12891        <desc>The storage bus type to get the values for.</desc>
     12892      </param>
     12893
     12894      <param name="storageControllerType" type="StorageControllerType" safearray="yes" dir="return">
     12895        <desc>The enum values (sorted by what should be a sensible decreasing
     12896        importance of the type) which are valid.</desc>
     12897      </param>
     12898    </method>
     12899
     12900    <method name="getStorageControllerHotplugCapable">
     12901      <desc>Returns whether the given storage controller supports
     12902        hot-plugging devices.</desc>
     12903
     12904      <param name="controllerType" type="StorageControllerType" dir="in">
     12905        <desc>The storage controller to check the setting for.</desc>
     12906      </param>
     12907
     12908      <param name="hotplugCapable" type="boolean" dir="return">
     12909        <desc>Returned flag indicating whether the controller is hotplug capable</desc>
     12910      </param>
     12911    </method>
     12912
     12913    <method name="getMaxInstancesOfUSBControllerType">
     12914      <desc>Returns the maximum number of USB controller instances which
     12915        can be configured for each VM. This corresponds to the number of
     12916        USB controllers one can have. Value may depend on chipset type
     12917        used.</desc>
     12918
     12919      <param name="chipset" type="ChipsetType" dir="in">
     12920        <desc>The chipset type to get the value for.</desc>
     12921      </param>
     12922
     12923      <param name="type" type="USBControllerType" dir="in">
     12924        <desc>The USB controller type to get the value for.</desc>
     12925      </param>
     12926
     12927      <param name="maxInstances" type="unsigned long" dir="return">
     12928        <desc>The maximum number of instances for the given USB controller type.</desc>
     12929      </param>
     12930    </method>
     12931
     12932  </interface>
     12933
    1242412934  <!--
    1242512935  // ISystemProperties
     
    1244312953    name="ISystemProperties"
    1244412954    extends="$unknown"
    12445     uuid="aac6c7cb-a371-4c58-ab51-0616896b2f2c"
     12955    uuid="584dad7d-120f-40fa-91c2-fc520f60fdf2"
    1244612956    wsmap="managed"
    1244712957    rest="managed"
     
    1245712967    </desc>
    1245812968
     12969    <attribute name="platform" type="IPlatformProperties" readonly="yes">
     12970      <desc>Platform properties of the VirtualBox installation.</desc>
     12971    </attribute>
     12972
    1245912973    <attribute name="minGuestRAM" type="unsigned long" readonly="yes">
    1246012974      <desc>Minimum guest system memory in Megabytes.</desc>
     
    1248813002      <desc>Maximum size of a virtual disk image in bytes. Informational value,
    1248913003      does not reflect the limits of any virtual disk image format.</desc>
    12490     </attribute>
    12491 
    12492     <attribute name="serialPortCount" type="unsigned long" readonly="yes">
    12493       <desc>
    12494         Maximum number of serial ports associated with every
    12495         <link to="IMachine"/> instance.
    12496       </desc>
    12497     </attribute>
    12498 
    12499     <attribute name="parallelPortCount" type="unsigned long" readonly="yes">
    12500       <desc>
    12501         Maximum number of parallel ports associated with every
    12502         <link to="IMachine"/> instance.
    12503       </desc>
    12504     </attribute>
    12505 
    12506     <attribute name="maxBootPosition" type="unsigned long" readonly="yes">
    12507       <desc>
    12508         Maximum device position in the boot order. This value corresponds
    12509         to the total number of devices a machine can boot from, to make it
    12510         possible to include all possible devices to the boot list.
    12511         <see><link to="IMachine::setBootOrder"/></see>
    12512       </desc>
    12513     </attribute>
    12514 
    12515     <attribute name="rawModeSupported" type="boolean" readonly="yes">
    12516       <desc>
    12517         Indicates whether VirtualBox was built with raw-mode support.
    12518 
    12519         When this reads as False, the <link to="HWVirtExPropertyType_Enabled"/>
    12520         setting will be ignored and assumed to be True.
    12521       </desc>
    12522     </attribute>
    12523 
    12524     <attribute name="exclusiveHwVirt" type="boolean">
    12525       <desc>
    12526         Exclusive use of hardware virtualization by VirtualBox. When enabled,
    12527         VirtualBox assumes it can obtain full and exclusive access to the VT-x
    12528         or AMD-V feature of the host. To share hardware virtualization with
    12529         other hypervisors, this property must be disabled.
    12530 
    12531         <note>This is ignored on OS X, the kernel mediates hardware
    12532           access there.</note>
    12533       </desc>
    1253413004    </attribute>
    1253513005
     
    1279613266    </attribute>
    1279713267
    12798     <attribute name="supportedParavirtProviders" type="ParavirtProvider" safearray="yes" readonly="yes">
    12799       <desc>
    12800         Returns an array of officially supported values for enum <link to="ParavirtProvider"/>,
    12801         in the sense of what is e.g. worth offering in the VirtualBox GUI.
    12802       </desc>
    12803     </attribute>
    12804 
    1280513268    <attribute name="supportedClipboardModes" type="ClipboardMode" safearray="yes" readonly="yes">
    1280613269      <desc>
     
    1281713280    </attribute>
    1281813281
    12819     <attribute name="supportedFirmwareTypes" type="FirmwareType" safearray="yes" readonly="yes">
    12820       <desc>
    12821         Returns an array of officially supported values for enum <link to="FirmwareType"/>,
    12822         in the sense of what is e.g. worth offering in the VirtualBox GUI.
    12823       </desc>
    12824     </attribute>
    12825 
    1282613282    <attribute name="supportedPointingHIDTypes" type="PointingHIDType" safearray="yes" readonly="yes">
    1282713283      <desc>
     
    1290113357    </attribute>
    1290213358
    12903     <attribute name="supportedGraphicsControllerTypes" type="GraphicsControllerType" safearray="yes" readonly="yes">
    12904       <desc>
    12905         Returns an array of officially supported values for enum <link to="GraphicsControllerType"/>,
    12906         in the sense of what is e.g. worth offering in the VirtualBox GUI.
    12907       </desc>
    12908     </attribute>
    12909 
    1291013359    <attribute name="supportedCloneOptions" type="CloneOptions" safearray="yes" readonly="yes">
    1291113360      <desc>
     
    1293613385    </attribute>
    1293713386
    12938     <attribute name="supportedNetworkAdapterTypes" type="NetworkAdapterType" safearray="yes" readonly="yes">
    12939       <desc>
    12940         Returns an array of officially supported values for enum <link to="NetworkAdapterType"/>,
    12941         in the sense of what is e.g. worth offering in the VirtualBox GUI.
    12942       </desc>
    12943     </attribute>
    12944 
    1294513387    <attribute name="supportedPortModes" type="PortMode" safearray="yes" readonly="yes">
    1294613388      <desc>
     
    1295013392    </attribute>
    1295113393
    12952     <attribute name="supportedUartTypes" type="UartType" safearray="yes" readonly="yes">
    12953       <desc>
    12954         Returns an array of officially supported values for enum <link to="UartType"/>,
    12955         in the sense of what is e.g. worth offering in the VirtualBox GUI.
    12956       </desc>
    12957     </attribute>
    12958 
    12959     <attribute name="supportedUSBControllerTypes" type="USBControllerType" safearray="yes" readonly="yes">
    12960       <desc>
    12961         Returns an array of officially supported values for enum <link to="USBControllerType"/>,
    12962         in the sense of what is e.g. worth offering in the VirtualBox GUI.
    12963       </desc>
    12964     </attribute>
    12965 
    1296613394    <attribute name="supportedAudioDriverTypes" type="AudioDriverType" safearray="yes" readonly="yes">
    1296713395      <desc>
     
    1297113399    </attribute>
    1297213400
    12973     <attribute name="supportedAudioControllerTypes" type="AudioControllerType" safearray="yes" readonly="yes">
    12974       <desc>
    12975         Returns an array of officially supported values for enum <link to="AudioControllerType"/>,
    12976         in the sense of what is e.g. worth offering in the VirtualBox GUI.
    12977       </desc>
    12978     </attribute>
    12979 
    12980     <attribute name="supportedStorageBuses" type="StorageBus" safearray="yes" readonly="yes">
    12981       <desc>
    12982         Returns an array of officially supported values for enum <link to="StorageBus"/>,
    12983         in the sense of what is e.g. worth offering in the VirtualBox GUI.
    12984       </desc>
    12985     </attribute>
    12986 
    12987     <attribute name="supportedStorageControllerTypes" type="StorageControllerType" safearray="yes" readonly="yes">
    12988       <desc>
    12989         Returns an array of officially supported values for enum <link to="StorageControllerType"/>,
    12990         in the sense of what is e.g. worth offering in the VirtualBox GUI.
    12991       </desc>
    12992     </attribute>
    12993 
    12994     <attribute name="supportedChipsetTypes" type="ChipsetType" safearray="yes" readonly="yes">
    12995       <desc>
    12996         Returns an array of officially supported values for enum <link to="ChipsetType"/>,
    12997         in the sense of what is e.g. worth offering in the VirtualBox GUI.
    12998       </desc>
    12999     </attribute>
    13000 
    13001     <attribute name="supportedIommuTypes" type="IommuType" safearray="yes" readonly="yes">
    13002       <desc>
    13003         Returns an array of officially supported values for enum <link to="IommuType"/>,
    13004         in the sense of what is e.g. worth offering in the VirtualBox GUI.
    13005       </desc>
    13006     </attribute>
    13007 
    13008     <attribute name="supportedTpmTypes" type="TpmType" safearray="yes" readonly="yes">
    13009       <desc>
    13010         Returns an array of officially supported values for enum <link to="TpmType"/>,
    13011         in the sense of what is e.g. worth offering in the VirtualBox GUI.
    13012       </desc>
    13013     </attribute>
    13014 
    1301513401    <attribute name="languageId" type="wstring">
    1301613402      <desc>
     
    1301813404      </desc>
    1301913405    </attribute>
    13020 
    13021     <method name="getMaxNetworkAdapters">
    13022       <desc>
    13023         Maximum total number of network adapters associated with every
    13024         <link to="IMachine"/> instance.
    13025       </desc>
    13026 
    13027       <param name="chipset" type="ChipsetType" dir="in">
    13028         <desc>The chipset type to get the value for.</desc>
    13029       </param>
    13030 
    13031 
    13032       <param name="maxNetworkAdapters" type="unsigned long" dir="return">
    13033         <desc>The maximum total number of network adapters allowed.</desc>
    13034       </param>
    13035 
    13036     </method>
    13037 
    13038     <method name="getMaxNetworkAdaptersOfType">
    13039       <desc>
    13040         Maximum number of network adapters of a given attachment type,
    13041         associated with every <link to="IMachine"/> instance.
    13042       </desc>
    13043 
    13044       <param name="chipset" type="ChipsetType" dir="in">
    13045         <desc>The chipset type to get the value for.</desc>
    13046       </param>
    13047 
    13048       <param name="type" type="NetworkAttachmentType" dir="in">
    13049         <desc>Type of attachment.</desc>
    13050       </param>
    13051 
    13052       <param name="maxNetworkAdapters" type="unsigned long" dir="return">
    13053         <desc>The maximum number of network adapters allowed for
    13054           particular chipset and attachment type.</desc>
    13055       </param>
    13056 
    13057     </method>
    13058 
    13059 
    13060     <method name="getMaxDevicesPerPortForStorageBus">
    13061       <desc>Returns the maximum number of devices which can be attached to a port
    13062       for the given storage bus.</desc>
    13063 
    13064       <param name="bus" type="StorageBus" dir="in">
    13065         <desc>The storage bus type to get the value for.</desc>
    13066       </param>
    13067 
    13068       <param name="maxDevicesPerPort" type="unsigned long" dir="return">
    13069         <desc>The maximum number of devices which can be attached to the port for the given
    13070         storage bus.</desc>
    13071       </param>
    13072     </method>
    13073 
    13074     <method name="getMinPortCountForStorageBus">
    13075       <desc>Returns the minimum number of ports the given storage bus supports.</desc>
    13076 
    13077       <param name="bus" type="StorageBus" dir="in">
    13078         <desc>The storage bus type to get the value for.</desc>
    13079       </param>
    13080 
    13081       <param name="minPortCount" type="unsigned long" dir="return">
    13082         <desc>The minimum number of ports for the given storage bus.</desc>
    13083       </param>
    13084     </method>
    13085 
    13086     <method name="getMaxPortCountForStorageBus">
    13087       <desc>Returns the maximum number of ports the given storage bus supports.</desc>
    13088 
    13089       <param name="bus" type="StorageBus" dir="in">
    13090         <desc>The storage bus type to get the value for.</desc>
    13091       </param>
    13092 
    13093       <param name="maxPortCount" type="unsigned long" dir="return">
    13094         <desc>The maximum number of ports for the given storage bus.</desc>
    13095       </param>
    13096     </method>
    13097 
    13098     <method name="getMaxInstancesOfStorageBus">
    13099       <desc>Returns the maximum number of storage bus instances which
    13100         can be configured for each VM. This corresponds to the number of
    13101         storage controllers one can have. Value may depend on chipset type
    13102         used.</desc>
    13103 
    13104       <param name="chipset" type="ChipsetType" dir="in">
    13105         <desc>The chipset type to get the value for.</desc>
    13106       </param>
    13107 
    13108       <param name="bus" type="StorageBus" dir="in">
    13109         <desc>The storage bus type to get the value for.</desc>
    13110       </param>
    13111 
    13112       <param name="maxInstances" type="unsigned long" dir="return">
    13113         <desc>The maximum number of instances for the given storage bus.</desc>
    13114       </param>
    13115     </method>
    13116 
    13117     <method name="getDeviceTypesForStorageBus">
    13118       <desc>Returns list of all the supported device types
    13119         (<link to="DeviceType"/>) for the given type of storage
    13120         bus.</desc>
    13121 
    13122       <param name="bus" type="StorageBus" dir="in">
    13123         <desc>The storage bus type to get the value for.</desc>
    13124       </param>
    13125 
    13126       <param name="deviceTypes" type="DeviceType" safearray="yes" dir="return">
    13127         <desc>The list of all supported device types for the given storage bus.</desc>
    13128       </param>
    13129     </method>
    13130 
    13131     <method name="getStorageBusForStorageControllerType">
    13132       <desc>Returns the <link to="StorageBus"/> enum value
    13133         for a given storage controller type.</desc>
    13134 
    13135       <param name="storageControllerType" type="StorageControllerType" dir="in">
    13136         <desc>The storage controller type to get the value for.</desc>
    13137       </param>
    13138 
    13139       <param name="storageBus" type="StorageBus" dir="return">
    13140         <desc>The storage bus which is applicable.</desc>
    13141       </param>
    13142     </method>
    13143 
    13144     <method name="getStorageControllerTypesForStorageBus">
    13145       <desc>Returns the possible <link to="StorageControllerType"/> enum values
    13146         for a given storage bus.</desc>
    13147 
    13148       <param name="storageBus" type="StorageBus" dir="in">
    13149         <desc>The storage bus type to get the values for.</desc>
    13150       </param>
    13151 
    13152       <param name="storageControllerType" type="StorageControllerType" safearray="yes" dir="return">
    13153         <desc>The enum values (sorted by what should be a sensible decreasing
    13154         importance of the type) which are valid.</desc>
    13155       </param>
    13156     </method>
    1315713406
    1315813407    <method name="getDefaultIoCacheSettingForStorageController" dtracename="getDefaultStorageCtrlCacheSetting">
     
    1316613415      <param name="enabled" type="boolean" dir="return">
    1316713416        <desc>Returned flag indicating the default value</desc>
    13168       </param>
    13169     </method>
    13170 
    13171     <method name="getStorageControllerHotplugCapable">
    13172       <desc>Returns whether the given storage controller supports
    13173         hot-plugging devices.</desc>
    13174 
    13175       <param name="controllerType" type="StorageControllerType" dir="in">
    13176         <desc>The storage controller to check the setting for.</desc>
    13177       </param>
    13178 
    13179       <param name="hotplugCapable" type="boolean" dir="return">
    13180         <desc>Returned flag indicating whether the controller is hotplug capable</desc>
    13181       </param>
    13182     </method>
    13183 
    13184     <method name="getMaxInstancesOfUSBControllerType">
    13185       <desc>Returns the maximum number of USB controller instances which
    13186         can be configured for each VM. This corresponds to the number of
    13187         USB controllers one can have. Value may depend on chipset type
    13188         used.</desc>
    13189 
    13190       <param name="chipset" type="ChipsetType" dir="in">
    13191         <desc>The chipset type to get the value for.</desc>
    13192       </param>
    13193 
    13194       <param name="type" type="USBControllerType" dir="in">
    13195         <desc>The USB controller type to get the value for.</desc>
    13196       </param>
    13197 
    13198       <param name="maxInstances" type="unsigned long" dir="return">
    13199         <desc>The maximum number of instances for the given USB controller type.</desc>
    1320013417      </param>
    1320113418    </method>
     
    1323013447    >
    1323113448    <desc>
     13449      Specifies a guest OS type and its recommendations.
    1323213450    </desc>
    1323313451
     
    1325313471
    1325413472    <attribute name="recommendedIOAPIC" type="boolean" readonly="yes">
    13255       <desc>Returns @c true if I/O-APIC recommended for this OS type.</desc>
     13473      <desc>Returns @c true if I/O-APIC recommended for this OS type. Only applies to x86-based platforms.</desc>
    1325613474    </attribute>
    1325713475
    1325813476    <attribute name="recommendedVirtEx" type="boolean" readonly="yes">
    13259       <desc>Returns @c true if VT-x or AMD-V recommended for this OS type.</desc>
     13477      <desc>Returns @c true if VT-x or AMD-V recommended for this OS type. Only applies to x86-based platforms.</desc>
    1326013478    </attribute>
    1326113479
     
    1328913507
    1329013508    <attribute name="recommendedPAE" type="boolean" readonly="yes">
    13291       <desc>Returns @c true if using PAE is recommended for this OS type.</desc>
     13509      <desc>Returns @c true if using PAE is recommended for this OS type. Only applies to x86-based platforms.</desc>
    1329213510    </attribute>
    1329313511
     
    1331713535
    1331813536    <attribute name="recommendedHPET" type="boolean" readonly="yes">
    13319       <desc>Returns @c true if using HPET is recommended for this OS type.</desc>
     13537      <desc>Returns @c true if using HPET is recommended for this OS type. Only applies to x86-based platforms.</desc>
    1332013538    </attribute>
    1332113539
     
    1332513543
    1332613544    <attribute name="recommendedRTCUseUTC" type="boolean" readonly="yes">
    13327       <desc>Returns @c true if the RTC of this VM should be set to UTC</desc>
     13545      <desc>Returns @c true if the RTC of this VM should be set to UTC.</desc>
    1332813546    </attribute>
    1332913547
     
    1335613574    </attribute>
    1335713575
     13576    <!-- @todo r=bird: Rename this to some more generic term that can be applied to ARM? -->
    1335813577    <attribute name="recommendedTFReset" type="boolean" readonly="yes">
    1335913578      <desc>Returns @c true if using VCPU reset on triple fault is recommended for this OS type.</desc>
     
    1336113580
    1336213581    <attribute name="recommendedX2APIC" type="boolean" readonly="yes">
    13363       <desc>Returns @c true if X2APIC is recommended for this OS type.</desc>
     13582      <desc>Returns @c true if X2APIC is recommended for this OS type. Only applies to x86-based platforms.</desc>
    1336413583    </attribute>
    1336513584
     
    2204822267    </attribute>
    2204922268
    22050     <attribute name="IOBase" type="unsigned long">
    22051       <desc>Base I/O address of the serial port.</desc>
     22269    <attribute name="IOAddress" type="unsigned long">
     22270      <desc>Base I/O address of the serial port. For x86, this is an I/O port, for ARM this is an MMIO address.</desc>
    2205222271    </attribute>
    2205322272
     
    2213622355
    2213722356    <attribute name="IOBase" type="unsigned long">
    22138       <desc>Base I/O address of the parallel port.</desc>
     22357      <desc>Base I/O address of the parallel port. Only for X86-based platforms.</desc>
    2213922358    </attribute>
    2214022359
    2214122360    <attribute name="IRQ" type="unsigned long">
    22142       <desc>IRQ number of the parallel port.</desc>
     22361      <desc>IRQ number of the parallel port. Only for X86-based platforms.</desc>
    2214322362    </attribute>
    2214422363
     
    2217322392    </const>
    2217422393    <const name="HwVirt"            value="2">
    22175       <desc>Hardware assisted virtualization thru HM.</desc>
     22394      <desc>Hardware assisted virtualization thru HM. Only for x86-based hosts.</desc>
    2217622395    </const>
    2217722396    <const name="NativeApi"         value="3">
     
    2349723716  <enum
    2349823717    name="AudioControllerType"
    23499     uuid="7afd395c-42c3-444e-8788-3ce80292f36c"
     23718    uuid="6389dcc9-4e60-4983-9418-299e602efafc"
    2350023719    >
    2350123720    <desc>
     
    2350323722    </desc>
    2350423723
    23505     <const name="AC97"  value="0"/>
    23506     <const name="SB16"  value="1"/>
    23507     <const name="HDA"   value="2"/>
     23724    <const name="AC97"        value="0"/>
     23725    <const name="SB16"        value="1"/>
     23726    <const name="HDA"         value="2"/>
     23727    <const name="VirtioSound" value="3"/>
    2350823728  </enum>
    2350923729
     
    2500525225  <enum
    2500625226    name="ChipsetType"
    25007     uuid="8b4096a8-a7c3-4d3b-bbb1-05a0a51ec394"
    25008     >
    25009     <desc>
    25010       Type of emulated chipset (mostly southbridge).
     25227    uuid="733d5f16-1f47-4e25-b272-d7c138bc2e3d"
     25228    >
     25229    <desc>
     25230      Type of emulated chipset (think x86 southbridge or ARM SoC/board).
    2501125231    </desc>
    2501225232
     
    2501525235    </const>
    2501625236    <const name="PIIX3" value="1">
    25017       <desc>A PIIX3 (PCI IDE ISA Xcelerator) chipset.</desc>
     25237      <desc>x86: A PIIX3 (PCI IDE ISA Xcelerator) chipset.</desc>
    2501825238    </const>
    2501925239    <const name="ICH9"  value="2">
    25020       <desc>A ICH9 (I/O Controller Hub) chipset.</desc>
     25240      <desc>x86: A ICH9 (I/O Controller Hub) chipset.</desc>
     25241    </const>
     25242    <const name="ARMv8Virtual" value="3">
     25243      <desc>ARM: Virtual ARMv8 base platform (board).</desc>
    2502125244    </const>
    2502225245  </enum>
  • trunk/src/VBox/Main/include/ConsoleImpl.h

    r100609 r101035  
    739739                                   const ComPtr<IMachine> &ptrMachine,
    740740                                   const ComPtr<IGraphicsAdapter> &ptrGraphicsAdapter,
    741                                    const ComPtr<IBIOSSettings> &ptrBiosSettings,
     741                                   const ComPtr<IFirmwareSettings> &ptrFirmwareSettings,
    742742                                   bool fHMEnabled);
    743743    int i_checkMediumLocation(IMedium *pMedium, bool *pfUseHostIOCache);
  • trunk/src/VBox/Main/include/Global.h

    r98103 r101035  
    124124
    125125    /**
    126      * Get the network adapter limit for each chipset type.
    127      */
    128     static uint32_t getMaxNetworkAdapters(ChipsetType_T aChipsetType);
    129 
    130     /**
    131126     * Returns @c true if the given machine state is an online state. This is a
    132127     * recommended way to detect if the VM is online (being executed in a
  • trunk/src/VBox/Main/include/HostImpl.h

    r98103 r101035  
    109109
    110110    // wrapped IHost properties
     111    HRESULT getArchitecture(PlatformArchitecture_T *platformArchitecture);
    111112    HRESULT getDVDDrives(std::vector<ComPtr<IMedium> > &aDVDDrives);
    112113    HRESULT getFloppyDrives(std::vector<ComPtr<IMedium> > &aFloppyDrives);
     
    137138    HRESULT getUpdateURL(com::Utf8Str &aUpdateURL);
    138139    HRESULT getUpdateCheckNeeded(BOOL *aUpdateCheckNeeded);
     140    HRESULT getX86(ComPtr<IHostX86> &aHostX86);
    139141
    140142    // wrapped IHost methods
     
    145147    HRESULT getProcessorDescription(ULONG aCpuId,
    146148                                    com::Utf8Str &aDescription);
    147     HRESULT getProcessorCPUIDLeaf(ULONG aCpuId,
    148                                   ULONG aLeaf,
    149                                   ULONG aSubLeaf,
    150                                   ULONG *aValEax,
    151                                   ULONG *aValEbx,
    152                                   ULONG *aValEcx,
    153                                   ULONG *aValEdx);
    154149    HRESULT createHostOnlyNetworkInterface(ComPtr<IHostNetworkInterface> &aHostInterface,
    155150                                           ComPtr<IProgress> &aProgress);
  • trunk/src/VBox/Main/include/MachineImpl.h

    r98288 r101035  
    4343#include "SerialPortImpl.h"
    4444#include "ParallelPortImpl.h"
    45 #include "BIOSSettingsImpl.h"
     45#include "FirmwareSettingsImpl.h"
    4646#include "RecordingSettingsImpl.h"
    4747#include "GraphicsAdapterImpl.h"
     
    5757# include "PerformanceImpl.h"
    5858#endif
     59#include "PlatformImpl.h"
     60#include "PlatformPropertiesImpl.h"
    5961#include "ThreadTask.h"
    6062
     
    304306        BOOL                mPageFusionEnabled;
    305307        settings::RecordingSettings mRecordSettings;
    306         BOOL                mHWVirtExEnabled;
    307         BOOL                mHWVirtExNestedPagingEnabled;
    308         BOOL                mHWVirtExLargePagesEnabled;
    309         BOOL                mHWVirtExVPIDEnabled;
    310         BOOL                mHWVirtExUXEnabled;
    311         BOOL                mHWVirtExForceEnabled;
    312         BOOL                mHWVirtExUseNativeApi;
    313         BOOL                mHWVirtExVirtVmsaveVmload;
    314         BOOL                mPAEEnabled;
    315         settings::Hardware::LongModeType mLongMode;
    316         BOOL                mTripleFaultReset;
    317         BOOL                mAPIC;
    318         BOOL                mX2APIC;
    319         BOOL                mIBPBOnVMExit;
    320         BOOL                mIBPBOnVMEntry;
    321         BOOL                mSpecCtrl;
    322         BOOL                mSpecCtrlByHost;
    323         BOOL                mL1DFlushOnSched;
    324         BOOL                mL1DFlushOnVMEntry;
    325         BOOL                mMDSClearOnSched;
    326         BOOL                mMDSClearOnVMEntry;
    327         BOOL                mNestedHWVirt;
    328308        ULONG               mCPUCount;
    329309        BOOL                mCPUHotPlugEnabled;
     
    331311        uint32_t            mCpuIdPortabilityLevel;
    332312        Utf8Str             mCpuProfile;
    333         BOOL                mHPETEnabled;
    334313
    335314        BOOL                mCPUAttached[SchemaDefs::MaxCPUCount];
    336 
    337         std::list<settings::CpuIdLeaf> mCpuIdLeafList;
    338315
    339316        DeviceType_T        mBootOrder[SchemaDefs::MaxBootPosition];
     
    350327        GuestPropertyMap    mGuestProperties;
    351328
    352         FirmwareType_T      mFirmwareType;
    353329        KeyboardHIDType_T   mKeyboardHIDType;
    354330        PointingHIDType_T   mPointingHIDType;
    355         ChipsetType_T       mChipsetType;
    356         IommuType_T         mIommuType;
    357331        ParavirtProvider_T  mParavirtProvider;
    358332        Utf8Str             mParavirtDebug;
     
    384358                 const Utf8Str &strConfigFile,
    385359                 const Utf8Str &strName,
     360                 PlatformArchitecture_T aArchitecture,
    386361                 const StringsList &llGroups,
    387362                 const Utf8Str &strOsTypeId,
     
    463438
    464439    /**
     440     * Returns the machine's platform object.
     441     *
     442     * @returns Platform object.
     443     */
     444    Platform *i_getPlatform() const { return mPlatform; }
     445
     446    /**
     447     * Returns the machine's platform properties object.
     448     *
     449     * @returns Platform properties object.
     450     */
     451    PlatformProperties *i_getPlatformProperties() const { return mPlatformProperties; }
     452
     453    /**
    465454     * Checks if this machine is accessible, without attempting to load the
    466455     * config file.
     
    519508        IsModified_AudioSettings         = 0x000080,
    520509        IsModified_USB                   = 0x000100,
    521         IsModified_BIOS                  = 0x000200,
     510        IsModified_Firmware              = 0x000200,
    522511        IsModified_SharedFolders         = 0x000400,
    523512        IsModified_Snapshots             = 0x000800,
     
    528517        IsModified_NvramStore            = 0x010000,
    529518        IsModified_GuestDebugControl     = 0x020000,
     519        IsModified_Platform              = 0x040000,
    530520    };
    531521
     
    538528     */
    539529    Utf8Str i_getOSTypeId() const { return mUserData->s.strOsType; }
    540     ChipsetType_T i_getChipsetType() const { return mHWData->mChipsetType; }
    541     FirmwareType_T i_getFirmwareType() const { return mHWData->mFirmwareType; }
     530    FirmwareType_T i_getFirmwareType() const;
    542531    ParavirtProvider_T i_getParavirtProvider() const { return mHWData->mParavirtProvider; }
    543532    Utf8Str i_getParavirtDebug() const { return mHWData->mParavirtDebug; }
     
    591580    Utf8Str i_getDefaultNVRAMFilename();
    592581    Utf8Str i_getSnapshotNVRAMFilename();
     582    NvramStore *i_getNVRAMStore() const { return mNvramStore; };
    593583    SettingsVersion_T i_getSettingsVersion(void);
    594584
     
    809799#endif /* VBOX_WITH_RESOURCE_USAGE_API */
    810800
     801    void i_platformPropertiesUpdate();
     802
    811803    Machine * const         mPeer;
    812804
     
    818810    Backupable<UserData>    mUserData;
    819811    Backupable<HWData>      mHWData;
     812
     813    // const objectsf not requiring locking
     814    /** The machine's platform properties.
     815     *  We keep a (const) object around for performance reasons. */
     816    const ComObjPtr<PlatformProperties> mPlatformProperties;
    820817
    821818    /**
     
    840837    const ComObjPtr<AudioSettings>     mAudioSettings;
    841838    const ComObjPtr<USBDeviceFilters>  mUSBDeviceFilters;
    842     const ComObjPtr<BIOSSettings>      mBIOSSettings;
     839    const ComObjPtr<Platform>          mPlatform;
     840    const ComObjPtr<FirmwareSettings>  mFirmwareSettings;
    843841    const ComObjPtr<RecordingSettings> mRecordingSettings;
    844842    const ComObjPtr<GraphicsAdapter>   mGraphicsAdapter;
     
    907905
    908906    friend class Appliance;
     907    friend class Platform;
     908    friend class PlatformX86;
    909909    friend class RecordingSettings;
    910910    friend class RecordingScreenSettings;
     
    918918    // wrapped IMachine properties
    919919    HRESULT getParent(ComPtr<IVirtualBox> &aParent);
     920    HRESULT getPlatform(ComPtr<IPlatform> &aPlatform);
    920921    HRESULT getIcon(std::vector<BYTE> &aIcon);
    921922    HRESULT setIcon(const std::vector<BYTE> &aIcon);
     
    952953    HRESULT setPageFusionEnabled(BOOL aPageFusionEnabled);
    953954    HRESULT getGraphicsAdapter(ComPtr<IGraphicsAdapter> &aGraphicsAdapter);
    954     HRESULT getBIOSSettings(ComPtr<IBIOSSettings> &aBIOSSettings);
     955    HRESULT getFirmwareSettings(ComPtr<IFirmwareSettings> &aFirmwareSettings);
    955956    HRESULT getTrustedPlatformModule(ComPtr<ITrustedPlatformModule> &aTrustedPlatformModule);
    956957    HRESULT getNonVolatileStore(ComPtr<INvramStore> &aNvramStore);
    957958    HRESULT getRecordingSettings(ComPtr<IRecordingSettings> &aRecordingSettings);
    958     HRESULT getFirmwareType(FirmwareType_T *aFirmwareType);
    959     HRESULT setFirmwareType(FirmwareType_T aFirmwareType);
    960959    HRESULT getPointingHIDType(PointingHIDType_T *aPointingHIDType);
    961960    HRESULT setPointingHIDType(PointingHIDType_T aPointingHIDType);
    962961    HRESULT getKeyboardHIDType(KeyboardHIDType_T *aKeyboardHIDType);
    963962    HRESULT setKeyboardHIDType(KeyboardHIDType_T aKeyboardHIDType);
    964     HRESULT getHPETEnabled(BOOL *aHPETEnabled);
    965     HRESULT setHPETEnabled(BOOL aHPETEnabled);
    966     HRESULT getChipsetType(ChipsetType_T *aChipsetType);
    967     HRESULT setChipsetType(ChipsetType_T aChipsetType);
    968     HRESULT getIommuType(IommuType_T *aIommuType);
    969     HRESULT setIommuType(IommuType_T aIommuType);
    970963    HRESULT getSnapshotFolder(com::Utf8Str &aSnapshotFolder);
    971964    HRESULT setSnapshotFolder(const com::Utf8Str &aSnapshotFolder);
     
    10111004    HRESULT getParavirtDebug(com::Utf8Str &aParavirtDebug);
    10121005    HRESULT setParavirtDebug(const com::Utf8Str &aParavirtDebug);
    1013     HRESULT getRTCUseUTC(BOOL *aRTCUseUTC);
    1014     HRESULT setRTCUseUTC(BOOL aRTCUseUTC);
    10151006    HRESULT getIOCacheEnabled(BOOL *aIOCacheEnabled);
    10161007    HRESULT setIOCacheEnabled(BOOL aIOCacheEnabled);
     
    11451136    HRESULT setExtraData(const com::Utf8Str &aKey,
    11461137                         const com::Utf8Str &aValue);
    1147     HRESULT getCPUProperty(CPUPropertyType_T aProperty,
    1148                            BOOL *aValue);
    1149     HRESULT setCPUProperty(CPUPropertyType_T aProperty,
    1150                            BOOL aValue);
    1151     HRESULT getCPUIDLeafByOrdinal(ULONG aOrdinal,
    1152                                   ULONG *aIdx,
    1153                                   ULONG *aSubIdx,
    1154                                   ULONG *aValEax,
    1155                                   ULONG *aValEbx,
    1156                                   ULONG *aValEcx,
    1157                                   ULONG *aValEdx);
    1158     HRESULT getCPUIDLeaf(ULONG aIdx, ULONG aSubIdx,
    1159                          ULONG *aValEax,
    1160                          ULONG *aValEbx,
    1161                          ULONG *aValEcx,
    1162                          ULONG *aValEdx);
    1163     HRESULT setCPUIDLeaf(ULONG aIdx, ULONG aSubIdx,
    1164                          ULONG aValEax,
    1165                          ULONG aValEbx,
    1166                          ULONG aValEcx,
    1167                          ULONG aValEdx);
    1168     HRESULT removeCPUIDLeaf(ULONG aIdx, ULONG aSubIdx);
    1169     HRESULT removeAllCPUIDLeaves();
    1170     HRESULT getHWVirtExProperty(HWVirtExPropertyType_T aProperty,
    1171                                 BOOL *aValue);
    1172     HRESULT setHWVirtExProperty(HWVirtExPropertyType_T aProperty,
    1173                                 BOOL aValue);
    11741138    HRESULT setSettingsFilePath(const com::Utf8Str &aSettingsFilePath,
    11751139                                ComPtr<IProgress> &aProgress);
  • trunk/src/VBox/Main/include/SerialPortImpl.h

    r98103 r101035  
    8686    HRESULT getIRQ(ULONG *aIRQ);
    8787    HRESULT setIRQ(ULONG aIRQ);
    88     HRESULT getIOBase(ULONG *aIOBase);
    89     HRESULT setIOBase(ULONG aIOBase);
     88    HRESULT getIOAddress(ULONG *aIOAddress);
     89    HRESULT setIOAddress(ULONG aIOAddress);
    9090    HRESULT getServer(BOOL *aServer);
    9191    HRESULT setServer(BOOL aServer);
  • trunk/src/VBox/Main/include/SystemPropertiesImpl.h

    r98103 r101035  
    3838
    3939class CPUProfile;
     40class PlatformProperties;
    4041
    4142namespace settings
     
    8485    HRESULT getMaxGuestMonitors(ULONG *aMaxGuestMonitors) RT_OVERRIDE;
    8586    HRESULT getInfoVDSize(LONG64 *aInfoVDSize) RT_OVERRIDE;
    86     HRESULT getSerialPortCount(ULONG *aSerialPortCount) RT_OVERRIDE;
    87     HRESULT getParallelPortCount(ULONG *aParallelPortCount) RT_OVERRIDE;
    88     HRESULT getMaxBootPosition(ULONG *aMaxBootPosition) RT_OVERRIDE;
    89     HRESULT getRawModeSupported(BOOL *aRawModeSupported) RT_OVERRIDE;
    90     HRESULT getExclusiveHwVirt(BOOL *aExclusiveHwVirt) RT_OVERRIDE;
    91     HRESULT setExclusiveHwVirt(BOOL aExclusiveHwVirt) RT_OVERRIDE;
    9287    HRESULT getDefaultMachineFolder(com::Utf8Str &aDefaultMachineFolder) RT_OVERRIDE;
    9388    HRESULT setDefaultMachineFolder(const com::Utf8Str &aDefaultMachineFolder) RT_OVERRIDE;
     
    123118    HRESULT setDefaultFrontend(const com::Utf8Str &aDefaultFrontend) RT_OVERRIDE;
    124119    HRESULT getScreenShotFormats(std::vector<BitmapFormat_T> &aScreenShotFormats) RT_OVERRIDE;
     120    HRESULT getPlatform(ComPtr<IPlatformProperties> &aPlatformProperties) RT_OVERRIDE;
    125121    HRESULT getProxyMode(ProxyMode_T *pProxyMode) RT_OVERRIDE;
    126122    HRESULT setProxyMode(ProxyMode_T aProxyMode) RT_OVERRIDE;
    127123    HRESULT getProxyURL(com::Utf8Str &aProxyURL) RT_OVERRIDE;
    128124    HRESULT setProxyURL(const com::Utf8Str &aProxyURL) RT_OVERRIDE;
    129     HRESULT getSupportedParavirtProviders(std::vector<ParavirtProvider_T> &aSupportedParavirtProviders) RT_OVERRIDE;
    130125    HRESULT getSupportedClipboardModes(std::vector<ClipboardMode_T> &aSupportedClipboardModes) RT_OVERRIDE;
    131126    HRESULT getSupportedDnDModes(std::vector<DnDMode_T> &aSupportedDnDModes) RT_OVERRIDE;
    132     HRESULT getSupportedFirmwareTypes(std::vector<FirmwareType_T> &aSupportedFirmwareTypes) RT_OVERRIDE;
    133127    HRESULT getSupportedPointingHIDTypes(std::vector<PointingHIDType_T> &aSupportedPointingHIDTypes) RT_OVERRIDE;
    134128    HRESULT getSupportedKeyboardHIDTypes(std::vector<KeyboardHIDType_T> &aSupportedKeyboardHIDTypes) RT_OVERRIDE;
     
    142136    HRESULT getSupportedRecordingARCModes(std::vector<RecordingRateControlMode_T> &aSupportedRecordingAudioRateControlModes) RT_OVERRIDE;
    143137    HRESULT getSupportedRecordingVRCModes(std::vector<RecordingRateControlMode_T> &aSupportedRecordingVideoRateControlModes) RT_OVERRIDE;
    144     HRESULT getSupportedGraphicsControllerTypes(std::vector<GraphicsControllerType_T> &aSupportedGraphicsControllerTypes) RT_OVERRIDE;
    145138    HRESULT getSupportedCloneOptions(std::vector<CloneOptions_T> &aSupportedCloneOptions) RT_OVERRIDE;
    146139    HRESULT getSupportedAutostopTypes(std::vector<AutostopType_T> &aSupportedAutostopTypes) RT_OVERRIDE;
    147140    HRESULT getSupportedVMProcPriorities(std::vector<VMProcPriority_T> &aSupportedVMProcPriorities) RT_OVERRIDE;
    148141    HRESULT getSupportedNetworkAttachmentTypes(std::vector<NetworkAttachmentType_T> &aSupportedNetworkAttachmentTypes) RT_OVERRIDE;
    149     HRESULT getSupportedNetworkAdapterTypes(std::vector<NetworkAdapterType_T> &aSupportedNetworkAdapterTypes) RT_OVERRIDE;
    150142    HRESULT getSupportedPortModes(std::vector<PortMode_T> &aSupportedPortModes) RT_OVERRIDE;
    151     HRESULT getSupportedUartTypes(std::vector<UartType_T> &aSupportedUartTypes) RT_OVERRIDE;
    152     HRESULT getSupportedUSBControllerTypes(std::vector<USBControllerType_T> &aSupportedUSBControllerTypes) RT_OVERRIDE;
    153143    HRESULT getSupportedAudioDriverTypes(std::vector<AudioDriverType_T> &aSupportedAudioDriverTypes) RT_OVERRIDE;
    154     HRESULT getSupportedAudioControllerTypes(std::vector<AudioControllerType_T> &aSupportedAudioControllerTypes) RT_OVERRIDE;
    155     HRESULT getSupportedStorageBuses(std::vector<StorageBus_T> &aSupportedStorageBuses) RT_OVERRIDE;
    156     HRESULT getSupportedStorageControllerTypes(std::vector<StorageControllerType_T> &aSupportedStorageControllerTypes) RT_OVERRIDE;
    157     HRESULT getSupportedChipsetTypes(std::vector<ChipsetType_T> &aSupportedChipsetTypes) RT_OVERRIDE;
    158     HRESULT getSupportedIommuTypes(std::vector<IommuType_T> &aSupportedIommuTypes) RT_OVERRIDE;
    159     HRESULT getSupportedTpmTypes(std::vector<TpmType_T> &aSupportedTpmTypes) RT_OVERRIDE;
    160144    HRESULT getLanguageId(com::Utf8Str &aLanguageId) RT_OVERRIDE;
    161145    HRESULT setLanguageId(const com::Utf8Str &aLanguageId) RT_OVERRIDE;
    162146
    163147    // wrapped ISystemProperties methods
    164     HRESULT getMaxNetworkAdapters(ChipsetType_T aChipset,
    165                                   ULONG *aMaxNetworkAdapters) RT_OVERRIDE;
    166     HRESULT getMaxNetworkAdaptersOfType(ChipsetType_T aChipset,
    167                                         NetworkAttachmentType_T aType,
    168                                         ULONG *aMaxNetworkAdapters) RT_OVERRIDE;
    169     HRESULT getMaxDevicesPerPortForStorageBus(StorageBus_T aBus,
    170                                               ULONG *aMaxDevicesPerPort) RT_OVERRIDE;
    171     HRESULT getMinPortCountForStorageBus(StorageBus_T aBus,
    172                                          ULONG *aMinPortCount) RT_OVERRIDE;
    173     HRESULT getMaxPortCountForStorageBus(StorageBus_T aBus,
    174                                          ULONG *aMaxPortCount) RT_OVERRIDE;
    175     HRESULT getMaxInstancesOfStorageBus(ChipsetType_T aChipset,
    176                                         StorageBus_T aBus,
    177                                         ULONG *aMaxInstances) RT_OVERRIDE;
    178     HRESULT getDeviceTypesForStorageBus(StorageBus_T aBus,
    179                                         std::vector<DeviceType_T> &aDeviceTypes) RT_OVERRIDE;
    180     HRESULT getStorageBusForStorageControllerType(StorageControllerType_T aStorageControllerType,
    181                                                   StorageBus_T *aStorageBus) RT_OVERRIDE;
    182     HRESULT getStorageControllerTypesForStorageBus(StorageBus_T aStorageBus,
    183                                                    std::vector<StorageControllerType_T> &aStorageControllerTypes) RT_OVERRIDE;
    184148    HRESULT getDefaultIoCacheSettingForStorageController(StorageControllerType_T aControllerType,
    185149                                                         BOOL *aEnabled) RT_OVERRIDE;
    186     HRESULT getStorageControllerHotplugCapable(StorageControllerType_T aControllerType,
    187                                                BOOL *aHotplugCapable) RT_OVERRIDE;
    188     HRESULT getMaxInstancesOfUSBControllerType(ChipsetType_T aChipset,
    189                                                USBControllerType_T aType,
    190                                                ULONG *aMaxInstances) RT_OVERRIDE;
    191150    HRESULT getCPUProfiles(CPUArchitecture_T aArchitecture, const com::Utf8Str &aNamePattern,
    192151                           std::vector<ComPtr<ICPUProfile> > &aProfiles) RT_OVERRIDE;
     
    211170    MediumFormatList m_llMediumFormats;
    212171
    213     bool                m_fLoadedX86CPUProfiles;    /**< Set if we've loaded the x86 and AMD64 CPU profiles. */
    214     CPUProfileList_T    m_llCPUProfiles;            /**< List of loaded CPU profiles. */
     172    ComObjPtr<PlatformProperties> const m_platformProperties;       /**< The host's platform properties. */
     173    bool                                m_fLoadedX86CPUProfiles;    /**< Set if we've loaded the x86 and AMD64 CPU profiles. */
     174    CPUProfileList_T                    m_llCPUProfiles;            /**< List of loaded CPU profiles. */
    215175
    216176    friend class VirtualBox;
  • trunk/src/VBox/Main/include/VirtualBoxImpl.h

    r100737 r101035  
    338338    HRESULT getSettingsFilePath(com::Utf8Str &aSettingsFilePath);
    339339    HRESULT getHost(ComPtr<IHost> &aHost);
     340    HRESULT getPlatformProperties(PlatformArchitecture_T platformArchitecture, ComPtr<IPlatformProperties> &aPlatformProperties);
    340341    HRESULT getSystemProperties(ComPtr<ISystemProperties> &aSystemProperties);
    341342    HRESULT getMachines(std::vector<ComPtr<IMachine> > &aMachines);
     
    366367    HRESULT createMachine(const com::Utf8Str &aSettingsFile,
    367368                          const com::Utf8Str &aName,
     369                          PlatformArchitecture_T aArchitecture,
    368370                          const std::vector<com::Utf8Str> &aGroups,
    369371                          const com::Utf8Str &aOsTypeId,
  • trunk/src/VBox/Main/src-all/Global.cpp

    r100827 r101035  
    651651}
    652652
    653 /*static*/ uint32_t Global::getMaxNetworkAdapters(ChipsetType_T aChipsetType)
    654 {
    655     switch (aChipsetType)
    656     {
    657         case ChipsetType_PIIX3:
    658             return 8;
    659         case ChipsetType_ICH9:
    660             return 36;
    661         default:
    662             return 0;
    663     }
    664 }
    665 
    666653/*static*/ const char *
    667654Global::stringifyMachineState(MachineState_T aState)
  • trunk/src/VBox/Main/src-client/ConsoleImpl.cpp

    r100606 r101035  
    7878# include "UsbCardReader.h"
    7979#endif
     80#include "PlatformPropertiesImpl.h"
    8081#include "ProgressImpl.h"
    8182#include "ConsoleVRDPServer.h"
     
    545546    mcGuestCredentialsProvided = false;
    546547
     548    ComPtr<IPlatform> pPlatform;
     549    hrc = mMachine->COMGETTER(Platform)(pPlatform.asOutParam());
     550    AssertComRCReturnRC(hrc);
     551
     552    PlatformArchitecture_T platformArch;
     553    hrc = pPlatform->COMGETTER(Architecture)(&platformArch);
     554    AssertComRCReturnRC(hrc);
     555
    547556    /* Now the VM specific parts */
    548557    /** @todo r=bird: aLockType is always LockType_VM.   */
    549558    if (aLockType == LockType_VM)
    550559    {
    551         const char *pszVMM = "VBoxVMM";
    552 
     560        const char *pszVMM = NULL; /* Shut up MSVC. */
     561
     562        switch (platformArch)
     563        {
     564            case PlatformArchitecture_x86:
     565                pszVMM = "VBoxVMM";
     566                break;
    553567#ifdef VBOX_WITH_VIRT_ARMV8
    554         Bstr value;
    555         hrc = mMachine->GetExtraData(Bstr("VBoxInternal2/ArmV8Virt").raw(),
    556                                      value.asOutParam());
    557         if (   hrc   == S_OK
    558             && value == "1")
    559             pszVMM = "VBoxVMMArm";
     568            case PlatformArchitecture_ARM:
     569                pszVMM = "VBoxVMMArm";
     570                break;
    560571#endif
     572            default:
     573                hrc = VBOX_E_PLATFORM_ARCH_NOT_SUPPORTED;
     574                break;
     575        }
     576
     577        if (FAILED(hrc))
     578            return hrc;
    561579
    562580        /* Load the VMM. We won't continue without it being successfully loaded here. */
     
    569587        AssertComRCReturnRC(hrc);
    570588#endif
    571 
    572589        hrc = mMachine->COMGETTER(VRDEServer)(unconst(mVRDEServer).asOutParam());
    573590        AssertComRCReturnRC(hrc);
     
    641658        hrc = aMachine->COMGETTER(Parent)(pVirtualBox.asOutParam());
    642659        AssertComRC(hrc);
     660
    643661        ComPtr<ISystemProperties> pSystemProperties;
     662        ComPtr<IPlatformProperties> pPlatformProperties;
    644663        if (pVirtualBox)
    645             pVirtualBox->COMGETTER(SystemProperties)(pSystemProperties.asOutParam());
     664        {
     665            hrc = pVirtualBox->COMGETTER(SystemProperties)(pSystemProperties.asOutParam());
     666            AssertComRC(hrc);
     667            hrc = pVirtualBox->GetPlatformProperties(platformArch, pPlatformProperties.asOutParam());
     668            AssertComRC(hrc);
     669        }
     670
    646671        ChipsetType_T chipsetType = ChipsetType_PIIX3;
    647         aMachine->COMGETTER(ChipsetType)(&chipsetType);
     672        pPlatform->COMGETTER(ChipsetType)(&chipsetType);
    648673        ULONG maxNetworkAdapters = 0;
    649         if (pSystemProperties)
    650             pSystemProperties->GetMaxNetworkAdapters(chipsetType, &maxNetworkAdapters);
     674        if (pPlatformProperties)
     675            pPlatformProperties->GetMaxNetworkAdapters(chipsetType, &maxNetworkAdapters);
    651676        meAttachmentType.resize(maxNetworkAdapters);
    652677        for (ULONG slot = 0; slot < maxNetworkAdapters; ++slot)
     
    44884513#endif /* 0 */
    44894514
     4515    ComPtr<IPlatform> pPlatform;
     4516    hrc = mMachine->COMGETTER(Platform)(pPlatform.asOutParam());
     4517    AssertComRCReturn(hrc, hrc);
     4518
    44904519    ChipsetType_T enmChipsetType;
    4491     hrc = mMachine->COMGETTER(ChipsetType)(&enmChipsetType);
    4492     if (!FAILED(hrc))
    4493     {
    4494         SafeVMPtrQuiet ptrVM(this);
    4495         if (ptrVM.isOk())
    4496         {
    4497             ULONG ulInstanceMax = (ULONG)Global::getMaxNetworkAdapters(enmChipsetType);
    4498 
    4499             notifyNatDnsChange(ptrVM.rawUVM(), ptrVM.vtable(), "pcnet", ulInstanceMax);
    4500             notifyNatDnsChange(ptrVM.rawUVM(), ptrVM.vtable(), "e1000", ulInstanceMax);
    4501             notifyNatDnsChange(ptrVM.rawUVM(), ptrVM.vtable(), "virtio-net", ulInstanceMax);
    4502         }
     4520    hrc = pPlatform->COMGETTER(ChipsetType)(&enmChipsetType);
     4521    AssertComRCReturn(hrc, hrc);
     4522
     4523    SafeVMPtrQuiet ptrVM(this);
     4524    if (ptrVM.isOk())
     4525    {
     4526        ULONG const ulInstanceMax = PlatformProperties::s_getMaxNetworkAdapters(enmChipsetType);
     4527
     4528        notifyNatDnsChange(ptrVM.rawUVM(), ptrVM.vtable(), "pcnet", ulInstanceMax);
     4529        notifyNatDnsChange(ptrVM.rawUVM(), ptrVM.vtable(), "e1000", ulInstanceMax);
     4530        notifyNatDnsChange(ptrVM.rawUVM(), ptrVM.vtable(), "virtio-net", ulInstanceMax);
    45034531    }
    45044532
     
    52015229    AssertComRCReturn(autoCaller.hrc(), VERR_ACCESS_DENIED);
    52025230
     5231    ComPtr<IPlatform> pPlatform;
     5232    HRESULT hrc = pThis->mMachine->COMGETTER(Platform)(pPlatform.asOutParam());
     5233    AssertComRC(hrc);
     5234
     5235    PlatformArchitecture_T platformArch;
     5236    hrc = pPlatform->COMGETTER(Architecture)(&platformArch);
     5237    AssertComRC(hrc);
     5238
    52035239    ComPtr<IVirtualBox> pVirtualBox;
    52045240    pThis->mMachine->COMGETTER(Parent)(pVirtualBox.asOutParam());
    5205     ComPtr<ISystemProperties> pSystemProperties;
    5206     if (pVirtualBox)
    5207         pVirtualBox->COMGETTER(SystemProperties)(pSystemProperties.asOutParam());
    5208     ChipsetType_T chipsetType = ChipsetType_PIIX3;
    5209     pThis->mMachine->COMGETTER(ChipsetType)(&chipsetType);
     5241
     5242    ComPtr<IPlatformProperties> pPlatformProperties;
     5243    hrc = pVirtualBox->GetPlatformProperties(platformArch, pPlatformProperties.asOutParam());
     5244    AssertComRC(hrc);
     5245
     5246    ChipsetType_T chipsetType = ChipsetType_PIIX3; /*** @todo BUGBUG ASSUMES x86! */
     5247    pPlatform->COMGETTER(ChipsetType)(&chipsetType);
     5248    AssertComRC(hrc);
     5249
    52105250    ULONG maxNetworkAdapters = 0;
    5211     if (pSystemProperties)
    5212         pSystemProperties->GetMaxNetworkAdapters(chipsetType, &maxNetworkAdapters);
     5251    hrc = pPlatformProperties->GetMaxNetworkAdapters(chipsetType, &maxNetworkAdapters);
     5252    AssertComRC(hrc);
    52135253    AssertMsg(   (   !strcmp(pszDevice, "pcnet")
    52145254                  || !strcmp(pszDevice, "e1000")
     
    1062710667    ComPtr<IVirtualBox> pVirtualBox;
    1062810668    mMachine->COMGETTER(Parent)(pVirtualBox.asOutParam());
    10629     ComPtr<ISystemProperties> pSystemProperties;
    10630     if (pVirtualBox)
    10631         pVirtualBox->COMGETTER(SystemProperties)(pSystemProperties.asOutParam());
    10632     ChipsetType_T chipsetType = ChipsetType_PIIX3;
    10633     mMachine->COMGETTER(ChipsetType)(&chipsetType);
     10669
     10670    ComPtr<IPlatform> pPlatform;
     10671    HRESULT hrc = mMachine->COMGETTER(Platform)(pPlatform.asOutParam());
     10672    AssertComRC(hrc);
     10673
     10674    PlatformArchitecture_T platformArch;
     10675    hrc = pPlatform->COMGETTER(Architecture)(&platformArch);
     10676    AssertComRC(hrc);
     10677
     10678    ComPtr<IPlatformProperties> pPlatformProperties;
     10679    hrc = pVirtualBox->GetPlatformProperties(platformArch, pPlatformProperties.asOutParam());
     10680    AssertComRC(hrc);
     10681
     10682    ChipsetType_T chipsetType = ChipsetType_PIIX3; /*** @todo BUGBUG ASSUMES x86! */
     10683    pPlatform->COMGETTER(ChipsetType)(&chipsetType);
     10684    AssertComRC(hrc);
     10685
    1063410686    ULONG maxNetworkAdapters = 0;
    10635     if (pSystemProperties)
    10636         pSystemProperties->GetMaxNetworkAdapters(chipsetType, &maxNetworkAdapters);
    10637 
    10638     HRESULT hrc = S_OK;
     10687    hrc = pPlatformProperties->GetMaxNetworkAdapters(chipsetType, &maxNetworkAdapters);
     10688    AssertComRC(hrc);
     10689
    1063910690    for (ULONG slot = 0; slot < maxNetworkAdapters; slot++)
    1064010691    {
  • trunk/src/VBox/Main/src-client/ConsoleImplConfigArmV8.cpp

    r101014 r101035  
    130130    hrc = virtualBox->COMGETTER(SystemProperties)(systemProperties.asOutParam());           H();
    131131
    132     ComPtr<IBIOSSettings> biosSettings;
    133     hrc = pMachine->COMGETTER(BIOSSettings)(biosSettings.asOutParam());                     H();
     132    ComPtr<IFirmwareSettings> firmwareSettings;
     133    hrc = pMachine->COMGETTER(FirmwareSettings)(firmwareSettings.asOutParam());             H();
    134134
    135135    ComPtr<INvramStore> nvramStore;
     
    145145    uint64_t const cbRam   = cRamMBs * (uint64_t)_1M;
    146146
    147     /** @todo This will be 100% wrong but is required for getting the maximum number of network adapters. */
     147    ComPtr<IPlatform> pPlatform;
     148    hrc = pMachine->COMGETTER(Platform)(pPlatform.asOutParam());                            H();
     149
     150    ComPtr<IPlatformProperties> pPlatformProperties;
     151    hrc = pPlatform->COMGETTER(Properties)(pPlatformProperties.asOutParam());               H();
     152
    148153    ChipsetType_T chipsetType;
    149     hrc = pMachine->COMGETTER(ChipsetType)(&chipsetType);                                   H();
     154    hrc = pPlatform->COMGETTER(ChipsetType)(&chipsetType);                                  H();
    150155
    151156    ULONG cCpus = 1;
    152157    hrc = pMachine->COMGETTER(CPUCount)(&cCpus);                                            H();
     158    Assert(cCpus);
    153159
    154160    ULONG ulCpuExecutionCap = 100;
     
    160166
    161167    ULONG maxNetworkAdapters;
    162     hrc = systemProperties->GetMaxNetworkAdapters(chipsetType, &maxNetworkAdapters);        H();
     168    hrc = pPlatformProperties->GetMaxNetworkAdapters(chipsetType, &maxNetworkAdapters);     H();
    163169
    164170    /*
  • trunk/src/VBox/Main/src-client/ConsoleImplConfigCommon.cpp

    r99913 r101035  
    497497 *
    498498 * @return  VBox status code.
     499 * @return  VERR_PLATFORM_ARCH_NOT_SUPPORTED if the machine's platform architecture is not supported.
    499500 * @param   pUVM        The user mode VM handle.
    500501 * @param   pVM         The cross context VM handle.
     
    506507int Console::i_configConstructorInner(PUVM pUVM, PVM pVM, PCVMMR3VTABLE pVMM, AutoWriteLock *pAlock)
    507508{
     509    ComPtr<IMachine> const pMachine = i_machine();
     510
     511    ComPtr<IPlatform> pPlatform;
     512    HRESULT hrc = pMachine->COMGETTER(Platform)(pPlatform.asOutParam());
     513    AssertComRCReturn(hrc, VERR_COM_VM_ERROR);
     514
     515    PlatformArchitecture_T platformArch;
     516    hrc = pPlatform->COMGETTER(Architecture)(&platformArch);
     517    AssertComRCReturn(hrc, VERR_COM_VM_ERROR);
     518
     519    int rc;
     520
     521    switch (platformArch)
     522    {
     523        case PlatformArchitecture_x86:
     524            return i_configConstructorX86(pUVM, pVM, pVMM, pAlock);
     525
    508526#ifdef VBOX_WITH_VIRT_ARMV8
    509         ComPtr<IMachine> pMachine = i_machine();
    510 
    511         Bstr strArmV8VirtFlag;
    512         HRESULT hrc = pMachine->GetExtraData(Bstr("VBoxInternal2/ArmV8Virt").raw(),
    513                                              strArmV8VirtFlag.asOutParam());
    514         if (   hrc == S_OK
    515             && strArmV8VirtFlag == "1")
     527        case PlatformArchitecture_ARM:
    516528            return i_configConstructorArmV8(pUVM, pVM, pVMM, pAlock);
    517529#endif
    518         return i_configConstructorX86(pUVM, pVM, pVMM, pAlock);
     530        default:
     531            rc = VERR_PLATFORM_ARCH_NOT_SUPPORTED;
     532            break;
     533    }
     534
     535    return rc;
    519536}
    520537
  • trunk/src/VBox/Main/src-client/ConsoleImplConfigX86.cpp

    r101014 r101035  
    5454# include "GuestDnDPrivate.h"
    5555#endif
     56#include "PlatformImpl.h"
    5657#include "VMMDev.h"
    5758#include "Global.h"
     
    514515    hrc = virtualBox->COMGETTER(SystemProperties)(systemProperties.asOutParam());           H();
    515516
    516     ComPtr<IBIOSSettings> biosSettings;
    517     hrc = pMachine->COMGETTER(BIOSSettings)(biosSettings.asOutParam());                     H();
     517    ComPtr<IFirmwareSettings> firmwareSettings;
     518    hrc = pMachine->COMGETTER(FirmwareSettings)(firmwareSettings.asOutParam());             H();
    518519
    519520    ComPtr<INvramStore> nvramStore;
     
    544545    BOOL fIOAPIC;
    545546    uint32_t uIoApicPciAddress = NIL_PCIBDF;
    546     hrc = biosSettings->COMGETTER(IOAPICEnabled)(&fIOAPIC);                                 H();
     547    hrc = firmwareSettings->COMGETTER(IOAPICEnabled)(&fIOAPIC);                             H();
     548
     549    ComPtr<IPlatform> platform;
     550    pMachine->COMGETTER(Platform)(platform.asOutParam());                                   H();
    547551
    548552    ChipsetType_T chipsetType;
    549     hrc = pMachine->COMGETTER(ChipsetType)(&chipsetType);                                   H();
     553    hrc = platform->COMGETTER(ChipsetType)(&chipsetType);                                   H();
    550554    if (chipsetType == ChipsetType_ICH9)
    551555    {
     
    563567    hrc = pMachine->COMGETTER(CPUProfile)(bstrCpuProfile.asOutParam());                     H();
    564568
     569    /* Get the X86 platform object. */
     570    ComPtr<IPlatformX86> platformX86;
     571    hrc = platform->COMGETTER(X86)(platformX86.asOutParam());                               H();
     572
    565573    /* Check if long mode is enabled. */
    566574    BOOL fIsGuest64Bit;
    567     hrc = pMachine->GetCPUProperty(CPUPropertyType_LongMode, &fIsGuest64Bit);               H();
     575    hrc = platformX86->GetCPUProperty(CPUPropertyTypeX86_LongMode, &fIsGuest64Bit);         H();
    568576
    569577    /*
     
    572580#if defined(VBOX_WITH_IOMMU_AMD) || defined(VBOX_WITH_IOMMU_INTEL)
    573581    IommuType_T enmIommuType;
    574     hrc = pMachine->COMGETTER(IommuType)(&enmIommuType);                                    H();
     582    hrc = platform->COMGETTER(IommuType)(&enmIommuType);                                    H();
    575583
    576584    /* Resolve 'automatic' type to an Intel or AMD IOMMU based on the host CPU. */
     
    664672
    665673    APICMode_T apicMode;
    666     hrc = biosSettings->COMGETTER(APICMode)(&apicMode);                                     H();
     674    hrc = firmwareSettings->COMGETTER(APICMode)(&apicMode);                                 H();
    667675    uint32_t uFwAPIC;
    668676    switch (apicMode)
     
    702710    }
    703711
     712    ComPtr<IPlatformProperties> platformProperties;
     713    virtualBox->GetPlatformProperties(PlatformArchitecture_x86, platformProperties.asOutParam());
     714
    704715    ULONG maxNetworkAdapters;
    705     hrc = systemProperties->GetMaxNetworkAdapters(chipsetType, &maxNetworkAdapters);        H();
     716    hrc = platformProperties->GetMaxNetworkAdapters(chipsetType, &maxNetworkAdapters);      H();
    706717
    707718    /*
     
    745756        /* Triple fault behavior. */
    746757        BOOL fTripleFaultReset = false;
    747         hrc = pMachine->GetCPUProperty(CPUPropertyType_TripleFaultReset, &fTripleFaultReset); H();
     758        hrc = platformX86->GetCPUProperty(CPUPropertyTypeX86_TripleFaultReset, &fTripleFaultReset); H();
    748759        InsertConfigInteger(pEM, "TripleFaultReset", fTripleFaultReset);
    749760
     
    760771        {
    761772            ULONG uLeaf, uSubLeaf, uEax, uEbx, uEcx, uEdx;
    762             hrc = pMachine->GetCPUIDLeafByOrdinal(iOrdinal, &uLeaf, &uSubLeaf, &uEax, &uEbx, &uEcx, &uEdx);
     773            hrc = platformX86->GetCPUIDLeafByOrdinal(iOrdinal, &uLeaf, &uSubLeaf, &uEax, &uEbx, &uEcx, &uEdx);
    763774            if (hrc == E_INVALIDARG)
    764775                break;
     
    821832        /* Physical Address Extension (PAE) */
    822833        BOOL fEnablePAE = false;
    823         hrc = pMachine->GetCPUProperty(CPUPropertyType_PAE, &fEnablePAE);                   H();
     834        hrc = platformX86->GetCPUProperty(CPUPropertyTypeX86_PAE, &fEnablePAE);             H();
    824835        fEnablePAE |= fIsGuest64Bit;
    825836        InsertConfigInteger(pRoot, "EnablePAE", fEnablePAE);
     
    831842        BOOL fEnableAPIC = true;
    832843        BOOL fEnableX2APIC = true;
    833         hrc = pMachine->GetCPUProperty(CPUPropertyType_APIC, &fEnableAPIC);                 H();
    834         hrc = pMachine->GetCPUProperty(CPUPropertyType_X2APIC, &fEnableX2APIC);             H();
     844        hrc = platformX86->GetCPUProperty(CPUPropertyTypeX86_APIC, &fEnableAPIC);           H();
     845        hrc = platformX86->GetCPUProperty(CPUPropertyTypeX86_X2APIC, &fEnableX2APIC);       H();
    835846        if (fEnableX2APIC)
    836847            Assert(fEnableAPIC);
     
    877888        /* Speculation Control. */
    878889        BOOL fSpecCtrl = FALSE;
    879         hrc = pMachine->GetCPUProperty(CPUPropertyType_SpecCtrl, &fSpecCtrl);      H();
     890        hrc = platformX86->GetCPUProperty(CPUPropertyTypeX86_SpecCtrl, &fSpecCtrl);   H();
    880891        InsertConfigInteger(pCPUM, "SpecCtrl", fSpecCtrl);
    881892
    882893        /* Nested VT-x / AMD-V. */
    883894        BOOL fNestedHWVirt = FALSE;
    884         hrc = pMachine->GetCPUProperty(CPUPropertyType_HWVirt, &fNestedHWVirt);      H();
     895        hrc = platformX86->GetCPUProperty(CPUPropertyTypeX86_HWVirt, &fNestedHWVirt); H();
    885896        InsertConfigInteger(pCPUM, "NestedHWVirt", fNestedHWVirt ? true : false);
    886897
     
    903914
    904915        BOOL fHMEnabled;
    905         hrc = pMachine->GetHWVirtExProperty(HWVirtExPropertyType_Enabled, &fHMEnabled);     H();
     916        hrc = platformX86->GetHWVirtExProperty(HWVirtExPropertyType_Enabled, &fHMEnabled);      H();
    906917        if (cCpus > 1 && !fHMEnabled)
    907918        {
     
    915926        if (!fHMForced) /* No need to query if already forced above. */
    916927        {
    917             hrc = pMachine->GetHWVirtExProperty(HWVirtExPropertyType_Force, &fHMForced); H();
     928            hrc = platformX86->GetHWVirtExProperty(HWVirtExPropertyType_Force, &fHMForced);    H();
    918929            if (fHMForced)
    919930                LogRel(("fHMForced=true - HWVirtExPropertyType_Force\n"));
     
    947958        /* HWVirtEx exclusive mode */
    948959        BOOL fHMExclusive = true;
    949         hrc = systemProperties->COMGETTER(ExclusiveHwVirt)(&fHMExclusive);                  H();
     960        hrc = platformProperties->COMGETTER(ExclusiveHwVirt)(&fHMExclusive);                  H();
    950961        InsertConfigInteger(pHM, "Exclusive", fHMExclusive);
    951962
    952963        /* Nested paging (VT-x/AMD-V) */
    953964        BOOL fEnableNestedPaging = false;
    954         hrc = pMachine->GetHWVirtExProperty(HWVirtExPropertyType_NestedPaging, &fEnableNestedPaging); H();
     965        hrc = platformX86->GetHWVirtExProperty(HWVirtExPropertyType_NestedPaging, &fEnableNestedPaging); H();
    955966        InsertConfigInteger(pHM, "EnableNestedPaging", fEnableNestedPaging);
    956967
    957968        /* Large pages; requires nested paging */
    958969        BOOL fEnableLargePages = false;
    959         hrc = pMachine->GetHWVirtExProperty(HWVirtExPropertyType_LargePages, &fEnableLargePages); H();
     970        hrc = platformX86->GetHWVirtExProperty(HWVirtExPropertyType_LargePages, &fEnableLargePages); H();
    960971        InsertConfigInteger(pHM, "EnableLargePages", fEnableLargePages);
    961972
    962973        /* VPID (VT-x) */
    963974        BOOL fEnableVPID = false;
    964         hrc = pMachine->GetHWVirtExProperty(HWVirtExPropertyType_VPID, &fEnableVPID);       H();
     975        hrc = platformX86->GetHWVirtExProperty(HWVirtExPropertyType_VPID, &fEnableVPID);       H();
    965976        InsertConfigInteger(pHM, "EnableVPID", fEnableVPID);
    966977
    967978        /* Unrestricted execution aka UX (VT-x) */
    968979        BOOL fEnableUX = false;
    969         hrc = pMachine->GetHWVirtExProperty(HWVirtExPropertyType_UnrestrictedExecution, &fEnableUX); H();
     980        hrc = platformX86->GetHWVirtExProperty(HWVirtExPropertyType_UnrestrictedExecution, &fEnableUX); H();
    970981        InsertConfigInteger(pHM, "EnableUX", fEnableUX);
    971982
     
    977988        /* Indirect branch prediction boundraries. */
    978989        BOOL fIBPBOnVMExit = false;
    979         hrc = pMachine->GetCPUProperty(CPUPropertyType_IBPBOnVMExit, &fIBPBOnVMExit); H();
     990        hrc = platformX86->GetCPUProperty(CPUPropertyTypeX86_IBPBOnVMExit, &fIBPBOnVMExit); H();
    980991        InsertConfigInteger(pHM, "IBPBOnVMExit", fIBPBOnVMExit);
    981992
    982993        BOOL fIBPBOnVMEntry = false;
    983         hrc = pMachine->GetCPUProperty(CPUPropertyType_IBPBOnVMEntry, &fIBPBOnVMEntry); H();
     994        hrc = platformX86->GetCPUProperty(CPUPropertyTypeX86_IBPBOnVMEntry, &fIBPBOnVMEntry); H();
    984995        InsertConfigInteger(pHM, "IBPBOnVMEntry", fIBPBOnVMEntry);
    985996
    986997        BOOL fSpecCtrlByHost = false;
    987         hrc = pMachine->GetCPUProperty(CPUPropertyType_SpecCtrlByHost, &fSpecCtrlByHost); H();
     998        hrc = platformX86->GetCPUProperty(CPUPropertyTypeX86_SpecCtrlByHost, &fSpecCtrlByHost); H();
    988999        InsertConfigInteger(pHM, "SpecCtrlByHost", fSpecCtrlByHost);
    9891000
    9901001        BOOL fL1DFlushOnSched = true;
    991         hrc = pMachine->GetCPUProperty(CPUPropertyType_L1DFlushOnEMTScheduling, &fL1DFlushOnSched); H();
     1002        hrc = platformX86->GetCPUProperty(CPUPropertyTypeX86_L1DFlushOnEMTScheduling, &fL1DFlushOnSched); H();
    9921003        InsertConfigInteger(pHM, "L1DFlushOnSched", fL1DFlushOnSched);
    9931004
    9941005        BOOL fL1DFlushOnVMEntry = false;
    995         hrc = pMachine->GetCPUProperty(CPUPropertyType_L1DFlushOnVMEntry, &fL1DFlushOnVMEntry); H();
     1006        hrc = platformX86->GetCPUProperty(CPUPropertyTypeX86_L1DFlushOnVMEntry, &fL1DFlushOnVMEntry); H();
    9961007        InsertConfigInteger(pHM, "L1DFlushOnVMEntry", fL1DFlushOnVMEntry);
    9971008
    9981009        BOOL fMDSClearOnSched = true;
    999         hrc = pMachine->GetCPUProperty(CPUPropertyType_MDSClearOnEMTScheduling, &fMDSClearOnSched); H();
     1010        hrc = platformX86->GetCPUProperty(CPUPropertyTypeX86_MDSClearOnEMTScheduling, &fMDSClearOnSched); H();
    10001011        InsertConfigInteger(pHM, "MDSClearOnSched", fMDSClearOnSched);
    10011012
    10021013        BOOL fMDSClearOnVMEntry = false;
    1003         hrc = pMachine->GetCPUProperty(CPUPropertyType_MDSClearOnVMEntry, &fMDSClearOnVMEntry); H();
     1014        hrc = platformX86->GetCPUProperty(CPUPropertyTypeX86_MDSClearOnVMEntry, &fMDSClearOnVMEntry); H();
    10041015        InsertConfigInteger(pHM, "MDSClearOnVMEntry", fMDSClearOnVMEntry);
    10051016
     
    10121023        /* Use NEM rather than HM. */
    10131024        BOOL fUseNativeApi = false;
    1014         hrc = pMachine->GetHWVirtExProperty(HWVirtExPropertyType_UseNativeApi, &fUseNativeApi); H();
     1025        hrc = platformX86->GetHWVirtExProperty(HWVirtExPropertyType_UseNativeApi, &fUseNativeApi); H();
    10151026        InsertConfigInteger(pHM, "UseNEMInstead", fUseNativeApi);
    10161027
     
    12851296         */
    12861297        LONG64 timeOffset;
    1287         hrc = biosSettings->COMGETTER(TimeOffset)(&timeOffset);                             H();
     1298        hrc = firmwareSettings->COMGETTER(TimeOffset)(&timeOffset);                             H();
    12881299        PCFGMNODE pTMNode;
    12891300        InsertConfigNode(pRoot, "TM", &pTMNode);
     
    13861397        BOOL fHPETEnabled;
    13871398        /* Other guests may wish to use HPET too, but MacOS X not functional without it */
    1388         hrc = pMachine->COMGETTER(HPETEnabled)(&fHPETEnabled);                              H();
     1399        hrc = platformX86->COMGETTER(HPETEnabled)(&fHPETEnabled);                              H();
    13891400        /* so always enable HPET in extended profile */
    13901401        fHPETEnabled |= fOsXGuest;
     
    15381549        InsertConfigNode(pInst,    "Config", &pCfg);
    15391550        BOOL fRTCUseUTC;
    1540         hrc = pMachine->COMGETTER(RTCUseUTC)(&fRTCUseUTC);                                  H();
     1551        hrc = platform->COMGETTER(RTCUseUTC)(&fRTCUseUTC);                                   H();
    15411552        InsertConfigInteger(pCfg,  "UseUTC", fRTCUseUTC ? 1 : 0);
    15421553
     
    15601571#endif
    15611572            case GraphicsControllerType_VBoxVGA:
    1562                 vrc = i_configGraphicsController(pDevices, enmGraphicsController, pBusMgr, pMachine, pGraphicsAdapter, biosSettings,
     1573                vrc = i_configGraphicsController(pDevices, enmGraphicsController, pBusMgr, pMachine, pGraphicsAdapter, firmwareSettings,
    15631574                                                 RT_BOOL(fHMEnabled));
    15641575                if (FAILED(vrc))
     
    15751586         */
    15761587        FirmwareType_T eFwType =  FirmwareType_BIOS;
    1577         hrc = pMachine->COMGETTER(FirmwareType)(&eFwType);                                  H();
     1588        hrc = firmwareSettings->COMGETTER(FirmwareType)(&eFwType);                          H();
    15781589
    15791590#ifdef VBOX_WITH_EFI
     
    15971608            InsertConfigInteger(pBiosCfg,  "APIC",                 uFwAPIC);
    15981609            BOOL fPXEDebug;
    1599             hrc = biosSettings->COMGETTER(PXEDebugEnabled)(&fPXEDebug);                     H();
     1610            hrc = firmwareSettings->COMGETTER(PXEDebugEnabled)(&fPXEDebug);                     H();
    16001611            InsertConfigInteger(pBiosCfg,  "PXEDebug",             fPXEDebug);
    16011612            InsertConfigBytes(pBiosCfg,    "UUID", &HardwareUuid,sizeof(HardwareUuid));
    16021613            BOOL fUuidLe;
    1603             hrc = biosSettings->COMGETTER(SMBIOSUuidLittleEndian)(&fUuidLe);                H();
     1614            hrc = firmwareSettings->COMGETTER(SMBIOSUuidLittleEndian)(&fUuidLe);                H();
    16041615            InsertConfigInteger(pBiosCfg,  "UuidLe",               fUuidLe);
    16051616            InsertConfigNode(pBiosCfg,     "NetBoot", &pNetBootCfg);
     
    16801691
    16811692            BOOL fUuidLe;
    1682             hrc = biosSettings->COMGETTER(SMBIOSUuidLittleEndian)(&fUuidLe);                H();
     1693            hrc = firmwareSettings->COMGETTER(SMBIOSUuidLittleEndian)(&fUuidLe);                H();
    16831694
    16841695            /* Get graphics mode settings */
     
    26062617
    26072618            ULONG ulIOBase;
    2608             hrc = serialPort->COMGETTER(IOBase)(&ulIOBase);                                 H();
    2609             InsertConfigInteger(pCfg, "IOBase", ulIOBase);
     2619            hrc = serialPort->COMGETTER(IOAddress)(&ulIOBase);                              H();
     2620            InsertConfigInteger(pCfg, "IOAddress", ulIOBase);
    26102621            auSerialIoPortBase[ulInstance] = (uint16_t)ulIOBase;
    26112622
     
    32363247         */
    32373248        BOOL fACPI;
    3238         hrc = biosSettings->COMGETTER(ACPIEnabled)(&fACPI);                                 H();
     3249        hrc = firmwareSettings->COMGETTER(ACPIEnabled)(&fACPI);                                 H();
    32393250        if (fACPI)
    32403251        {
     
    35973608                                        const ComPtr<IMachine> &ptrMachine,
    35983609                                        const ComPtr<IGraphicsAdapter> &ptrGraphicsAdapter,
    3599                                         const ComPtr<IBIOSSettings> &ptrBiosSettings,
     3610                                        const ComPtr<IFirmwareSettings> &ptrFirmwareSettings,
    36003611                                        bool fHMEnabled)
    36013612{
     
    36873698         */
    36883699        BOOL fFadeIn;
    3689         hrc = ptrBiosSettings->COMGETTER(LogoFadeIn)(&fFadeIn);                             H();
     3700        hrc = ptrFirmwareSettings->COMGETTER(LogoFadeIn)(&fFadeIn);                             H();
    36903701        InsertConfigInteger(pCfg,  "FadeIn",  fFadeIn ? 1 : 0);
    36913702        BOOL fFadeOut;
    3692         hrc = ptrBiosSettings->COMGETTER(LogoFadeOut)(&fFadeOut);                           H();
     3703        hrc = ptrFirmwareSettings->COMGETTER(LogoFadeOut)(&fFadeOut);                           H();
    36933704        InsertConfigInteger(pCfg,  "FadeOut", fFadeOut ? 1: 0);
    36943705        ULONG logoDisplayTime;
    3695         hrc = ptrBiosSettings->COMGETTER(LogoDisplayTime)(&logoDisplayTime);                H();
     3706        hrc = ptrFirmwareSettings->COMGETTER(LogoDisplayTime)(&logoDisplayTime);                H();
    36963707        InsertConfigInteger(pCfg,  "LogoTime", logoDisplayTime);
    36973708        Bstr bstrLogoImagePath;
    3698         hrc = ptrBiosSettings->COMGETTER(LogoImagePath)(bstrLogoImagePath.asOutParam());    H();
     3709        hrc = ptrFirmwareSettings->COMGETTER(LogoImagePath)(bstrLogoImagePath.asOutParam());    H();
    36993710        InsertConfigString(pCfg,   "LogoFile", bstrLogoImagePath);
    37003711
     
    37023713         * Boot menu
    37033714         */
    3704         BIOSBootMenuMode_T eBootMenuMode;
     3715        FirmwareBootMenuMode_T enmBootMenuMode;
    37053716        int iShowBootMenu;
    3706         hrc = ptrBiosSettings->COMGETTER(BootMenuMode)(&eBootMenuMode);                     H();
    3707         switch (eBootMenuMode)
    3708         {
    3709             case BIOSBootMenuMode_Disabled: iShowBootMenu = 0;  break;
    3710             case BIOSBootMenuMode_MenuOnly: iShowBootMenu = 1;  break;
     3717        hrc = ptrFirmwareSettings->COMGETTER(BootMenuMode)(&enmBootMenuMode);                     H();
     3718        switch (enmBootMenuMode)
     3719        {
     3720            case FirmwareBootMenuMode_Disabled: iShowBootMenu = 0;  break;
     3721            case FirmwareBootMenuMode_MenuOnly: iShowBootMenu = 1;  break;
    37113722            default:                        iShowBootMenu = 2;  break;
    37123723        }
  • trunk/src/VBox/Main/src-server/ApplianceImplExport.cpp

    r99604 r101035  
    146146        // memory size in MB
    147147        uint32_t ulMemSizeMB = mHWData->mMemorySize;
     148
     149        ComPtr<IPlatformX86> pPlatformX86;
     150        mPlatform->COMGETTER(X86)(pPlatformX86.asOutParam());
     151
    148152        // VRAM size?
    149153        // BIOS settings?
     
    155159        // Long mode enabled?
    156160        BOOL fLongMode;
    157         hrc = GetCPUProperty(CPUPropertyType_LongMode, &fLongMode);
     161        hrc = pPlatformX86->GetCPUProperty(CPUPropertyTypeX86_LongMode, &fLongMode);
    158162        if (FAILED(hrc)) throw hrc;
    159163
     
    620624
    621625//     <const name="NetworkAdapter" />
    622         uint32_t maxNetworkAdapters = Global::getMaxNetworkAdapters(i_getChipsetType());
     626        ChipsetType_T enmChipsetType;
     627        hrc = mPlatform->getChipsetType(&enmChipsetType);
     628        if (FAILED(hrc))
     629            return hrc;
     630
     631        uint32_t const maxNetworkAdapters = PlatformProperties::s_getMaxNetworkAdapters(enmChipsetType);
    623632        size_t a;
    624633        for (a = 0; a < maxNetworkAdapters; ++a)
  • trunk/src/VBox/Main/src-server/ApplianceImplImport.cpp

    r99608 r101035  
    415415            if (vsysThis.pelmVBoxMachine)
    416416            {
    417                 uint32_t maxNetworkAdapters = Global::getMaxNetworkAdapters(pNewDesc->m->pConfig->hardwareMachine.chipsetType);
     417                uint32_t maxNetworkAdapters =
     418                    PlatformProperties::s_getMaxNetworkAdapters(pNewDesc->m->pConfig->hardwareMachine.platformSettings.chipsetType);
    418419
    419420                const settings::NetworkAdaptersList &llNetworkAdapters = pNewDesc->m->pConfig->hardwareMachine.llNetworkAdapters;
     
    446447            {
    447448                size_t cEthernetAdapters = vsysThis.llEthernetAdapters.size();
    448                 uint32_t maxNetworkAdapters = Global::getMaxNetworkAdapters(ChipsetType_PIIX3);
     449                uint32_t const maxNetworkAdapters = PlatformProperties::s_getMaxNetworkAdapters(ChipsetType_PIIX3); /** @todo BUGBUG x86 only for now. */
    449450
    450451                /* Check for the constrains */
     
    44154416                                                      ULONG *aMaxPortCount)
    44164417{
    4417     SystemProperties *pSysProps;
    4418     pSysProps = mVirtualBox->i_getSystemProperties();
    4419     if (pSysProps == NULL)
    4420         return VBOX_E_OBJECT_NOT_FOUND;
     4418    ComPtr<IPlatformProperties> platformProperties;
     4419    mVirtualBox->GetPlatformProperties(PlatformArchitecture_x86, platformProperties.asOutParam()); /// @todo BUGBUG Only x86 for now!
    44214420
    44224421    StorageBus_T enmStorageBus = StorageBus_Null;
    4423     HRESULT hrc = pSysProps->GetStorageBusForStorageControllerType(aStorageControllerType, &enmStorageBus);
     4422    HRESULT hrc = platformProperties->GetStorageBusForStorageControllerType(aStorageControllerType, &enmStorageBus);
    44244423    if (FAILED(hrc))
    44254424        return hrc;
    44264425
    4427     hrc = pSysProps->GetMaxPortCountForStorageBus(enmStorageBus, aMaxPortCount);
     4426    hrc = platformProperties->GetMaxPortCountForStorageBus(enmStorageBus, aMaxPortCount);
    44284427    if (FAILED(hrc))
    44294428        return hrc;
     
    44714470    hrc = mVirtualBox->CreateMachine(Bstr(stack.strSettingsFilename).raw(),
    44724471                                     Bstr(stack.strNameVBox).raw(),
     4472                                     PlatformArchitecture_x86, /// @todo BUGBUG Only x86 for now!
    44734473                                     ComSafeArrayAsInParam(groups),
    44744474                                     Bstr(stack.strOsTypeVBox).raw(),
     
    44814481    pNewMachineRet = pNewMachine;
    44824482
     4483    ComPtr<IPlatform> pPlatform;
     4484    hrc = pNewMachine->COMGETTER(Platform)(pPlatform.asOutParam());
     4485    if (FAILED(hrc)) throw hrc;
     4486
     4487    ComPtr<IPlatformX86> pPlatformX86; /// @todo BUGBUG Only x86 for now! */
     4488    hrc = pPlatform->COMGETTER(X86)(pPlatformX86.asOutParam());
     4489    if (FAILED(hrc)) throw hrc;
     4490
    44834491    // set the description
    44844492    if (!stack.strDescription.isEmpty())
     
    44944502    if (stack.fForceHWVirt)
    44954503    {
    4496         hrc = pNewMachine->SetHWVirtExProperty(HWVirtExPropertyType_Enabled, TRUE);
     4504        hrc = pPlatformX86->SetHWVirtExProperty(HWVirtExPropertyType_Enabled, TRUE);
    44974505        if (FAILED(hrc)) throw hrc;
    44984506    }
     
    45284536    }
    45294537
     4538    ComPtr<IFirmwareSettings> pFirmwareSettings;
     4539    hrc = pNewMachine->COMGETTER(FirmwareSettings)(pFirmwareSettings.asOutParam());
     4540    if (FAILED(hrc)) throw hrc;
     4541
    45304542    if (stack.fForceIOAPIC)
    45314543    {
    4532         ComPtr<IBIOSSettings> pBIOSSettings;
    4533         hrc = pNewMachine->COMGETTER(BIOSSettings)(pBIOSSettings.asOutParam());
    4534         if (FAILED(hrc)) throw hrc;
    4535 
    4536         hrc = pBIOSSettings->COMSETTER(IOAPICEnabled)(TRUE);
     4544        hrc = pFirmwareSettings->COMSETTER(IOAPICEnabled)(TRUE);
    45374545        if (FAILED(hrc)) throw hrc;
    45384546    }
     
    45504558                firmwareType = FirmwareType_EFI;
    45514559        }
    4552         hrc = pNewMachine->COMSETTER(FirmwareType)(firmwareType);
     4560        hrc = pFirmwareSettings->COMSETTER(FirmwareType)(firmwareType);
    45534561        if (FAILED(hrc)) throw hrc;
    45544562    }
     
    45814589
    45824590    /* Change the network adapters */
    4583     uint32_t maxNetworkAdapters = Global::getMaxNetworkAdapters(ChipsetType_PIIX3);
     4591    uint32_t const maxNetworkAdapters = PlatformProperties::s_getMaxNetworkAdapters(ChipsetType_PIIX3); /** @todo BUGBUG Only x86 for now! */
    45844592
    45854593    std::list<VirtualSystemDescriptionEntry*> vsdeNW = vsdescThis->i_findByType(VirtualSystemDescriptionType_NetworkAdapter);
     
    53535361    config.hardwareMachine.cCPUs = stack.cCPUs;
    53545362    if (stack.fForceIOAPIC)
    5355         config.hardwareMachine.fHardwareVirt = true;
     5363        config.hardwareMachine.platformSettings.x86.fHWVirtEx = true;
    53565364    if (stack.fForceIOAPIC)
    5357         config.hardwareMachine.biosSettings.fIOAPICEnabled = true;
     5365        config.hardwareMachine.firmwareSettings.fIOAPICEnabled = true;
    53585366    /* RAM size */
    53595367    config.hardwareMachine.ulMemorySizeMB = stack.ulMemorySizeMB;
  • trunk/src/VBox/Main/src-server/HostImpl.cpp

    r100772 r101035  
    4141
    4242#include "HostImpl.h"
     43#include "HostX86Impl.h"
    4344
    4445#ifdef VBOX_WITH_USB
     
    150151#endif
    151152
    152 #if defined(RT_ARCH_AMD64) || defined(RT_ARCH_X86)
    153 # include <iprt/asm-amd64-x86.h>
    154 #endif
    155153#ifdef RT_OS_SOLARIS
    156154# include <iprt/ctype.h>
     
    159157# include <iprt/file.h>
    160158#endif
    161 #include <iprt/mp.h>
    162159#include <iprt/env.h>
    163160#include <iprt/mem.h>
     
    263260    const ComObjPtr<HostUpdateAgent> pUpdateHost;
    264261#endif
     262    /** Reference to the x86 host specific portions of the host object. */
     263    const ComObjPtr<HostX86>         pHostX86;
    265264};
    266265
     
    301300
    302301    m->pParent = aParent;
     302
     303    hrc = unconst(m->pHostX86).createObject();
     304    if (SUCCEEDED(hrc))
     305        hrc = m->pHostX86->init();
     306    AssertComRCReturn(hrc, hrc);
    303307
    304308#ifdef VBOX_WITH_USB
     
    515519    m->hostDnsMonitorProxy.uninit();
    516520
     521    if (m->pHostX86)
     522    {
     523        m->pHostX86->uninit();
     524        unconst(m->pHostX86).setNull();
     525    }
     526
    517527#ifdef VBOX_WITH_UPDATE_AGENT
    518528    if (m->pUpdateHost)
     
    582592//
    583593////////////////////////////////////////////////////////////////////////////////
     594
     595/**
     596 * Returns the host's platform architecture.
     597 *
     598 * @returns COM status code
     599 * @param   platformArchitecture    Where to return the host's platform architecture.
     600 */
     601HRESULT Host::getArchitecture(PlatformArchitecture_T *platformArchitecture)
     602{
     603#if defined(RT_ARCH_AMD64) || defined(RT_ARCH_X86)
     604    *platformArchitecture = PlatformArchitecture_x86;
     605#elif defined(RT_ARCH_ARM64) || defined(RT_ARCH_ARM32)
     606    *platformArchitecture = PlatformArchitecture_ARM;
     607#else
     608# error "Port me!"
     609#endif
     610
     611    return S_OK;
     612}
    584613
    585614/**
     
    13241353
    13251354/**
    1326  * Returns the specific CPUID leaf.
    1327  *
    1328  * @returns COM status code
    1329  * @param   aCpuId              The CPU number. Mostly ignored.
    1330  * @param   aLeaf               The leaf number.
    1331  * @param   aSubLeaf            The sub-leaf number.
    1332  * @param   aValEAX             Where to return EAX.
    1333  * @param   aValEBX             Where to return EBX.
    1334  * @param   aValECX             Where to return ECX.
    1335  * @param   aValEDX             Where to return EDX.
    1336  */
    1337 HRESULT Host::getProcessorCPUIDLeaf(ULONG aCpuId, ULONG aLeaf, ULONG aSubLeaf,
    1338                                     ULONG *aValEAX, ULONG *aValEBX, ULONG *aValECX, ULONG *aValEDX)
    1339 {
    1340     // no locking required
    1341 
    1342     /* Check that the CPU is online. */
    1343     /** @todo later use RTMpOnSpecific. */
    1344     if (!RTMpIsCpuOnline(aCpuId))
    1345         return RTMpIsCpuPresent(aCpuId)
    1346              ? setError(E_FAIL, tr("CPU no.%u is not present"), aCpuId)
    1347              : setError(E_FAIL, tr("CPU no.%u is not online"), aCpuId);
    1348 
    1349 #if defined(RT_ARCH_AMD64) || defined(RT_ARCH_X86)
    1350     uint32_t uEAX, uEBX, uECX, uEDX;
    1351     ASMCpuId_Idx_ECX(aLeaf, aSubLeaf, &uEAX, &uEBX, &uECX, &uEDX);
    1352     *aValEAX = uEAX;
    1353     *aValEBX = uEBX;
    1354     *aValECX = uECX;
    1355     *aValEDX = uEDX;
    1356 #else
    1357     RT_NOREF(aLeaf, aSubLeaf);
    1358     *aValEAX = 0;
    1359     *aValEBX = 0;
    1360     *aValECX = 0;
    1361     *aValEDX = 0;
    1362 #endif
    1363 
    1364     return S_OK;
    1365 }
    1366 
    1367 /**
    13681355 * Returns the amount of installed system memory in megabytes
    13691356 *
     
    20001987
    20011988    return S_OK;
     1989}
     1990
     1991/**
     1992 * Returns the x86 host specific portions of the host object.
     1993 *
     1994 * @returns x86 host specific portions of the host object.
     1995 * @param   aHostX86            Where to return the x86 host specific portions of the host objects.
     1996 */
     1997HRESULT Host::getX86(ComPtr<IHostX86> &aHostX86)
     1998{
     1999    return m->pHostX86.queryInterfaceTo(aHostX86.asOutParam());
    20022000}
    20032001
  • trunk/src/VBox/Main/src-server/MachineImpl.cpp

    r100179 r101035  
    242242    mMemoryBalloonSize = 0;
    243243    mPageFusionEnabled = false;
    244     mHWVirtExEnabled = true;
    245     mHWVirtExNestedPagingEnabled = true;
    246     mHWVirtExLargePagesEnabled = HC_ARCH_BITS == 64;  /* Not supported on 32 bits hosts. */
    247     mHWVirtExVPIDEnabled = true;
    248     mHWVirtExUXEnabled = true;
    249     mHWVirtExForceEnabled = false;
    250     mHWVirtExUseNativeApi = false;
    251     mHWVirtExVirtVmsaveVmload = true;
    252 #if HC_ARCH_BITS == 64 || defined(RT_OS_WINDOWS) || defined(RT_OS_DARWIN)
    253     mPAEEnabled = true;
    254 #else
    255     mPAEEnabled = false;
    256 #endif
    257     mLongMode =  HC_ARCH_BITS == 64 ? settings::Hardware::LongMode_Enabled : settings::Hardware::LongMode_Disabled;
    258     mTripleFaultReset = false;
    259     mAPIC = true;
    260     mX2APIC = false;
    261     mIBPBOnVMExit = false;
    262     mIBPBOnVMEntry = false;
    263     mSpecCtrl = false;
    264     mSpecCtrlByHost = false;
    265     mL1DFlushOnSched = true;
    266     mL1DFlushOnVMEntry = false;
    267     mMDSClearOnSched = true;
    268     mMDSClearOnVMEntry = false;
    269     mNestedHWVirt = false;
    270     mHPETEnabled = false;
    271244    mCpuExecutionCap = 100; /* Maximum CPU execution cap by default. */
    272245    mCpuIdPortabilityLevel = 0;
     
    285258    mDnDMode = DnDMode_Disabled;
    286259
    287     mFirmwareType = FirmwareType_BIOS;
    288     mKeyboardHIDType = KeyboardHIDType_PS2Keyboard;
    289     mPointingHIDType = PointingHIDType_PS2Mouse;
    290     mChipsetType = ChipsetType_PIIX3;
    291     mIommuType = IommuType_None;
     260    mKeyboardHIDType = KeyboardHIDType_PS2Keyboard; /** @todo BUGBUG Assumes x86! */
     261    mPointingHIDType = PointingHIDType_PS2Mouse; /** @todo BUGBUG Assumes x86! */
    292262    mParavirtProvider = ParavirtProvider_Default;
    293263    mEmulatedUSBCardReaderEnabled = FALSE;
     
    342312 *  This gets called from VirtualBox::CreateMachine().
    343313 *
    344  *  @param aParent      Associated parent object
    345  *  @param strConfigFile  Local file system path to the VM settings file (can
    346  *                      be relative to the VirtualBox config directory).
    347  *  @param strName      name for the machine
    348  *  @param llGroups     list of groups for the machine
    349  *  @param strOsType    OS Type string (stored as is if aOsType is NULL).
    350  *  @param aOsType      OS Type of this machine or NULL.
    351  *  @param aId          UUID for the new machine.
    352  *  @param fForceOverwrite Whether to overwrite an existing machine settings file.
    353  *  @param fDirectoryIncludesUUID Whether the use a special VM directory naming
    354  *                      scheme (includes the UUID).
    355  *  @param aCipher      The cipher to encrypt the VM with.
    356  *  @param aPasswordId  The password ID, empty if the VM should not be encrypted.
    357  *  @param aPassword    The password to encrypt the VM with.
     314 *  @param aParent              Associated parent object.
     315 *  @param strConfigFile        Local file system path to the VM settings (can be relative to the VirtualBox config directory).
     316 *  @param strName              Name for the machine.
     317 *  @param aArchitecture        Architecture to use for the machine.
     318 *  @param llGroups             list of groups for the machine.
     319 *  @param strOsType            OS Type string (stored as is if aOsType is NULL).
     320 *  @param aOsType              OS Type of this machine or NULL.
     321 *  @param aId                  UUID for the new machine.
     322 *  @param fForceOverwrite      Whether to overwrite an existing machine settings file.
     323 *  @param fDirectoryIncludesUUID
     324 *                              Whether the use a special VM directory naming scheme (includes the UUID).
     325 *  @param aCipher              The cipher to encrypt the VM with.
     326 *  @param aPasswordId          The password ID, empty if the VM should not be encrypted.
     327 *  @param aPassword            The password to encrypt the VM with.
    358328 *
    359  *  @return  Success indicator. if not S_OK, the machine object is invalid
     329 *  @return Success indicator. if not S_OK, the machine object is invalid.
    360330 */
    361331HRESULT Machine::init(VirtualBox *aParent,
    362332                      const Utf8Str &strConfigFile,
    363333                      const Utf8Str &strName,
     334                      PlatformArchitecture_T aArchitecture,
    364335                      const StringsList &llGroups,
    365336                      const Utf8Str &strOsType,
     
    492463            /* Store OS type */
    493464            mUserData->s.strOsType = aOsType->i_id();
    494 
    495             /* Let the OS type select 64-bit ness. */
    496             mHWData->mLongMode = aOsType->i_is64Bit()
    497                                ? settings::Hardware::LongMode_Enabled : settings::Hardware::LongMode_Disabled;
    498 
    499             /* Let the OS type enable the X2APIC */
    500             mHWData->mX2APIC = aOsType->i_recommendedX2APIC();
    501 
    502             hrc = aOsType->COMGETTER(RecommendedFirmware)(&mHWData->mFirmwareType);
    503             AssertComRC(hrc);
    504465        }
    505466        else if (!strOsType.isEmpty())
     
    507468            /* Store OS type */
    508469            mUserData->s.strOsType = strOsType;
    509 
    510             /* No guest OS type object. Pick some plausible defaults which the
    511              * host can handle. There's no way to know or validate anything. */
    512             mHWData->mLongMode = HC_ARCH_BITS == 64 ? settings::Hardware::LongMode_Enabled : settings::Hardware::LongMode_Disabled;
    513             mHWData->mX2APIC = false;
    514         }
    515 
    516         /* Apply BIOS defaults. */
    517         mBIOSSettings->i_applyDefaults(aOsType);
     470        }
     471
     472        /* Set the platform architecture first before applying the defaults below. */
     473        hrc = mPlatform->i_initArchitecture(aArchitecture);
     474        if (FAILED(hrc)) return hrc;
     475
     476        /* Apply platform defaults. */
     477        mPlatform->i_applyDefaults(aOsType);
     478        i_platformPropertiesUpdate();
     479
     480        /* Apply firmware defaults. */
     481        mFirmwareSettings->i_applyDefaults(aOsType);
    518482
    519483        /* Apply TPM defaults. */
     
    840804/**
    841805 * Shared code between the various init() implementations.
     806 *
     807 * @returns HRESULT
    842808 * @param   aParent         The VirtualBox object.
    843809 * @param   strConfigFile   Settings file.
    844  * @return
    845810 */
    846811HRESULT Machine::initImpl(VirtualBox *aParent,
     
    11831148}
    11841149
     1150HRESULT Machine::getPlatform(ComPtr<IPlatform> &aPlatform)
     1151{
     1152    /* mPlatform is constant during life time, no need to lock */
     1153    ComObjPtr<Platform> pPlatform(mPlatform);
     1154    aPlatform = pPlatform;
     1155
     1156    return S_OK;
     1157}
    11851158
    11861159HRESULT Machine::getAccessible(BOOL *aAccessible)
     
    13921365}
    13931366
    1394 HRESULT Machine::getFirmwareType(FirmwareType_T *aFirmwareType)
    1395 {
    1396     AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
    1397 
    1398     *aFirmwareType = mHWData->mFirmwareType;
    1399 
    1400     return S_OK;
    1401 }
    1402 
    1403 HRESULT Machine::setFirmwareType(FirmwareType_T aFirmwareType)
    1404 {
    1405     AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS);
    1406 
    1407     HRESULT hrc = i_checkStateDependency(MutableStateDep);
    1408     if (FAILED(hrc)) return hrc;
    1409 
    1410     i_setModified(IsModified_MachineData);
    1411     mHWData.backup();
    1412     mHWData->mFirmwareType = aFirmwareType;
    1413     Utf8Str strNVRAM = i_getDefaultNVRAMFilename();
    1414     alock.release();
    1415 
    1416     mNvramStore->i_updateNonVolatileStorageFile(strNVRAM);
    1417 
    1418     return S_OK;
    1419 }
    1420 
    14211367HRESULT Machine::getKeyboardHIDType(KeyboardHIDType_T *aKeyboardHIDType)
    14221368{
     
    14611407    mHWData.backup();
    14621408    mHWData->mPointingHIDType = aPointingHIDType;
    1463 
    1464     return S_OK;
    1465 }
    1466 
    1467 HRESULT Machine::getChipsetType(ChipsetType_T *aChipsetType)
    1468 {
    1469     AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
    1470 
    1471     *aChipsetType = mHWData->mChipsetType;
    1472 
    1473     return S_OK;
    1474 }
    1475 
    1476 HRESULT Machine::setChipsetType(ChipsetType_T aChipsetType)
    1477 {
    1478     AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS);
    1479 
    1480     HRESULT hrc = i_checkStateDependency(MutableStateDep);
    1481     if (FAILED(hrc)) return hrc;
    1482 
    1483     if (aChipsetType != mHWData->mChipsetType)
    1484     {
    1485         i_setModified(IsModified_MachineData);
    1486         mHWData.backup();
    1487         mHWData->mChipsetType = aChipsetType;
    1488 
    1489         // Resize network adapter array, to be finalized on commit/rollback.
    1490         // We must not throw away entries yet, otherwise settings are lost
    1491         // without a way to roll back.
    1492         size_t newCount = Global::getMaxNetworkAdapters(aChipsetType);
    1493         size_t oldCount = mNetworkAdapters.size();
    1494         if (newCount > oldCount)
    1495         {
    1496             mNetworkAdapters.resize(newCount);
    1497             for (size_t slot = oldCount; slot < mNetworkAdapters.size(); slot++)
    1498             {
    1499                 unconst(mNetworkAdapters[slot]).createObject();
    1500                 mNetworkAdapters[slot]->init(this, (ULONG)slot);
    1501             }
    1502         }
    1503     }
    1504 
    1505     return S_OK;
    1506 }
    1507 
    1508 HRESULT Machine::getIommuType(IommuType_T *aIommuType)
    1509 {
    1510     AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
    1511 
    1512     *aIommuType = mHWData->mIommuType;
    1513 
    1514     return S_OK;
    1515 }
    1516 
    1517 HRESULT Machine::setIommuType(IommuType_T aIommuType)
    1518 {
    1519     AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS);
    1520 
    1521     HRESULT hrc = i_checkStateDependency(MutableStateDep);
    1522     if (FAILED(hrc)) return hrc;
    1523 
    1524     if (aIommuType != mHWData->mIommuType)
    1525     {
    1526         if (aIommuType == IommuType_Intel)
    1527         {
    1528 #ifndef VBOX_WITH_IOMMU_INTEL
    1529             LogRelFunc(("Setting Intel IOMMU when Intel IOMMU support not available!\n"));
    1530             return E_UNEXPECTED;
    1531 #endif
    1532         }
    1533 
    1534         i_setModified(IsModified_MachineData);
    1535         mHWData.backup();
    1536         mHWData->mIommuType = aIommuType;
    1537     }
    15381409
    15391410    return S_OK;
     
    20001871}
    20011872
    2002 HRESULT Machine::getHPETEnabled(BOOL *aHPETEnabled)
    2003 {
    2004     AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
    2005 
    2006     *aHPETEnabled = mHWData->mHPETEnabled;
    2007 
    2008     return S_OK;
    2009 }
    2010 
    2011 HRESULT Machine::setHPETEnabled(BOOL aHPETEnabled)
    2012 {
    2013     AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS);
    2014 
    2015     HRESULT hrc = i_checkStateDependency(MutableStateDep);
    2016     if (FAILED(hrc)) return hrc;
    2017 
    2018     i_setModified(IsModified_MachineData);
    2019     mHWData.backup();
    2020 
    2021     mHWData->mHPETEnabled = aHPETEnabled;
    2022 
    2023     return hrc;
    2024 }
    2025 
    20261873/** @todo this method should not be public */
    20271874HRESULT Machine::getMemoryBalloonSize(ULONG *aMemoryBalloonSize)
     
    20931940}
    20941941
    2095 HRESULT Machine::getBIOSSettings(ComPtr<IBIOSSettings> &aBIOSSettings)
    2096 {
    2097     /* mBIOSSettings is constant during life time, no need to lock */
    2098     aBIOSSettings = mBIOSSettings;
     1942HRESULT Machine::getFirmwareSettings(ComPtr<IFirmwareSettings> &aFirmwareSettings)
     1943{
     1944    /* mFirmwareSettings is constant during life time, no need to lock */
     1945    aFirmwareSettings = mFirmwareSettings;
    20991946
    21001947    return S_OK;
     
    21311978
    21321979    aGraphicsAdapter = mGraphicsAdapter;
    2133 
    2134     return S_OK;
    2135 }
    2136 
    2137 HRESULT Machine::getCPUProperty(CPUPropertyType_T aProperty, BOOL *aValue)
    2138 {
    2139     AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
    2140 
    2141     switch (aProperty)
    2142     {
    2143         case CPUPropertyType_PAE:
    2144             *aValue = mHWData->mPAEEnabled;
    2145             break;
    2146 
    2147         case CPUPropertyType_LongMode:
    2148             if (mHWData->mLongMode == settings::Hardware::LongMode_Enabled)
    2149                 *aValue = TRUE;
    2150             else if (mHWData->mLongMode == settings::Hardware::LongMode_Disabled)
    2151                 *aValue = FALSE;
    2152 #if HC_ARCH_BITS == 64
    2153             else
    2154                 *aValue = TRUE;
    2155 #else
    2156             else
    2157             {
    2158                 *aValue = FALSE;
    2159 
    2160                 ComObjPtr<GuestOSType> pGuestOSType;
    2161                 HRESULT hrc2 = mParent->i_findGuestOSType(mUserData->s.strOsType,
    2162                                                           pGuestOSType);
    2163                 if (SUCCEEDED(hrc2) && !pGuestOSType.isNull())
    2164                 {
    2165                     if (pGuestOSType->i_is64Bit())
    2166                     {
    2167                         ComObjPtr<Host> pHost = mParent->i_host();
    2168                         alock.release();
    2169 
    2170                         hrc2 = pHost->GetProcessorFeature(ProcessorFeature_LongMode, aValue); AssertComRC(hrc2);
    2171                         if (FAILED(hrc2))
    2172                             *aValue = FALSE;
    2173                     }
    2174                 }
    2175             }
    2176 #endif
    2177             break;
    2178 
    2179         case CPUPropertyType_TripleFaultReset:
    2180             *aValue = mHWData->mTripleFaultReset;
    2181             break;
    2182 
    2183         case CPUPropertyType_APIC:
    2184             *aValue = mHWData->mAPIC;
    2185             break;
    2186 
    2187         case CPUPropertyType_X2APIC:
    2188             *aValue = mHWData->mX2APIC;
    2189             break;
    2190 
    2191         case CPUPropertyType_IBPBOnVMExit:
    2192             *aValue = mHWData->mIBPBOnVMExit;
    2193             break;
    2194 
    2195         case CPUPropertyType_IBPBOnVMEntry:
    2196             *aValue = mHWData->mIBPBOnVMEntry;
    2197             break;
    2198 
    2199         case CPUPropertyType_SpecCtrl:
    2200             *aValue = mHWData->mSpecCtrl;
    2201             break;
    2202 
    2203         case CPUPropertyType_SpecCtrlByHost:
    2204             *aValue = mHWData->mSpecCtrlByHost;
    2205             break;
    2206 
    2207         case CPUPropertyType_HWVirt:
    2208             *aValue = mHWData->mNestedHWVirt;
    2209             break;
    2210 
    2211         case CPUPropertyType_L1DFlushOnEMTScheduling:
    2212             *aValue = mHWData->mL1DFlushOnSched;
    2213             break;
    2214 
    2215         case CPUPropertyType_L1DFlushOnVMEntry:
    2216             *aValue = mHWData->mL1DFlushOnVMEntry;
    2217             break;
    2218 
    2219         case CPUPropertyType_MDSClearOnEMTScheduling:
    2220             *aValue = mHWData->mMDSClearOnSched;
    2221             break;
    2222 
    2223         case CPUPropertyType_MDSClearOnVMEntry:
    2224             *aValue = mHWData->mMDSClearOnVMEntry;
    2225             break;
    2226 
    2227         default:
    2228             return E_INVALIDARG;
    2229     }
    2230     return S_OK;
    2231 }
    2232 
    2233 HRESULT Machine::setCPUProperty(CPUPropertyType_T aProperty, BOOL aValue)
    2234 {
    2235     AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS);
    2236 
    2237     HRESULT hrc = i_checkStateDependency(MutableStateDep);
    2238     if (FAILED(hrc)) return hrc;
    2239 
    2240     switch (aProperty)
    2241     {
    2242         case CPUPropertyType_PAE:
    2243             i_setModified(IsModified_MachineData);
    2244             mHWData.backup();
    2245             mHWData->mPAEEnabled = !!aValue;
    2246             break;
    2247 
    2248         case CPUPropertyType_LongMode:
    2249             i_setModified(IsModified_MachineData);
    2250             mHWData.backup();
    2251             mHWData->mLongMode = !aValue ? settings::Hardware::LongMode_Disabled : settings::Hardware::LongMode_Enabled;
    2252             break;
    2253 
    2254         case CPUPropertyType_TripleFaultReset:
    2255             i_setModified(IsModified_MachineData);
    2256             mHWData.backup();
    2257             mHWData->mTripleFaultReset = !!aValue;
    2258             break;
    2259 
    2260         case CPUPropertyType_APIC:
    2261             if (mHWData->mX2APIC)
    2262                 aValue = TRUE;
    2263             i_setModified(IsModified_MachineData);
    2264             mHWData.backup();
    2265             mHWData->mAPIC = !!aValue;
    2266             break;
    2267 
    2268         case CPUPropertyType_X2APIC:
    2269             i_setModified(IsModified_MachineData);
    2270             mHWData.backup();
    2271             mHWData->mX2APIC = !!aValue;
    2272             if (aValue)
    2273                 mHWData->mAPIC = !!aValue;
    2274             break;
    2275 
    2276         case CPUPropertyType_IBPBOnVMExit:
    2277             i_setModified(IsModified_MachineData);
    2278             mHWData.backup();
    2279             mHWData->mIBPBOnVMExit = !!aValue;
    2280             break;
    2281 
    2282         case CPUPropertyType_IBPBOnVMEntry:
    2283             i_setModified(IsModified_MachineData);
    2284             mHWData.backup();
    2285             mHWData->mIBPBOnVMEntry = !!aValue;
    2286             break;
    2287 
    2288         case CPUPropertyType_SpecCtrl:
    2289             i_setModified(IsModified_MachineData);
    2290             mHWData.backup();
    2291             mHWData->mSpecCtrl = !!aValue;
    2292             break;
    2293 
    2294         case CPUPropertyType_SpecCtrlByHost:
    2295             i_setModified(IsModified_MachineData);
    2296             mHWData.backup();
    2297             mHWData->mSpecCtrlByHost = !!aValue;
    2298             break;
    2299 
    2300         case CPUPropertyType_HWVirt:
    2301             i_setModified(IsModified_MachineData);
    2302             mHWData.backup();
    2303             mHWData->mNestedHWVirt = !!aValue;
    2304             break;
    2305 
    2306         case CPUPropertyType_L1DFlushOnEMTScheduling:
    2307             i_setModified(IsModified_MachineData);
    2308             mHWData.backup();
    2309             mHWData->mL1DFlushOnSched = !!aValue;
    2310             break;
    2311 
    2312         case CPUPropertyType_L1DFlushOnVMEntry:
    2313             i_setModified(IsModified_MachineData);
    2314             mHWData.backup();
    2315             mHWData->mL1DFlushOnVMEntry = !!aValue;
    2316             break;
    2317 
    2318         case CPUPropertyType_MDSClearOnEMTScheduling:
    2319             i_setModified(IsModified_MachineData);
    2320             mHWData.backup();
    2321             mHWData->mMDSClearOnSched = !!aValue;
    2322             break;
    2323 
    2324         case CPUPropertyType_MDSClearOnVMEntry:
    2325             i_setModified(IsModified_MachineData);
    2326             mHWData.backup();
    2327             mHWData->mMDSClearOnVMEntry = !!aValue;
    2328             break;
    2329 
    2330         default:
    2331             return E_INVALIDARG;
    2332     }
    2333     return S_OK;
    2334 }
    2335 
    2336 HRESULT Machine::getCPUIDLeafByOrdinal(ULONG aOrdinal, ULONG *aIdx, ULONG *aSubIdx, ULONG *aValEax, ULONG *aValEbx,
    2337                                        ULONG *aValEcx, ULONG *aValEdx)
    2338 {
    2339     AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
    2340     if (aOrdinal < mHWData->mCpuIdLeafList.size())
    2341     {
    2342         for (settings::CpuIdLeafsList::const_iterator it = mHWData->mCpuIdLeafList.begin();
    2343              it != mHWData->mCpuIdLeafList.end();
    2344              ++it)
    2345         {
    2346             if (aOrdinal == 0)
    2347             {
    2348                 const settings::CpuIdLeaf &rLeaf= *it;
    2349                 *aIdx    = rLeaf.idx;
    2350                 *aSubIdx = rLeaf.idxSub;
    2351                 *aValEax = rLeaf.uEax;
    2352                 *aValEbx = rLeaf.uEbx;
    2353                 *aValEcx = rLeaf.uEcx;
    2354                 *aValEdx = rLeaf.uEdx;
    2355                 return S_OK;
    2356             }
    2357             aOrdinal--;
    2358         }
    2359     }
    2360     return E_INVALIDARG;
    2361 }
    2362 
    2363 HRESULT Machine::getCPUIDLeaf(ULONG aIdx, ULONG aSubIdx, ULONG *aValEax, ULONG *aValEbx, ULONG *aValEcx, ULONG *aValEdx)
    2364 {
    2365     AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
    2366 
    2367     /*
    2368      * Search the list.
    2369      */
    2370     for (settings::CpuIdLeafsList::const_iterator it = mHWData->mCpuIdLeafList.begin(); it != mHWData->mCpuIdLeafList.end(); ++it)
    2371     {
    2372         const settings::CpuIdLeaf &rLeaf= *it;
    2373         if (   rLeaf.idx == aIdx
    2374             && (   aSubIdx == UINT32_MAX
    2375                 || rLeaf.idxSub == aSubIdx) )
    2376         {
    2377             *aValEax = rLeaf.uEax;
    2378             *aValEbx = rLeaf.uEbx;
    2379             *aValEcx = rLeaf.uEcx;
    2380             *aValEdx = rLeaf.uEdx;
    2381             return S_OK;
    2382         }
    2383     }
    2384 
    2385     return E_INVALIDARG;
    2386 }
    2387 
    2388 
    2389 HRESULT Machine::setCPUIDLeaf(ULONG aIdx, ULONG aSubIdx, ULONG aValEax, ULONG aValEbx, ULONG aValEcx, ULONG aValEdx)
    2390 {
    2391     /*
    2392      * Validate input before taking locks and checking state.
    2393      */
    2394     if (aSubIdx != 0 && aSubIdx != UINT32_MAX)
    2395         return setError(E_INVALIDARG, tr("Currently only aSubIdx values 0 and 0xffffffff are supported: %#x"), aSubIdx);
    2396     if (   aIdx >= UINT32_C(0x20)
    2397         && aIdx - UINT32_C(0x80000000) >= UINT32_C(0x20)
    2398         && aIdx - UINT32_C(0xc0000000) >= UINT32_C(0x10) )
    2399         return setError(E_INVALIDARG, tr("CpuId override leaf %#x is out of range"), aIdx);
    2400 
    2401     AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS);
    2402     HRESULT hrc = i_checkStateDependency(MutableStateDep);
    2403     if (FAILED(hrc)) return hrc;
    2404 
    2405     /*
    2406      * Impose a maximum number of leaves.
    2407      */
    2408     if (mHWData->mCpuIdLeafList.size() > 256)
    2409         return setError(E_FAIL, tr("Max of 256 CPUID override leaves reached"));
    2410 
    2411     /*
    2412      * Updating the list is a bit more complicated.  So, let's do a remove first followed by an insert.
    2413      */
    2414     i_setModified(IsModified_MachineData);
    2415     mHWData.backup();
    2416 
    2417     for (settings::CpuIdLeafsList::iterator it = mHWData->mCpuIdLeafList.begin(); it != mHWData->mCpuIdLeafList.end(); )
    2418     {
    2419         settings::CpuIdLeaf &rLeaf= *it;
    2420         if (   rLeaf.idx == aIdx
    2421             && (   aSubIdx == UINT32_MAX
    2422                 || rLeaf.idxSub == aSubIdx) )
    2423             it = mHWData->mCpuIdLeafList.erase(it);
    2424         else
    2425             ++it;
    2426     }
    2427 
    2428     settings::CpuIdLeaf NewLeaf;
    2429     NewLeaf.idx    = aIdx;
    2430     NewLeaf.idxSub = aSubIdx == UINT32_MAX ? 0 : aSubIdx;
    2431     NewLeaf.uEax   = aValEax;
    2432     NewLeaf.uEbx   = aValEbx;
    2433     NewLeaf.uEcx   = aValEcx;
    2434     NewLeaf.uEdx   = aValEdx;
    2435     mHWData->mCpuIdLeafList.push_back(NewLeaf);
    2436     return S_OK;
    2437 }
    2438 
    2439 HRESULT Machine::removeCPUIDLeaf(ULONG aIdx, ULONG aSubIdx)
    2440 {
    2441     AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS);
    2442 
    2443     HRESULT hrc = i_checkStateDependency(MutableStateDep);
    2444     if (FAILED(hrc)) return hrc;
    2445 
    2446     /*
    2447      * Do the removal.
    2448      */
    2449     bool fModified = mHWData.isBackedUp();
    2450     for (settings::CpuIdLeafsList::iterator it = mHWData->mCpuIdLeafList.begin(); it != mHWData->mCpuIdLeafList.end(); )
    2451     {
    2452         settings::CpuIdLeaf &rLeaf= *it;
    2453         if (   rLeaf.idx == aIdx
    2454             && (   aSubIdx == UINT32_MAX
    2455                 || rLeaf.idxSub == aSubIdx) )
    2456         {
    2457             if (!fModified)
    2458             {
    2459                 fModified = true;
    2460                 i_setModified(IsModified_MachineData);
    2461                 mHWData.backup();
    2462                 // Start from the beginning, since mHWData.backup() creates
    2463                 // a new list, causing iterator mixup. This makes sure that
    2464                 // the settings are not unnecessarily marked as modified,
    2465                 // at the price of extra list walking.
    2466                 it = mHWData->mCpuIdLeafList.begin();
    2467             }
    2468             else
    2469                 it = mHWData->mCpuIdLeafList.erase(it);
    2470         }
    2471         else
    2472             ++it;
    2473     }
    2474 
    2475     return S_OK;
    2476 }
    2477 
    2478 HRESULT Machine::removeAllCPUIDLeaves()
    2479 {
    2480     AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS);
    2481 
    2482     HRESULT hrc = i_checkStateDependency(MutableStateDep);
    2483     if (FAILED(hrc)) return hrc;
    2484 
    2485     if (mHWData->mCpuIdLeafList.size() > 0)
    2486     {
    2487         i_setModified(IsModified_MachineData);
    2488         mHWData.backup();
    2489 
    2490         mHWData->mCpuIdLeafList.clear();
    2491     }
    2492 
    2493     return S_OK;
    2494 }
    2495 HRESULT Machine::getHWVirtExProperty(HWVirtExPropertyType_T aProperty, BOOL *aValue)
    2496 {
    2497     AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
    2498 
    2499     switch(aProperty)
    2500     {
    2501         case HWVirtExPropertyType_Enabled:
    2502             *aValue = mHWData->mHWVirtExEnabled;
    2503             break;
    2504 
    2505         case HWVirtExPropertyType_VPID:
    2506             *aValue = mHWData->mHWVirtExVPIDEnabled;
    2507             break;
    2508 
    2509         case HWVirtExPropertyType_NestedPaging:
    2510             *aValue = mHWData->mHWVirtExNestedPagingEnabled;
    2511             break;
    2512 
    2513         case HWVirtExPropertyType_UnrestrictedExecution:
    2514             *aValue = mHWData->mHWVirtExUXEnabled;
    2515             break;
    2516 
    2517         case HWVirtExPropertyType_LargePages:
    2518             *aValue = mHWData->mHWVirtExLargePagesEnabled;
    2519             break;
    2520 
    2521         case HWVirtExPropertyType_Force:
    2522             *aValue = mHWData->mHWVirtExForceEnabled;
    2523             break;
    2524 
    2525         case HWVirtExPropertyType_UseNativeApi:
    2526             *aValue = mHWData->mHWVirtExUseNativeApi;
    2527             break;
    2528 
    2529         case HWVirtExPropertyType_VirtVmsaveVmload:
    2530             *aValue = mHWData->mHWVirtExVirtVmsaveVmload;
    2531             break;
    2532 
    2533         default:
    2534             return E_INVALIDARG;
    2535     }
    2536     return S_OK;
    2537 }
    2538 
    2539 HRESULT Machine::setHWVirtExProperty(HWVirtExPropertyType_T aProperty, BOOL aValue)
    2540 {
    2541     AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS);
    2542 
    2543     HRESULT hrc = i_checkStateDependency(MutableStateDep);
    2544     if (FAILED(hrc)) return hrc;
    2545 
    2546     switch (aProperty)
    2547     {
    2548         case HWVirtExPropertyType_Enabled:
    2549             i_setModified(IsModified_MachineData);
    2550             mHWData.backup();
    2551             mHWData->mHWVirtExEnabled = !!aValue;
    2552             break;
    2553 
    2554         case HWVirtExPropertyType_VPID:
    2555             i_setModified(IsModified_MachineData);
    2556             mHWData.backup();
    2557             mHWData->mHWVirtExVPIDEnabled = !!aValue;
    2558             break;
    2559 
    2560         case HWVirtExPropertyType_NestedPaging:
    2561             i_setModified(IsModified_MachineData);
    2562             mHWData.backup();
    2563             mHWData->mHWVirtExNestedPagingEnabled = !!aValue;
    2564             break;
    2565 
    2566         case HWVirtExPropertyType_UnrestrictedExecution:
    2567             i_setModified(IsModified_MachineData);
    2568             mHWData.backup();
    2569             mHWData->mHWVirtExUXEnabled = !!aValue;
    2570             break;
    2571 
    2572         case HWVirtExPropertyType_LargePages:
    2573             i_setModified(IsModified_MachineData);
    2574             mHWData.backup();
    2575             mHWData->mHWVirtExLargePagesEnabled = !!aValue;
    2576             break;
    2577 
    2578         case HWVirtExPropertyType_Force:
    2579             i_setModified(IsModified_MachineData);
    2580             mHWData.backup();
    2581             mHWData->mHWVirtExForceEnabled = !!aValue;
    2582             break;
    2583 
    2584         case HWVirtExPropertyType_UseNativeApi:
    2585             i_setModified(IsModified_MachineData);
    2586             mHWData.backup();
    2587             mHWData->mHWVirtExUseNativeApi = !!aValue;
    2588             break;
    2589 
    2590         case HWVirtExPropertyType_VirtVmsaveVmload:
    2591             i_setModified(IsModified_MachineData);
    2592             mHWData.backup();
    2593             mHWData->mHWVirtExVirtVmsaveVmload = !!aValue;
    2594             break;
    2595 
    2596         default:
    2597             return E_INVALIDARG;
    2598     }
    25991980
    26001981    return S_OK;
     
    31152496
    31162497    return hrc;
    3117 }
    3118 
    3119 HRESULT Machine::getRTCUseUTC(BOOL *aRTCUseUTC)
    3120 {
    3121     AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
    3122 
    3123     *aRTCUseUTC = mUserData->s.fRTCUseUTC;
    3124 
    3125     return S_OK;
    3126 }
    3127 
    3128 HRESULT Machine::setRTCUseUTC(BOOL aRTCUseUTC)
    3129 {
    3130     AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS);
    3131 
    3132     /* Only allow it to be set to true when PoweredOff or Aborted.
    3133        (Clearing it is always permitted.) */
    3134     if (    aRTCUseUTC
    3135         &&  mData->mRegistered
    3136         &&  (   !i_isSessionMachine()
    3137              || (   mData->mMachineState != MachineState_PoweredOff
    3138                  && mData->mMachineState != MachineState_Teleported
    3139                  && mData->mMachineState != MachineState_Aborted
    3140                 )
    3141             )
    3142        )
    3143         return setError(VBOX_E_INVALID_VM_STATE,
    3144                         tr("The machine is not powered off (state is %s)"),
    3145                         Global::stringifyMachineState(mData->mMachineState));
    3146 
    3147     i_setModified(IsModified_MachineData);
    3148     mUserData.backup();
    3149     mUserData->s.fRTCUseUTC = !!aRTCUseUTC;
    3150 
    3151     return S_OK;
    31522498}
    31532499
     
    64455791
    64465792    /* Check that we don't exceed the maximum number of USB controllers for the given type. */
     5793    ChipsetType_T enmChipsetType;
     5794    hrc = mPlatform->getChipsetType(&enmChipsetType);
     5795    if (FAILED(hrc))
     5796        return hrc;
     5797
    64475798    ULONG maxInstances;
    6448     hrc = mParent->i_getSystemProperties()->GetMaxInstancesOfUSBControllerType(mHWData->mChipsetType, aType, &maxInstances);
     5799    hrc = mPlatformProperties->GetMaxInstancesOfUSBControllerType(enmChipsetType, aType, &maxInstances);
    64495800    if (FAILED(hrc))
    64505801        return hrc;
     
    69556306        if (FAILED(hrc)) return hrc;
    69566307
    6957         ChipsetType_T aChipset = ChipsetType_PIIX3;
    6958         COMGETTER(ChipsetType)(&aChipset);
    6959 
    6960         if (aChipset != ChipsetType_ICH9)
     6308        ChipsetType_T aChipset = ChipsetType_PIIX3; /*** @todo BUGBUG ASSUMES x86! */
     6309        hrc = mPlatform->COMGETTER(ChipsetType)(&aChipset);
     6310        if (FAILED(hrc)) return hrc;
     6311
     6312        if (aChipset != ChipsetType_ICH9) /*** @todo BUGBUG ASSUMES x86! */
    69616313        {
    69626314            return setError(E_INVALIDARG,
     
    84467798
    84477799    return strResult;
     7800}
     7801
     7802FirmwareType_T Machine::i_getFirmwareType() const
     7803{
     7804    return mFirmwareSettings->i_getFirmwareType();
    84487805}
    84497806
     
    85967953    mUSBControllers.allocate();
    85977954
     7955    /* create the platform + platform properties objects for this machine */
     7956    HRESULT hrc = unconst(mPlatform).createObject();
     7957    ComAssertComRCRetRC(hrc);
     7958    hrc = mPlatform->init(this);
     7959    ComAssertComRCRetRC(hrc);
     7960    hrc = unconst(mPlatformProperties).createObject();
     7961    ComAssertComRCRetRC(hrc);
     7962    hrc = mPlatformProperties->init(mParent);
     7963    ComAssertComRCRetRC(hrc);
     7964
    85987965    /* initialize mOSTypeId */
    85997966    mUserData->s.strOsType = mParent->i_getUnknownOSType()->i_id();
    86007967
    8601 /** @todo r=bird: init() methods never fails, right? Why don't we make them
    8602  *        return void then! */
    8603 
    8604     /* create associated BIOS settings object */
    8605     unconst(mBIOSSettings).createObject();
    8606     mBIOSSettings->init(this);
     7968    /* create associated firmware settings object */
     7969    unconst(mFirmwareSettings).createObject();
     7970    mFirmwareSettings->init(this);
    86077971
    86087972    /* create associated recording settings object */
     
    86498013
    86508014    /* create associated network adapter objects */
    8651     mNetworkAdapters.resize(Global::getMaxNetworkAdapters(mHWData->mChipsetType));
     8015    ChipsetType_T enmChipsetType;
     8016    hrc = mPlatform->getChipsetType(&enmChipsetType);
     8017    ComAssertComRC(hrc);
     8018
     8019    mNetworkAdapters.resize(PlatformProperties::s_getMaxNetworkAdapters(enmChipsetType));
    86528020    for (ULONG slot = 0; slot < mNetworkAdapters.size(); ++slot)
    86538021    {
     
    86648032    mGuestDebugControl->init(this);
    86658033
    8666     return S_OK;
     8034    return hrc;
    86678035}
    86688036
     
    87498117    }
    87508118
    8751     if (mBIOSSettings)
    8752     {
    8753         mBIOSSettings->uninit();
    8754         unconst(mBIOSSettings).setNull();
     8119    if (mPlatform)
     8120    {
     8121        mPlatform->uninit();
     8122        unconst(mPlatform).setNull();
     8123    }
     8124
     8125    if (mPlatformProperties)
     8126    {
     8127        mPlatformProperties->uninit();
     8128        unconst(mPlatformProperties).setNull();
     8129    }
     8130
     8131    if (mFirmwareSettings)
     8132    {
     8133        mFirmwareSettings->uninit();
     8134        unconst(mFirmwareSettings).setNull();
    87558135    }
    87568136
     
    92228602        mHWData->mHardwareUUID = data.uuid;
    92238603
    9224         mHWData->mHWVirtExEnabled             = data.fHardwareVirt;
    9225         mHWData->mHWVirtExNestedPagingEnabled = data.fNestedPaging;
    9226         mHWData->mHWVirtExLargePagesEnabled   = data.fLargePages;
    9227         mHWData->mHWVirtExVPIDEnabled         = data.fVPID;
    9228         mHWData->mHWVirtExUXEnabled           = data.fUnrestrictedExecution;
    9229         mHWData->mHWVirtExForceEnabled        = data.fHardwareVirtForce;
    9230         mHWData->mHWVirtExUseNativeApi        = data.fUseNativeApi;
    9231         mHWData->mHWVirtExVirtVmsaveVmload    = data.fVirtVmsaveVmload;
    9232         mHWData->mPAEEnabled                  = data.fPAE;
    9233         mHWData->mLongMode                    = data.enmLongMode;
    9234         mHWData->mTripleFaultReset            = data.fTripleFaultReset;
    9235         mHWData->mAPIC                        = data.fAPIC;
    9236         mHWData->mX2APIC                      = data.fX2APIC;
    9237         mHWData->mIBPBOnVMExit                = data.fIBPBOnVMExit;
    9238         mHWData->mIBPBOnVMEntry               = data.fIBPBOnVMEntry;
    9239         mHWData->mSpecCtrl                    = data.fSpecCtrl;
    9240         mHWData->mSpecCtrlByHost              = data.fSpecCtrlByHost;
    9241         mHWData->mL1DFlushOnSched             = data.fL1DFlushOnSched;
    9242         mHWData->mL1DFlushOnVMEntry           = data.fL1DFlushOnVMEntry;
    9243         mHWData->mMDSClearOnSched             = data.fMDSClearOnSched;
    9244         mHWData->mMDSClearOnVMEntry           = data.fMDSClearOnVMEntry;
    9245         mHWData->mNestedHWVirt                = data.fNestedHWVirt;
    92468604        mHWData->mCPUCount                    = data.cCPUs;
    92478605        mHWData->mCPUHotPlugEnabled           = data.fCpuHotPlug;
     
    92648622        }
    92658623
    9266         // cpuid leafs
    9267         for (settings::CpuIdLeafsList::const_iterator
    9268              it = data.llCpuIdLeafs.begin();
    9269              it != data.llCpuIdLeafs.end();
    9270              ++it)
    9271         {
    9272             const settings::CpuIdLeaf &rLeaf= *it;
    9273             if (   rLeaf.idx < UINT32_C(0x20)
    9274                 || rLeaf.idx - UINT32_C(0x80000000) < UINT32_C(0x20)
    9275                 || rLeaf.idx - UINT32_C(0xc0000000) < UINT32_C(0x10) )
    9276                 mHWData->mCpuIdLeafList.push_back(rLeaf);
    9277             /* else: just ignore */
    9278         }
    9279 
    92808624        mHWData->mMemorySize = data.ulMemorySizeMB;
    92818625        mHWData->mPageFusionEnabled = data.fPageFusionEnabled;
     
    92918635        }
    92928636
    9293         mHWData->mFirmwareType = data.firmwareType;
    92948637        mHWData->mPointingHIDType = data.pointingHIDType;
    92958638        mHWData->mKeyboardHIDType = data.keyboardHIDType;
    9296         mHWData->mChipsetType = data.chipsetType;
    9297         mHWData->mIommuType = data.iommuType;
    92988639        mHWData->mParavirtProvider = data.paravirtProvider;
    92998640        mHWData->mParavirtDebug = data.strParavirtDebug;
    93008641        mHWData->mEmulatedUSBCardReaderEnabled = data.fEmulatedUSBCardReader;
    9301         mHWData->mHPETEnabled = data.fHPETEnabled;
    93028642
    93038643        /* GraphicsAdapter */
     
    93098649        if (FAILED(hrc)) return hrc;
    93108650
    9311         /* BIOS */
    9312         hrc = mBIOSSettings->i_loadSettings(data.biosSettings);
     8651        /* Platform */
     8652        hrc = mPlatform->i_loadSettings(data.platformSettings);
     8653        if (FAILED(hrc)) return hrc;
     8654
     8655        i_platformPropertiesUpdate();
     8656
     8657        /* Firmware */
     8658        hrc = mFirmwareSettings->i_loadSettings(data.firmwareSettings);
    93138659        if (FAILED(hrc)) return hrc;
    93148660
     
    93498695        // ensure reading the same settings as we saved, since the list skips
    93508696        // adapters having defaults)
    9351         size_t newCount = Global::getMaxNetworkAdapters(mHWData->mChipsetType);
    9352         size_t oldCount = mNetworkAdapters.size();
     8697        size_t const newCount = PlatformProperties::s_getMaxNetworkAdapters(data.platformSettings.chipsetType);
     8698        size_t const oldCount = mNetworkAdapters.size();
    93538699        if (newCount > oldCount)
    93548700        {
     
    106529998
    106539999        // CPU
    10654         data.fHardwareVirt          = !!mHWData->mHWVirtExEnabled;
    10655         data.fNestedPaging          = !!mHWData->mHWVirtExNestedPagingEnabled;
    10656         data.fLargePages            = !!mHWData->mHWVirtExLargePagesEnabled;
    10657         data.fVPID                  = !!mHWData->mHWVirtExVPIDEnabled;
    10658         data.fUnrestrictedExecution = !!mHWData->mHWVirtExUXEnabled;
    10659         data.fHardwareVirtForce     = !!mHWData->mHWVirtExForceEnabled;
    10660         data.fUseNativeApi          = !!mHWData->mHWVirtExUseNativeApi;
    10661         data.fVirtVmsaveVmload      = !!mHWData->mHWVirtExVirtVmsaveVmload;
    10662         data.fPAE                   = !!mHWData->mPAEEnabled;
    10663         data.enmLongMode            = mHWData->mLongMode;
    10664         data.fTripleFaultReset      = !!mHWData->mTripleFaultReset;
    10665         data.fAPIC                  = !!mHWData->mAPIC;
    10666         data.fX2APIC                = !!mHWData->mX2APIC;
    10667         data.fIBPBOnVMExit          = !!mHWData->mIBPBOnVMExit;
    10668         data.fIBPBOnVMEntry         = !!mHWData->mIBPBOnVMEntry;
    10669         data.fSpecCtrl              = !!mHWData->mSpecCtrl;
    10670         data.fSpecCtrlByHost        = !!mHWData->mSpecCtrlByHost;
    10671         data.fL1DFlushOnSched       = !!mHWData->mL1DFlushOnSched;
    10672         data.fL1DFlushOnVMEntry     = !!mHWData->mL1DFlushOnVMEntry;
    10673         data.fMDSClearOnSched       = !!mHWData->mMDSClearOnSched;
    10674         data.fMDSClearOnVMEntry     = !!mHWData->mMDSClearOnVMEntry;
    10675         data.fNestedHWVirt          = !!mHWData->mNestedHWVirt;
    1067610000        data.cCPUs                  = mHWData->mCPUCount;
    1067710001        data.fCpuHotPlug            = !!mHWData->mCPUHotPlugEnabled;
     
    1069410018        }
    1069510019
    10696         /* Standard and Extended CPUID leafs. */
    10697         data.llCpuIdLeafs.clear();
    10698         data.llCpuIdLeafs = mHWData->mCpuIdLeafList;
    10699 
    1070010020        // memory
    1070110021        data.ulMemorySizeMB = mHWData->mMemorySize;
    1070210022        data.fPageFusionEnabled = !!mHWData->mPageFusionEnabled;
    1070310023
    10704         // firmware
    10705         data.firmwareType = mHWData->mFirmwareType;
    10706 
    1070710024        // HID
    1070810025        data.pointingHIDType = mHWData->mPointingHIDType;
    1070910026        data.keyboardHIDType = mHWData->mKeyboardHIDType;
    1071010027
    10711         // chipset
    10712         data.chipsetType = mHWData->mChipsetType;
    10713 
    10714         // iommu
    10715         data.iommuType = mHWData->mIommuType;
    10716 
    1071710028        // paravirt
    1071810029        data.paravirtProvider = mHWData->mParavirtProvider;
     
    1072110032        // emulated USB card reader
    1072210033        data.fEmulatedUSBCardReader = !!mHWData->mEmulatedUSBCardReaderEnabled;
    10723 
    10724         // HPET
    10725         data.fHPETEnabled = !!mHWData->mHPETEnabled;
    1072610034
    1072710035        // boot order
     
    1073410042        if (FAILED(hrc)) throw hrc;
    1073510043
    10736         /* BIOS settings (required) */
    10737         hrc = mBIOSSettings->i_saveSettings(data.biosSettings);
     10044        /* Platform (required) */
     10045        hrc = mPlatform->i_saveSettings(data.platformSettings);
     10046        if (FAILED(hrc)) return hrc;
     10047
     10048        /* Firmware settings (required) */
     10049        hrc = mFirmwareSettings->i_saveSettings(data.firmwareSettings);
    1073810050        if (FAILED(hrc)) throw hrc;
    1073910051
     
    1077510087
    1077610088        /* Network adapters (required) */
    10777         size_t uMaxNICs = RT_MIN(Global::getMaxNetworkAdapters(mHWData->mChipsetType), mNetworkAdapters.size());
     10089        size_t const uMaxNICs =
     10090            RT_MIN(PlatformProperties::s_getMaxNetworkAdapters(data.platformSettings.chipsetType), mNetworkAdapters.size());
    1077810091        data.llNetworkAdapters.clear();
    1077910092        /* Write out only the nominal number of network adapters for this
     
    1231611629        i_rollbackMedia();
    1231711630
    12318     if (mBIOSSettings)
    12319         mBIOSSettings->i_rollback();
     11631    if (mPlatform)
     11632    {
     11633        mPlatform->i_rollback();
     11634        i_platformPropertiesUpdate();
     11635    }
     11636
     11637    if (mFirmwareSettings)
     11638        mFirmwareSettings->i_rollback();
    1232011639
    1232111640    if (mRecordingSettings && (mData->flModifications & IsModified_Recording))
     
    1234611665        mGuestDebugControl->i_rollback();
    1234711666
    12348     if (!mHWData.isNull())
    12349         mNetworkAdapters.resize(Global::getMaxNetworkAdapters(mHWData->mChipsetType));
     11667    if (mPlatform && (mData->flModifications & IsModified_Platform))
     11668    {
     11669        ChipsetType_T enmChipset;
     11670        HRESULT hrc = mPlatform->getChipsetType(&enmChipset);
     11671        ComAssertComRC(hrc);
     11672
     11673        mNetworkAdapters.resize(PlatformProperties::s_getMaxNetworkAdapters(enmChipset));
     11674    }
     11675
    1235011676    NetworkAdapterVector networkAdapters(mNetworkAdapters.size());
    1235111677    ComPtr<ISerialPort> serialPorts[RT_ELEMENTS(mSerialPorts)];
     
    1245411780        i_commitMedia(Global::IsOnline(mData->mMachineState));
    1245511781
    12456     mBIOSSettings->i_commit();
     11782    mPlatform->i_commit();
     11783    mFirmwareSettings->i_commit();
    1245711784    mRecordingSettings->i_commit();
    1245811785    mTrustedPlatformModule->i_commit();
     
    1246911796     * of the list entries manually, including the creation of peers for the
    1247011797     * new objects. */
     11798    ChipsetType_T enmChipset;
     11799    HRESULT hrc = mPlatform->getChipsetType(&enmChipset);
     11800    ComAssertComRC(hrc);
     11801
    1247111802    bool commitNetworkAdapters = false;
    12472     size_t newSize = Global::getMaxNetworkAdapters(mHWData->mChipsetType);
     11803    size_t const newSize = PlatformProperties::s_getMaxNetworkAdapters(enmChipset);
    1247311804    if (mPeer)
    1247411805    {
     
    1271112042    }
    1271212043
    12713     mBIOSSettings->i_copyFrom(aThat->mBIOSSettings);
     12044    mPlatform->i_copyFrom(aThat->mPlatform);
     12045    i_platformPropertiesUpdate();
     12046    mFirmwareSettings->i_copyFrom(aThat->mFirmwareSettings);
    1271412047    mRecordingSettings->i_copyFrom(aThat->mRecordingSettings);
    1271512048    mTrustedPlatformModule->i_copyFrom(aThat->mTrustedPlatformModule);
     
    1277612109bool Machine::i_isControllerHotplugCapable(StorageControllerType_T enmCtrlType)
    1277712110{
    12778     ComPtr<ISystemProperties> systemProperties;
    12779     HRESULT hrc = mParent->COMGETTER(SystemProperties)(systemProperties.asOutParam());
    12780     if (FAILED(hrc))
    12781         return false;
    12782 
    1278312111    BOOL aHotplugCapable = FALSE;
    12784     systemProperties->GetStorageControllerHotplugCapable(enmCtrlType, &aHotplugCapable);
     12112    HRESULT hrc = mPlatformProperties->GetStorageControllerHotplugCapable(enmCtrlType, &aHotplugCapable);
     12113    AssertComRC(hrc);
    1278512114
    1278612115    return RT_BOOL(aHotplugCapable);
     
    1298212311#endif /* VBOX_WITH_RESOURCE_USAGE_API */
    1298312312
     12313/**
     12314 * Updates the machine's platform properties based on the current platform architecture.
     12315 *
     12316 * @note    Called internally when committing, rolling back or loading settings.
     12317 */
     12318void Machine::i_platformPropertiesUpdate()
     12319{
     12320    if (mPlatform)
     12321    {
     12322        /* Update architecture for platform properties. */
     12323        PlatformArchitecture_T platformArchitecture;
     12324        HRESULT hrc = mPlatform->getArchitecture(&platformArchitecture);
     12325        ComAssertComRC(hrc);
     12326        hrc = mPlatformProperties->i_setArchitecture(platformArchitecture);
     12327        ComAssertComRC(hrc);
     12328    }
     12329}
     12330
    1298412331
    1298512332////////////////////////////////////////////////////////////////////////////////
     
    1308812435    }
    1308912436
    13090     unconst(mBIOSSettings).createObject();
    13091     mBIOSSettings->init(this, aMachine->mBIOSSettings);
     12437    unconst(mPlatformProperties).createObject();
     12438    mPlatformProperties->init(mParent);
     12439    unconst(mPlatform).createObject();
     12440    mPlatform->init(this, aMachine->mPlatform);
     12441
     12442    i_platformPropertiesUpdate();
     12443
     12444    unconst(mFirmwareSettings).createObject();
     12445    mFirmwareSettings->init(this, aMachine->mFirmwareSettings);
    1309212446
    1309312447    unconst(mRecordingSettings).createObject();
     
    1580815162    AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS);
    1580915163
    15810     /* Let the OS type select 64-bit ness. */
    15811     mHWData->mLongMode = osType->i_is64Bit()
    15812                        ? settings::Hardware::LongMode_Enabled : settings::Hardware::LongMode_Disabled;
    15813 
    15814     /* Let the OS type enable the X2APIC */
    15815     mHWData->mX2APIC = osType->i_recommendedX2APIC();
     15164    mPlatform->i_applyDefaults(osType);
    1581615165
    1581715166    /* This one covers IOAPICEnabled. */
    15818     mBIOSSettings->i_applyDefaults(osType);
     15167    mFirmwareSettings->i_applyDefaults(osType);
    1581915168
    1582015169    /* Initialize default record settings. */
    1582115170    mRecordingSettings->i_applyDefaults();
    15822 
    15823     /* Initialize default BIOS settings here */
    15824     /* Hardware virtualization must be ON by default */
    15825     mHWData->mAPIC = true;
    15826     mHWData->mHWVirtExEnabled = true;
    1582715171
    1582815172    hrc = osType->COMGETTER(RecommendedRAM)(&mHWData->mMemorySize);
     
    1585915203
    1586015204    hrc = mGraphicsAdapter->COMSETTER(Accelerate3DEnabled)(fAccelerate3DEnabled);
    15861     if (FAILED(hrc)) return hrc;
    15862 
    15863     hrc = osType->COMGETTER(RecommendedFirmware)(&mHWData->mFirmwareType);
    15864     if (FAILED(hrc)) return hrc;
    15865 
    15866     hrc = osType->COMGETTER(RecommendedPAE)(&mHWData->mPAEEnabled);
    15867     if (FAILED(hrc)) return hrc;
    15868 
    15869     hrc = osType->COMGETTER(RecommendedHPET)(&mHWData->mHPETEnabled);
    15870     if (FAILED(hrc)) return hrc;
    15871 
    15872     BOOL mRTCUseUTC;
    15873     hrc = osType->COMGETTER(RecommendedRTCUseUTC)(&mRTCUseUTC);
    15874     if (FAILED(hrc)) return hrc;
    15875 
    15876     setRTCUseUTC(mRTCUseUTC);
    15877     if (FAILED(hrc)) return hrc;
    15878 
    15879     /* the setter does more than just the assignment, so use it */
    15880     ChipsetType_T enmChipsetType;
    15881     hrc = osType->COMGETTER(RecommendedChipset)(&enmChipsetType);
    15882     if (FAILED(hrc)) return hrc;
    15883 
    15884     hrc = COMSETTER(ChipsetType)(enmChipsetType);
    15885     if (FAILED(hrc)) return hrc;
    15886 
    15887     hrc = osType->COMGETTER(RecommendedTFReset)(&mHWData->mTripleFaultReset);
    15888     if (FAILED(hrc)) return hrc;
    15889 
    15890     /* Apply IOMMU defaults. */
    15891     IommuType_T enmIommuType;
    15892     hrc = osType->COMGETTER(RecommendedIommuType)(&enmIommuType);
    15893     if (FAILED(hrc)) return hrc;
    15894 
    15895     hrc = COMSETTER(IommuType)(enmIommuType);
    1589615205    if (FAILED(hrc)) return hrc;
    1589715206
  • trunk/src/VBox/Main/src-server/NetworkAdapterImpl.cpp

    r98292 r101035  
    8080HRESULT NetworkAdapter::init(Machine *aParent, ULONG uSlot)
    8181{
     82    ComAssertRet(aParent, E_INVALIDARG);
     83
    8284    LogFlowThisFunc(("aParent=%p, uSlot=%d\n", aParent, uSlot));
    8385
    84     ComAssertRet(aParent, E_INVALIDARG);
    85     uint32_t maxNetworkAdapters = Global::getMaxNetworkAdapters(aParent->i_getChipsetType());
     86    ChipsetType_T enmChipsetType;
     87    HRESULT hrc = aParent->i_getPlatform()->getChipsetType(&enmChipsetType);
     88    if (FAILED(hrc))
     89        return hrc;
     90
     91    uint32_t const maxNetworkAdapters = PlatformProperties::s_getMaxNetworkAdapters(enmChipsetType);
    8692    ComAssertRet(uSlot < maxNetworkAdapters, E_INVALIDARG);
    8793
     
    12041210     * nodes are assigned in the Data::Data() constructor and don't do it
    12051211     * here. It implies that this method may only be called after constructing
    1206      * a new BIOSSettings object while all its data fields are in the default
     1212     * a new FirmwareSettings object while all its data fields are in the default
    12071213     * values. Exceptions are fields whose creation time defaults don't match
    12081214     * values that should be applied when these fields are not explicitly set
  • trunk/src/VBox/Main/src-server/SerialPortImpl.cpp

    r98292 r101035  
    377377
    378378
    379 HRESULT SerialPort::getIOBase(ULONG *aIOBase)
    380 {
    381     AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
    382 
    383     *aIOBase = m->bd->ulIOBase;
    384 
    385     return S_OK;
    386 }
    387 
    388 HRESULT SerialPort::setIOBase(ULONG aIOBase)
     379HRESULT SerialPort::getIOAddress(ULONG *aIOBase)
     380{
     381    AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
     382
     383    *aIOBase = m->bd->ulIOAddress;
     384
     385    return S_OK;
     386}
     387
     388HRESULT SerialPort::setIOAddress(ULONG aIOBase)
    389389{
    390390    /* check IOBase limits
    391391     * (when changing this, make sure it corresponds to XML schema */
    392     if (aIOBase > 0xFFFF)
     392    if (aIOBase > 0xFFFF) /** @todo BUGBUG Check with ARM. */
    393393        return setError(E_INVALIDARG,
    394394                        tr("Invalid I/O port base address of the serial port %d: %lu (must be in range [0, 0x%X])"),
     
    406406    HRESULT hrc = S_OK;
    407407
    408     if (m->bd->ulIOBase != aIOBase)
     408    if (m->bd->ulIOAddress != aIOBase)
    409409    {
    410410        m->bd.backup();
    411         m->bd->ulIOBase = aIOBase;
     411        m->bd->ulIOAddress = aIOBase;
    412412
    413413        m->fModified = true;
     
    681681        case 0:
    682682        {
    683             m->bd->ulIOBase = 0x3f8;
     683            m->bd->ulIOAddress = 0x3f8;
    684684            m->bd->ulIRQ = 4;
    685685            break;
     
    687687        case 1:
    688688        {
    689             m->bd->ulIOBase = 0x2f8;
     689            m->bd->ulIOAddress = 0x2f8;
    690690            m->bd->ulIRQ = 3;
    691691            break;
     
    693693        case 2:
    694694        {
    695             m->bd->ulIOBase = 0x3e8;
     695            m->bd->ulIOAddress = 0x3e8;
    696696            m->bd->ulIRQ = 4;
    697697            break;
     
    699699        case 3:
    700700        {
    701             m->bd->ulIOBase = 0x2e8;
     701            m->bd->ulIOAddress = 0x2e8;
    702702            m->bd->ulIRQ = 3;
    703703            break;
     
    735735        {
    736736            case 0:
    737                 if (m->bd->ulIOBase == 0x3f8 && m->bd->ulIRQ == 4)
     737                if (m->bd->ulIOAddress == 0x3f8 && m->bd->ulIRQ == 4)
    738738                    return true;
    739739                break;
    740740            case 1:
    741                 if (m->bd->ulIOBase == 0x2f8 && m->bd->ulIRQ == 3)
     741                if (m->bd->ulIOAddress == 0x2f8 && m->bd->ulIRQ == 3)
    742742                    return true;
    743743                break;
    744744            case 2:
    745                 if (m->bd->ulIOBase == 0x3e8 && m->bd->ulIRQ == 4)
     745                if (m->bd->ulIOAddress == 0x3e8 && m->bd->ulIRQ == 4)
    746746                    return true;
    747747                break;
    748748            case 3:
    749                 if (m->bd->ulIOBase == 0x2e8 && m->bd->ulIRQ == 3)
     749                if (m->bd->ulIOAddress == 0x2e8 && m->bd->ulIRQ == 3)
    750750                    return true;
    751751                break;
     
    757757        /* Detect old-style defaults (0x3f8, irq 4) in any slot, they are still
    758758         * in place for many VMs created by old VirtualBox versions. */
    759         if (m->bd->ulIOBase == 0x3f8 && m->bd->ulIRQ == 4)
     759        if (m->bd->ulIOAddress == 0x3f8 && m->bd->ulIRQ == 4)
    760760            return true;
    761761    }
  • trunk/src/VBox/Main/src-server/SnapshotImpl.cpp

    r100200 r101035  
    11641164    /* create all other child objects that will be immutable private copies */
    11651165
    1166     unconst(mBIOSSettings).createObject();
    1167     hrc = mBIOSSettings->initCopy(this, pMachine->mBIOSSettings);
     1166    unconst(mPlatform).createObject();
     1167    hrc = mPlatform->initCopy(this, pMachine->mPlatform);
     1168    if (FAILED(hrc)) return hrc;
     1169
     1170    unconst(mPlatformProperties).createObject();
     1171    hrc = mPlatformProperties->init(mParent); /* Does not contain any "real" data, hence only init() and not initCopy(). */
     1172    if (FAILED(hrc)) return hrc;
     1173
     1174    unconst(mFirmwareSettings).createObject();
     1175    hrc = mFirmwareSettings->initCopy(this, pMachine->mFirmwareSettings);
    11681176    if (FAILED(hrc)) return hrc;
    11691177
     
    13091317    /* create all other child objects that will be immutable private copies */
    13101318
    1311     unconst(mBIOSSettings).createObject();
    1312     mBIOSSettings->init(this);
     1319    unconst(mPlatform).createObject();
     1320    mPlatform->init(this);
     1321    mPlatform->i_loadSettings(hardware.platformSettings); /* Needed for initializing the network adapters below (chipset type). */
     1322
     1323    unconst(mPlatformProperties).createObject();
     1324    mPlatformProperties->init(mParent);
     1325
     1326    unconst(mFirmwareSettings).createObject();
     1327    mFirmwareSettings->init(this);
    13131328
    13141329    unconst(mRecordingSettings).createObject();
     
    13331348    mUSBDeviceFilters->init(this);
    13341349
    1335     mNetworkAdapters.resize(Global::getMaxNetworkAdapters(mHWData->mChipsetType));
     1350    mNetworkAdapters.resize(PlatformProperties::s_getMaxNetworkAdapters(hardware.platformSettings.chipsetType));
    13361351    for (ULONG slot = 0; slot < mNetworkAdapters.size(); slot++)
    13371352    {
  • trunk/src/VBox/Main/src-server/StorageControllerImpl.cpp

    r98292 r101035  
    110110                        tr("Invalid storage connection type"));
    111111
     112    ChipsetType_T chipsetType;
     113    HRESULT hrc = aParent->i_getPlatform()->COMGETTER(ChipsetType)(&chipsetType);
     114    AssertComRCReturnRC(hrc);
     115
    112116    ULONG maxInstances;
    113     ChipsetType_T chipsetType;
    114     HRESULT hrc = aParent->COMGETTER(ChipsetType)(&chipsetType);
    115     if (FAILED(hrc))
    116         return hrc;
    117     hrc = aParent->i_getVirtualBox()->i_getSystemProperties()->
    118         GetMaxInstancesOfStorageBus(chipsetType, aStorageBus, &maxInstances);
    119     if (FAILED(hrc))
    120         return hrc;
     117    hrc = aParent->i_getPlatformProperties()->GetMaxInstancesOfStorageBus(chipsetType, aStorageBus, &maxInstances);
     118    AssertComRCReturnRC(hrc);
     119
    121120    if (aInstance >= maxInstances)
    122121        return setError(E_INVALIDARG,
     
    446445{
    447446    AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
    448     return m->pSystemProperties->GetMaxDevicesPerPortForStorageBus(m->bd->storageBus, aMaxDevicesPerPortCount);
     447    return m->pParent->i_getPlatformProperties()->GetMaxDevicesPerPortForStorageBus(m->bd->storageBus, aMaxDevicesPerPortCount);
    449448}
    450449
     
    452451{
    453452    AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
    454     return m->pSystemProperties->GetMinPortCountForStorageBus(m->bd->storageBus, aMinPortCount);
     453    return m->pParent->i_getPlatformProperties()->GetMinPortCountForStorageBus(m->bd->storageBus, aMinPortCount);
    455454}
    456455
     
    458457{
    459458    AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
    460     return m->pSystemProperties->GetMaxPortCountForStorageBus(m->bd->storageBus, aMaxPortCount);
     459    return m->pParent->i_getPlatformProperties()->GetMaxPortCountForStorageBus(m->bd->storageBus, aMaxPortCount);
    461460}
    462461
     
    707706    ULONG portCount = m->bd->ulPortCount;
    708707    ULONG devicesPerPort;
    709     HRESULT hrc = m->pSystemProperties->GetMaxDevicesPerPortForStorageBus(m->bd->storageBus, &devicesPerPort);
     708    HRESULT hrc = m->pParent->i_getPlatformProperties()->GetMaxDevicesPerPortForStorageBus(m->bd->storageBus, &devicesPerPort);
    710709    if (FAILED(hrc)) return hrc;
    711710
  • trunk/src/VBox/Main/src-server/SystemPropertiesImpl.cpp

    r98292 r101035  
    117117    m->uLogHistoryCount = 3;
    118118
    119 
    120     /* On Windows, OS X and Solaris, HW virtualization use isn't exclusive
    121      * by default so that VT-x or AMD-V can be shared with other
    122      * hypervisors without requiring user intervention.
    123      * NB: See also SystemProperties constructor in settings.h
    124      */
    125 #if defined(RT_OS_DARWIN) || defined(RT_OS_WINDOWS) || defined(RT_OS_SOLARIS)
    126     m->fExclusiveHwVirt = false;
    127 #else
    128     m->fExclusiveHwVirt = true;
    129 #endif
    130 
    131119    HRESULT hrc = S_OK;
    132120
     
    152140
    153141            m_llMediumFormats.push_back(hdf);
     142        }
     143    }
     144
     145    if (SUCCEEDED(hrc))
     146    {
     147        hrc = unconst(m_platformProperties).createObject();
     148        if (SUCCEEDED(hrc))
     149        {
     150            hrc = m_platformProperties->init(mParent);
     151            if (SUCCEEDED(hrc))
     152                hrc = m_platformProperties->i_setArchitecture(PlatformProperties::s_getHostPlatformArchitecture());
    154153        }
    155154    }
     
    268267
    269268
    270 HRESULT SystemProperties::getSerialPortCount(ULONG *count)
    271 {
    272     /* no need to lock, this is const */
    273     *count = SchemaDefs::SerialPortCount;
    274 
    275     return S_OK;
    276 }
    277 
    278 
    279 HRESULT SystemProperties::getParallelPortCount(ULONG *count)
    280 {
    281     /* no need to lock, this is const */
    282     *count = SchemaDefs::ParallelPortCount;
    283 
    284     return S_OK;
    285 }
    286 
    287 
    288 HRESULT SystemProperties::getMaxBootPosition(ULONG *aMaxBootPosition)
    289 {
    290     /* no need to lock, this is const */
    291     *aMaxBootPosition = SchemaDefs::MaxBootPosition;
    292 
    293     return S_OK;
    294 }
    295 
    296 
    297 HRESULT SystemProperties::getRawModeSupported(BOOL *aRawModeSupported)
    298 {
    299     *aRawModeSupported = FALSE;
    300     return S_OK;
    301 }
    302 
    303 
    304 HRESULT SystemProperties::getExclusiveHwVirt(BOOL *aExclusiveHwVirt)
    305 {
    306     AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
    307 
    308     *aExclusiveHwVirt = m->fExclusiveHwVirt;
    309 
    310     return S_OK;
    311 }
    312 
    313 HRESULT SystemProperties::setExclusiveHwVirt(BOOL aExclusiveHwVirt)
    314 {
    315     AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS);
    316     m->fExclusiveHwVirt = !!aExclusiveHwVirt;
    317     alock.release();
    318 
    319     // VirtualBox::i_saveSettings() needs vbox write lock
    320     AutoWriteLock vboxLock(mParent COMMA_LOCKVAL_SRC_POS);
    321     return mParent->i_saveSettings();
    322 }
    323 
    324 HRESULT SystemProperties::getMaxNetworkAdapters(ChipsetType_T aChipset, ULONG *aMaxNetworkAdapters)
    325 {
    326     /* no need for locking, no state */
    327     uint32_t uResult = Global::getMaxNetworkAdapters(aChipset);
    328     if (uResult == 0)
    329         AssertMsgFailed(("Invalid chipset type %d\n", aChipset));
    330     *aMaxNetworkAdapters = uResult;
    331     return S_OK;
    332 }
    333 
    334 HRESULT SystemProperties::getMaxNetworkAdaptersOfType(ChipsetType_T aChipset, NetworkAttachmentType_T aType, ULONG *count)
    335 {
    336     /* no need for locking, no state */
    337     uint32_t uResult = Global::getMaxNetworkAdapters(aChipset);
    338     if (uResult == 0)
    339         AssertMsgFailed(("Invalid chipset type %d\n", aChipset));
    340 
    341     switch (aType)
    342     {
    343         case NetworkAttachmentType_NAT:
    344         case NetworkAttachmentType_Internal:
    345         case NetworkAttachmentType_NATNetwork:
    346             /* chipset default is OK */
    347             break;
    348         case NetworkAttachmentType_Bridged:
    349             /* Maybe use current host interface count here? */
    350             break;
    351         case NetworkAttachmentType_HostOnly:
    352             uResult = RT_MIN(uResult, 8);
    353             break;
    354         default:
    355             AssertMsgFailed(("Unhandled attachment type %d\n", aType));
    356     }
    357 
    358     *count = uResult;
    359 
    360     return S_OK;
    361 }
    362 
    363 
    364 HRESULT SystemProperties::getMaxDevicesPerPortForStorageBus(StorageBus_T aBus,
    365                                                             ULONG *aMaxDevicesPerPort)
    366 {
    367     /* no need to lock, this is const */
    368     switch (aBus)
    369     {
    370         case StorageBus_SATA:
    371         case StorageBus_SCSI:
    372         case StorageBus_SAS:
    373         case StorageBus_USB:
    374         case StorageBus_PCIe:
    375         case StorageBus_VirtioSCSI:
    376         {
    377             /* SATA and both SCSI controllers only support one device per port. */
    378             *aMaxDevicesPerPort = 1;
    379             break;
    380         }
    381         case StorageBus_IDE:
    382         case StorageBus_Floppy:
    383         {
    384             /* The IDE and Floppy controllers support 2 devices. One as master
    385              * and one as slave (or floppy drive 0 and 1). */
    386             *aMaxDevicesPerPort = 2;
    387             break;
    388         }
    389         default:
    390             AssertMsgFailed(("Invalid bus type %d\n", aBus));
    391     }
    392 
    393     return S_OK;
    394 }
    395 
    396 HRESULT SystemProperties::getMinPortCountForStorageBus(StorageBus_T aBus,
    397                                                        ULONG *aMinPortCount)
    398 {
    399     /* no need to lock, this is const */
    400     switch (aBus)
    401     {
    402         case StorageBus_SATA:
    403         case StorageBus_SAS:
    404         case StorageBus_PCIe:
    405         case StorageBus_VirtioSCSI:
    406         {
    407             *aMinPortCount = 1;
    408             break;
    409         }
    410         case StorageBus_SCSI:
    411         {
    412             *aMinPortCount = 16;
    413             break;
    414         }
    415         case StorageBus_IDE:
    416         {
    417             *aMinPortCount = 2;
    418             break;
    419         }
    420         case StorageBus_Floppy:
    421         {
    422             *aMinPortCount = 1;
    423             break;
    424         }
    425         case StorageBus_USB:
    426         {
    427             *aMinPortCount = 8;
    428             break;
    429         }
    430         default:
    431             AssertMsgFailed(("Invalid bus type %d\n", aBus));
    432     }
    433 
    434     return S_OK;
    435 }
    436 
    437 HRESULT SystemProperties::getMaxPortCountForStorageBus(StorageBus_T aBus,
    438                                                        ULONG *aMaxPortCount)
    439 {
    440     /* no need to lock, this is const */
    441     switch (aBus)
    442     {
    443         case StorageBus_SATA:
    444         {
    445             *aMaxPortCount = 30;
    446             break;
    447         }
    448         case StorageBus_SCSI:
    449         {
    450             *aMaxPortCount = 16;
    451             break;
    452         }
    453         case StorageBus_IDE:
    454         {
    455             *aMaxPortCount = 2;
    456             break;
    457         }
    458         case StorageBus_Floppy:
    459         {
    460             *aMaxPortCount = 1;
    461             break;
    462         }
    463         case StorageBus_SAS:
    464         case StorageBus_PCIe:
    465         {
    466             *aMaxPortCount = 255;
    467             break;
    468         }
    469         case StorageBus_USB:
    470         {
    471             *aMaxPortCount = 8;
    472             break;
    473         }
    474         case StorageBus_VirtioSCSI:
    475         {
    476             *aMaxPortCount = 256;
    477             break;
    478         }
    479         default:
    480             AssertMsgFailed(("Invalid bus type %d\n", aBus));
    481     }
    482 
    483     return S_OK;
    484 }
    485 
    486 HRESULT SystemProperties::getMaxInstancesOfStorageBus(ChipsetType_T aChipset,
    487                                                       StorageBus_T  aBus,
    488                                                       ULONG *aMaxInstances)
    489 {
    490     ULONG cCtrs = 0;
    491 
    492     /* no need to lock, this is const */
    493     switch (aBus)
    494     {
    495         case StorageBus_SATA:
    496         case StorageBus_SCSI:
    497         case StorageBus_SAS:
    498         case StorageBus_PCIe:
    499         case StorageBus_VirtioSCSI:
    500             cCtrs = aChipset == ChipsetType_ICH9 ? 8 : 1;
    501             break;
    502         case StorageBus_USB:
    503         case StorageBus_IDE:
    504         case StorageBus_Floppy:
    505         {
    506             cCtrs = 1;
    507             break;
    508         }
    509         default:
    510             AssertMsgFailed(("Invalid bus type %d\n", aBus));
    511     }
    512 
    513     *aMaxInstances = cCtrs;
    514 
    515     return S_OK;
    516 }
    517 
    518 HRESULT SystemProperties::getDeviceTypesForStorageBus(StorageBus_T aBus,
    519                                                       std::vector<DeviceType_T> &aDeviceTypes)
    520 {
    521     aDeviceTypes.resize(0);
    522 
    523     /* no need to lock, this is const */
    524     switch (aBus)
    525     {
    526         case StorageBus_IDE:
    527         case StorageBus_SATA:
    528         case StorageBus_SCSI:
    529         case StorageBus_SAS:
    530         case StorageBus_USB:
    531         case StorageBus_VirtioSCSI:
    532         {
    533             aDeviceTypes.resize(2);
    534             aDeviceTypes[0] = DeviceType_DVD;
    535             aDeviceTypes[1] = DeviceType_HardDisk;
    536             break;
    537         }
    538         case StorageBus_Floppy:
    539         {
    540             aDeviceTypes.resize(1);
    541             aDeviceTypes[0] = DeviceType_Floppy;
    542             break;
    543         }
    544         case StorageBus_PCIe:
    545         {
    546             aDeviceTypes.resize(1);
    547             aDeviceTypes[0] = DeviceType_HardDisk;
    548             break;
    549         }
    550         default:
    551             AssertMsgFailed(("Invalid bus type %d\n", aBus));
    552     }
    553 
    554     return S_OK;
    555 }
    556 
    557 HRESULT SystemProperties::getStorageBusForStorageControllerType(StorageControllerType_T aStorageControllerType,
    558                                                                 StorageBus_T *aStorageBus)
    559 {
    560     /* no need to lock, this is const */
    561     switch (aStorageControllerType)
    562     {
    563         case StorageControllerType_LsiLogic:
    564         case StorageControllerType_BusLogic:
    565             *aStorageBus = StorageBus_SCSI;
    566             break;
    567         case StorageControllerType_IntelAhci:
    568             *aStorageBus = StorageBus_SATA;
    569             break;
    570         case StorageControllerType_PIIX3:
    571         case StorageControllerType_PIIX4:
    572         case StorageControllerType_ICH6:
    573             *aStorageBus = StorageBus_IDE;
    574             break;
    575         case StorageControllerType_I82078:
    576             *aStorageBus = StorageBus_Floppy;
    577             break;
    578         case StorageControllerType_LsiLogicSas:
    579             *aStorageBus = StorageBus_SAS;
    580             break;
    581         case StorageControllerType_USB:
    582             *aStorageBus = StorageBus_USB;
    583             break;
    584         case StorageControllerType_NVMe:
    585             *aStorageBus = StorageBus_PCIe;
    586             break;
    587         case StorageControllerType_VirtioSCSI:
    588             *aStorageBus = StorageBus_VirtioSCSI;
    589             break;
    590         default:
    591             return setError(E_FAIL, tr("Invalid storage controller type %d\n"), aStorageBus);
    592     }
    593 
    594     return S_OK;
    595 }
    596 
    597 HRESULT SystemProperties::getStorageControllerTypesForStorageBus(StorageBus_T aStorageBus,
    598                                                                  std::vector<StorageControllerType_T> &aStorageControllerTypes)
    599 {
    600     aStorageControllerTypes.resize(0);
    601 
    602     /* no need to lock, this is const */
    603     switch (aStorageBus)
    604     {
    605         case StorageBus_IDE:
    606             aStorageControllerTypes.resize(3);
    607             aStorageControllerTypes[0] = StorageControllerType_PIIX4;
    608             aStorageControllerTypes[1] = StorageControllerType_PIIX3;
    609             aStorageControllerTypes[2] = StorageControllerType_ICH6;
    610             break;
    611         case StorageBus_SATA:
    612             aStorageControllerTypes.resize(1);
    613             aStorageControllerTypes[0] = StorageControllerType_IntelAhci;
    614             break;
    615         case StorageBus_SCSI:
    616             aStorageControllerTypes.resize(2);
    617             aStorageControllerTypes[0] = StorageControllerType_LsiLogic;
    618             aStorageControllerTypes[1] = StorageControllerType_BusLogic;
    619             break;
    620         case StorageBus_Floppy:
    621             aStorageControllerTypes.resize(1);
    622             aStorageControllerTypes[0] = StorageControllerType_I82078;
    623             break;
    624         case StorageBus_SAS:
    625             aStorageControllerTypes.resize(1);
    626             aStorageControllerTypes[0] = StorageControllerType_LsiLogicSas;
    627             break;
    628         case StorageBus_USB:
    629             aStorageControllerTypes.resize(1);
    630             aStorageControllerTypes[0] = StorageControllerType_USB;
    631             break;
    632         case StorageBus_PCIe:
    633             aStorageControllerTypes.resize(1);
    634             aStorageControllerTypes[0] = StorageControllerType_NVMe;
    635             break;
    636         case StorageBus_VirtioSCSI:
    637             aStorageControllerTypes.resize(1);
    638             aStorageControllerTypes[0] = StorageControllerType_VirtioSCSI;
    639             break;
    640         default:
    641             return setError(E_FAIL, tr("Invalid storage bus %d\n"), aStorageBus);
    642     }
    643 
    644     return S_OK;
    645 }
    646 
    647269HRESULT SystemProperties::getDefaultIoCacheSettingForStorageController(StorageControllerType_T aControllerType,
    648270                                                                       BOOL *aEnabled)
     
    669291            AssertMsgFailed(("Invalid controller type %d\n", aControllerType));
    670292    }
    671     return S_OK;
    672 }
    673 
    674 HRESULT SystemProperties::getStorageControllerHotplugCapable(StorageControllerType_T aControllerType,
    675                                                              BOOL *aHotplugCapable)
    676 {
    677     switch (aControllerType)
    678     {
    679         case StorageControllerType_IntelAhci:
    680         case StorageControllerType_USB:
    681             *aHotplugCapable = true;
    682             break;
    683         case StorageControllerType_LsiLogic:
    684         case StorageControllerType_LsiLogicSas:
    685         case StorageControllerType_BusLogic:
    686         case StorageControllerType_NVMe:
    687         case StorageControllerType_VirtioSCSI:
    688         case StorageControllerType_PIIX3:
    689         case StorageControllerType_PIIX4:
    690         case StorageControllerType_ICH6:
    691         case StorageControllerType_I82078:
    692             *aHotplugCapable = false;
    693             break;
    694         default:
    695             AssertMsgFailedReturn(("Invalid controller type %d\n", aControllerType), E_FAIL);
    696     }
    697 
    698     return S_OK;
    699 }
    700 
    701 HRESULT SystemProperties::getMaxInstancesOfUSBControllerType(ChipsetType_T aChipset,
    702                                                              USBControllerType_T aType,
    703                                                              ULONG *aMaxInstances)
    704 {
    705     NOREF(aChipset);
    706     ULONG cCtrs = 0;
    707 
    708     /* no need to lock, this is const */
    709     switch (aType)
    710     {
    711         case USBControllerType_OHCI:
    712         case USBControllerType_EHCI:
    713         case USBControllerType_XHCI:
    714         {
    715             cCtrs = 1;
    716             break;
    717         }
    718         default:
    719             AssertMsgFailed(("Invalid bus type %d\n", aType));
    720     }
    721 
    722     *aMaxInstances = cCtrs;
    723 
    724293    return S_OK;
    725294}
     
    1360929}
    1361930
     931HRESULT SystemProperties::getPlatform(ComPtr<IPlatformProperties> &aPlatformProperties)
     932{
     933    /* No need to lock, as m_platformProperties is const. */
     934
     935    return m_platformProperties.queryInterfaceTo(aPlatformProperties.asOutParam());
     936}
     937
    1362938HRESULT SystemProperties::getProxyMode(ProxyMode_T *pProxyMode)
    1363939{
     
    14451021}
    14461022
    1447 HRESULT SystemProperties::getSupportedParavirtProviders(std::vector<ParavirtProvider_T> &aSupportedParavirtProviders)
    1448 {
    1449     static const ParavirtProvider_T aParavirtProviders[] =
    1450     {
    1451         ParavirtProvider_None,
    1452         ParavirtProvider_Default,
    1453         ParavirtProvider_Legacy,
    1454         ParavirtProvider_Minimal,
    1455         ParavirtProvider_HyperV,
    1456         ParavirtProvider_KVM,
    1457     };
    1458     aSupportedParavirtProviders.assign(aParavirtProviders,
    1459                                        aParavirtProviders + RT_ELEMENTS(aParavirtProviders));
    1460     return S_OK;
    1461 }
    1462 
    14631023HRESULT SystemProperties::getSupportedClipboardModes(std::vector<ClipboardMode_T> &aSupportedClipboardModes)
    14641024{
     
    14861046    aSupportedDnDModes.assign(aDnDModes,
    14871047                              aDnDModes + RT_ELEMENTS(aDnDModes));
    1488     return S_OK;
    1489 }
    1490 
    1491 HRESULT SystemProperties::getSupportedFirmwareTypes(std::vector<FirmwareType_T> &aSupportedFirmwareTypes)
    1492 {
    1493     static const FirmwareType_T aFirmwareTypes[] =
    1494     {
    1495         FirmwareType_BIOS,
    1496         FirmwareType_EFI,
    1497         FirmwareType_EFI32,
    1498         FirmwareType_EFI64,
    1499         FirmwareType_EFIDUAL,
    1500     };
    1501     aSupportedFirmwareTypes.assign(aFirmwareTypes,
    1502                                    aFirmwareTypes + RT_ELEMENTS(aFirmwareTypes));
    15031048    return S_OK;
    15041049}
     
    16781223    aSupportedRecordingVideoRateControlModes.assign(aRecordingVideoRateControlModes,
    16791224                                                    aRecordingVideoRateControlModes + RT_ELEMENTS(aRecordingVideoRateControlModes));
    1680     return S_OK;
    1681 }
    1682 
    1683 HRESULT SystemProperties::getSupportedGraphicsControllerTypes(std::vector<GraphicsControllerType_T> &aSupportedGraphicsControllerTypes)
    1684 {
    1685     static const GraphicsControllerType_T aGraphicsControllerTypes[] =
    1686     {
    1687         GraphicsControllerType_VBoxVGA,
    1688         GraphicsControllerType_VMSVGA,
    1689         GraphicsControllerType_VBoxSVGA,
    1690         GraphicsControllerType_Null,
    1691     };
    1692     aSupportedGraphicsControllerTypes.assign(aGraphicsControllerTypes,
    1693                                              aGraphicsControllerTypes + RT_ELEMENTS(aGraphicsControllerTypes));
    16941225    return S_OK;
    16951226}
     
    17621293}
    17631294
    1764 HRESULT SystemProperties::getSupportedNetworkAdapterTypes(std::vector<NetworkAdapterType_T> &aSupportedNetworkAdapterTypes)
    1765 {
    1766     static const NetworkAdapterType_T aNetworkAdapterTypes[] =
    1767     {
    1768         NetworkAdapterType_Am79C970A,
    1769         NetworkAdapterType_Am79C973,
    1770         NetworkAdapterType_I82540EM,
    1771         NetworkAdapterType_I82543GC,
    1772         NetworkAdapterType_I82545EM,
    1773         NetworkAdapterType_Virtio,
    1774     };
    1775     aSupportedNetworkAdapterTypes.assign(aNetworkAdapterTypes,
    1776                                          aNetworkAdapterTypes + RT_ELEMENTS(aNetworkAdapterTypes));
    1777     return S_OK;
    1778 }
    1779 
    17801295HRESULT SystemProperties::getSupportedPortModes(std::vector<PortMode_T> &aSupportedPortModes)
    17811296{
     
    17901305    aSupportedPortModes.assign(aPortModes,
    17911306                               aPortModes + RT_ELEMENTS(aPortModes));
    1792     return S_OK;
    1793 }
    1794 
    1795 HRESULT SystemProperties::getSupportedUartTypes(std::vector<UartType_T> &aSupportedUartTypes)
    1796 {
    1797     static const UartType_T aUartTypes[] =
    1798     {
    1799         UartType_U16450,
    1800         UartType_U16550A,
    1801         UartType_U16750,
    1802     };
    1803     aSupportedUartTypes.assign(aUartTypes,
    1804                                aUartTypes + RT_ELEMENTS(aUartTypes));
    1805     return S_OK;
    1806 }
    1807 
    1808 HRESULT SystemProperties::getSupportedUSBControllerTypes(std::vector<USBControllerType_T> &aSupportedUSBControllerTypes)
    1809 {
    1810     static const USBControllerType_T aUSBControllerTypes[] =
    1811     {
    1812         USBControllerType_OHCI,
    1813         USBControllerType_EHCI,
    1814         USBControllerType_XHCI,
    1815     };
    1816     aSupportedUSBControllerTypes.assign(aUSBControllerTypes,
    1817                                         aUSBControllerTypes + RT_ELEMENTS(aUSBControllerTypes));
    18181307    return S_OK;
    18191308}
     
    18581347}
    18591348
    1860 HRESULT SystemProperties::getSupportedAudioControllerTypes(std::vector<AudioControllerType_T> &aSupportedAudioControllerTypes)
    1861 {
    1862     static const AudioControllerType_T aAudioControllerTypes[] =
    1863     {
    1864         AudioControllerType_AC97,
    1865         AudioControllerType_SB16,
    1866         AudioControllerType_HDA,
    1867     };
    1868     aSupportedAudioControllerTypes.assign(aAudioControllerTypes,
    1869                                           aAudioControllerTypes + RT_ELEMENTS(aAudioControllerTypes));
    1870     return S_OK;
    1871 }
    1872 
    1873 HRESULT SystemProperties::getSupportedStorageBuses(std::vector<StorageBus_T> &aSupportedStorageBuses)
    1874 {
    1875     static const StorageBus_T aStorageBuses[] =
    1876     {
    1877         StorageBus_SATA,
    1878         StorageBus_IDE,
    1879         StorageBus_SCSI,
    1880         StorageBus_Floppy,
    1881         StorageBus_SAS,
    1882         StorageBus_USB,
    1883         StorageBus_PCIe,
    1884         StorageBus_VirtioSCSI,
    1885     };
    1886     aSupportedStorageBuses.assign(aStorageBuses,
    1887                                   aStorageBuses + RT_ELEMENTS(aStorageBuses));
    1888     return S_OK;
    1889 }
    1890 
    1891 HRESULT SystemProperties::getSupportedStorageControllerTypes(std::vector<StorageControllerType_T> &aSupportedStorageControllerTypes)
    1892 {
    1893     static const StorageControllerType_T aStorageControllerTypes[] =
    1894     {
    1895         StorageControllerType_IntelAhci,
    1896         StorageControllerType_PIIX4,
    1897         StorageControllerType_PIIX3,
    1898         StorageControllerType_ICH6,
    1899         StorageControllerType_LsiLogic,
    1900         StorageControllerType_BusLogic,
    1901         StorageControllerType_I82078,
    1902         StorageControllerType_LsiLogicSas,
    1903         StorageControllerType_USB,
    1904         StorageControllerType_NVMe,
    1905         StorageControllerType_VirtioSCSI,
    1906     };
    1907     aSupportedStorageControllerTypes.assign(aStorageControllerTypes,
    1908                                             aStorageControllerTypes + RT_ELEMENTS(aStorageControllerTypes));
    1909     return S_OK;
    1910 }
    1911 
    1912 HRESULT SystemProperties::getSupportedChipsetTypes(std::vector<ChipsetType_T> &aSupportedChipsetTypes)
    1913 {
    1914     static const ChipsetType_T aChipsetTypes[] =
    1915     {
    1916         ChipsetType_PIIX3,
    1917         ChipsetType_ICH9,
    1918     };
    1919     aSupportedChipsetTypes.assign(aChipsetTypes,
    1920                                   aChipsetTypes + RT_ELEMENTS(aChipsetTypes));
    1921     return S_OK;
    1922 }
    1923 
    1924 HRESULT SystemProperties::getSupportedIommuTypes(std::vector<IommuType_T> &aSupportedIommuTypes)
    1925 {
    1926     static const IommuType_T aIommuTypes[] =
    1927     {
    1928         IommuType_None,
    1929         IommuType_Automatic,
    1930         IommuType_AMD,
    1931         /** @todo Add Intel when it's supported. */
    1932     };
    1933     aSupportedIommuTypes.assign(aIommuTypes,
    1934                                 aIommuTypes + RT_ELEMENTS(aIommuTypes));
    1935     return S_OK;
    1936 }
    1937 
    1938 HRESULT SystemProperties::getSupportedTpmTypes(std::vector<TpmType_T> &aSupportedTpmTypes)
    1939 {
    1940     static const TpmType_T aTpmTypes[] =
    1941     {
    1942         TpmType_None,
    1943         TpmType_v1_2,
    1944         TpmType_v2_0
    1945     };
    1946     aSupportedTpmTypes.assign(aTpmTypes,
    1947                               aTpmTypes + RT_ELEMENTS(aTpmTypes));
    1948     return S_OK;
    1949 }
    1950 
    19511349
    19521350// public methods only for internal purposes
     
    19811379
    19821380    m->uLogHistoryCount  = data.uLogHistoryCount;
    1983     m->fExclusiveHwVirt  = data.fExclusiveHwVirt;
    19841381    m->uProxyMode        = data.uProxyMode;
    19851382    m->strProxyUrl       = data.strProxyUrl;
  • trunk/src/VBox/Main/src-server/UnattendedImpl.cpp

    r100108 r101035  
    25092509    bool const fIs64Bit = i_isGuestOSArchX64(strGuestOsTypeId);
    25102510
     2511    ComPtr<IPlatform> pPlatform;
     2512    hrc = ptrMachine->COMGETTER(Platform)(pPlatform.asOutParam());
     2513    AssertComRCReturn(hrc, hrc);
     2514
    25112515    BOOL fRtcUseUtc = FALSE;
    2512     hrc = ptrMachine->COMGETTER(RTCUseUTC)(&fRtcUseUtc);
     2516    hrc = pPlatform->COMGETTER(RTCUseUTC)(&fRtcUseUtc);
    25132517    if (FAILED(hrc))
    25142518        return hrc;
    25152519
     2520    ComPtr<IFirmwareSettings> pFirmwareSettings;
     2521    hrc = ptrMachine->COMGETTER(FirmwareSettings)(pFirmwareSettings.asOutParam());
     2522    AssertComRCReturn(hrc, hrc);
     2523
    25162524    FirmwareType_T enmFirmware = FirmwareType_BIOS;
    2517     hrc = ptrMachine->COMGETTER(FirmwareType)(&enmFirmware);
     2525    hrc = pFirmwareSettings->COMGETTER(FirmwareType)(&enmFirmware);
    25182526    if (FAILED(hrc))
    25192527        return hrc;
  • trunk/src/VBox/Main/src-server/VirtualBoxImpl.cpp

    r100737 r101035  
    12531253}
    12541254
     1255HRESULT VirtualBox::getPlatformProperties(PlatformArchitecture_T platformArchitecture,
     1256                                          ComPtr<IPlatformProperties> &aPlatformProperties)
     1257{
     1258    ComObjPtr<PlatformProperties> platformProperties;
     1259    HRESULT hrc = platformProperties.createObject();
     1260    AssertComRCReturn(hrc, hrc);
     1261
     1262    hrc = platformProperties->init(this);
     1263    AssertComRCReturn(hrc, hrc);
     1264
     1265    hrc = platformProperties->i_setArchitecture(platformArchitecture);
     1266    AssertComRCReturn(hrc, hrc);
     1267
     1268    return platformProperties.queryInterfaceTo(aPlatformProperties.asOutParam());
     1269}
     1270
    12551271HRESULT VirtualBox::getSystemProperties(ComPtr<ISystemProperties> &aSystemProperties)
    12561272{
     
    16001616        if (pMachine->i_isAccessible())
    16011617        {
    1602             uint32_t cNetworkAdapters = Global::getMaxNetworkAdapters(pMachine->i_getChipsetType());
     1618            ChipsetType_T enmChipsetType;
     1619            HRESULT hrc = pMachine->i_getPlatform()->getChipsetType(&enmChipsetType);
     1620            ComAssertComRC(hrc);
     1621
     1622            uint32_t const cNetworkAdapters = PlatformProperties::s_getMaxNetworkAdapters(enmChipsetType);
    16031623            for (ULONG i = 0; i < cNetworkAdapters; i++)
    16041624            {
    16051625                ComPtr<INetworkAdapter> pNet;
    1606                 HRESULT hrc = pMachine->GetNetworkAdapter(i, pNet.asOutParam());
     1626                hrc = pMachine->GetNetworkAdapter(i, pNet.asOutParam());
    16071627                if (FAILED(hrc) || pNet.isNull())
    16081628                    continue;
     
    16511671        if (pMachine->i_isAccessible())
    16521672        {
    1653             uint32_t cNetworkAdapters = Global::getMaxNetworkAdapters(pMachine->i_getChipsetType());
     1673            ChipsetType_T enmChipsetType;
     1674            HRESULT hrc = pMachine->i_getPlatform()->getChipsetType(&enmChipsetType);
     1675            ComAssertComRC(hrc);
     1676
     1677            uint32_t const cNetworkAdapters = PlatformProperties::s_getMaxNetworkAdapters(enmChipsetType);
    16541678            for (ULONG i = 0; i < cNetworkAdapters; i++)
    16551679            {
    16561680                ComPtr<INetworkAdapter> pNet;
    1657                 HRESULT hrc = pMachine->GetNetworkAdapter(i, pNet.asOutParam());
     1681                hrc = pMachine->GetNetworkAdapter(i, pNet.asOutParam());
    16581682                if (FAILED(hrc) || pNet.isNull())
    16591683                    continue;
     
    20882112HRESULT VirtualBox::createMachine(const com::Utf8Str &aSettingsFile,
    20892113                                  const com::Utf8Str &aName,
     2114                                  PlatformArchitecture_T aArchitecture,
    20902115                                  const std::vector<com::Utf8Str> &aGroups,
    20912116                                  const com::Utf8Str &aOsTypeId,
     
    20972122{
    20982123    LogFlowThisFuncEnter();
    2099     LogFlowThisFunc(("aSettingsFile=\"%s\", aName=\"%s\", aOsTypeId =\"%s\", aCreateFlags=\"%s\"\n",
    2100                      aSettingsFile.c_str(), aName.c_str(), aOsTypeId.c_str(), aFlags.c_str()));
     2124    LogFlowThisFunc(("aSettingsFile=\"%s\", aName=\"%s\", aArchitecture=%#x, aOsTypeId =\"%s\", aCreateFlags=\"%s\"\n",
     2125                     aSettingsFile.c_str(), aName.c_str(), aArchitecture, aOsTypeId.c_str(), aFlags.c_str()));
    21012126
    21022127    StringsList llGroups;
     
    21052130        return hrc;
    21062131
    2107     /** @todo r=bird: Would be goot to rewrite this parsing using offset into
     2132    /** @todo r=bird: Would be good to rewrite this parsing using offset into
    21082133     *        aFlags and drop all the C pointers, strchr, misguided RTStrStr and
    21092134     *        tedious copying of substrings. */
     
    21852210                        strSettingsFile,
    21862211                        aName,
     2212                        aArchitecture,
    21872213                        llGroups,
    21882214                        aOsTypeId,
  • trunk/src/VBox/Main/testcase/Makefile.kmk

    r99770 r101035  
    4848        tstMediumLock \
    4949        tstSafeArray \
     50        tstSettings \
    5051        tstBstr \
    5152        tstGuid \
     
    294295tstSafeArray_SOURCES  = tstSafeArray.cpp
    295296
     297
     298#
     299# tstSettings
     300#
     301tstSettings_TEMPLATE = VBoxMainClientTstExe
     302tstSettings_INCS     = \
     303        ../include \
     304        $(VBOX_MAIN_APIWRAPPER_INCS) \
     305        $(dir $(VBOX_XML_SCHEMADEFS_H))
     306tstSettings_SOURCES  = \
     307        tstSettings.cpp \
     308        ../src-all/HashedPw.cpp \
     309        ../xml/Settings.cpp
    296310
    297311#
     
    349363# generate rules.
    350364include $(FILE_KBUILD_SUB_FOOTER)
    351 
  • trunk/src/VBox/Main/testcase/tstVBoxAPI.cpp

    r98103 r101035  
    6565
    6666
    67 static BOOL tstApiIVirtualBox(IVirtualBox *pVBox)
     67static void tstApiIVirtualBox(IVirtualBox *pVBox)
    6868{
    6969    HRESULT hrc;
     
    128128        RTTestFailed(g_hTest, "%d: IVirtualBox::guestOSTypes failed", __LINE__);
    129129
    130     /** Create VM */
     130    /* For now we only test same-same architectures (host == guest). */
     131    PlatformArchitecture_T enmPlatformArch;
     132#if defined(RT_ARCH_X86) || defined(RT_ARCH_AMD64)
     133    enmPlatformArch = PlatformArchitecture_x86;
     134#elif defined(RT_ARCH_ARM32) || defined(RT_ARCH_ARM64)
     135    enmPlatformArch = PlatformArchitecture_ARM;
     136#else
     137# error "Port me!"
     138#endif
     139
     140    /*
     141     * Host
     142     */
     143    ComPtr<IHost> host;
     144    RTTestSub(g_hTest, "IVirtualBox::host");
     145    CHECK_ERROR(pVBox, COMGETTER(Host)(host.asOutParam()));
     146    if (SUCCEEDED(hrc))
     147    {
     148        RTTestPassed(g_hTest, "IVirtualBox::host");
     149        CHECK_ERROR(host, COMGETTER(Architecture)(&enmPlatformArch));
     150
     151        switch (enmPlatformArch)
     152        {
     153            case PlatformArchitecture_x86:
     154            {
     155                ComPtr<IHostX86> hostX86;
     156                CHECK_ERROR(host, COMGETTER(X86)(hostX86.asOutParam()));
     157                break;
     158            }
     159
     160            default:
     161                break;
     162        }
     163    }
     164    else
     165        RTTestFailed(g_hTest, "%d: IVirtualBox::host failed", __LINE__);
     166
     167    ComPtr<ISystemProperties> sysprop;
     168    RTTestSub(g_hTest, "IVirtualBox::systemProperties");
     169    CHECK_ERROR(pVBox, COMGETTER(SystemProperties)(sysprop.asOutParam()));
     170    if (SUCCEEDED(hrc))
     171    {
     172        RTTestPassed(g_hTest, "IVirtualBox::systemProperties");
     173
     174        RTTestSub(g_hTest, "IVirtualBox::platform::::platformProperties");
     175        ComPtr<IPlatformProperties> platformprop;
     176        CHECK_ERROR(sysprop, COMGETTER(Platform)(platformprop.asOutParam()));
     177        BOOL fTemp;
     178        CHECK_ERROR(platformprop, COMGETTER(ExclusiveHwVirt)(&fTemp));
     179        ULONG ulTemp;
     180        CHECK_ERROR(platformprop, GetMaxNetworkAdapters(ChipsetType_PIIX3, &ulTemp));
     181    }
     182    else
     183        RTTestFailed(g_hTest, "%d: IVirtualBox::systemProperties failed", __LINE__);
     184
     185    /*
     186     * VM
     187     */
    131188    RTTestSub(g_hTest, "IVirtualBox::CreateMachine");
    132189    ComPtr<IMachine> ptrMachine;
     
    135192    CHECK_ERROR(pVBox, CreateMachine(NULL,                          /** Settings */
    136193                                     tstMachineName.raw(),          /** Name */
     194                                     enmPlatformArch,
    137195                                     ComSafeArrayAsInParam(groups), /** Groups */
    138196                                     NULL,                          /** OS Type */
     
    147205    {
    148206        RTTestFailed(g_hTest, "%d: IVirtualBox::CreateMachine failed", __LINE__);
    149         return FALSE;
     207        return;
    150208    }
    151209
     
    157215    {
    158216        RTTestFailed(g_hTest, "%d: IVirtualBox::RegisterMachine failed", __LINE__);
    159         return FALSE;
    160     }
    161 
    162     ComPtr<IHost> host;
    163     RTTestSub(g_hTest, "IVirtualBox::host");
    164     CHECK_ERROR(pVBox, COMGETTER(Host)(host.asOutParam()));
    165     if (SUCCEEDED(hrc))
    166     {
    167         /** @todo Add IHost testing here. */
    168         RTTestPassed(g_hTest, "IVirtualBox::host");
    169     }
    170     else
    171         RTTestFailed(g_hTest, "%d: IVirtualBox::host failed", __LINE__);
    172 
    173     ComPtr<ISystemProperties> sysprop;
    174     RTTestSub(g_hTest, "IVirtualBox::systemProperties");
    175     CHECK_ERROR(pVBox, COMGETTER(SystemProperties)(sysprop.asOutParam()));
    176     if (SUCCEEDED(hrc))
    177     {
    178         /** @todo Add ISystemProperties testing here. */
    179         RTTestPassed(g_hTest, "IVirtualBox::systemProperties");
    180     }
    181     else
    182         RTTestFailed(g_hTest, "%d: IVirtualBox::systemProperties failed", __LINE__);
     217        return;
     218    }
    183219
    184220    com::SafeIfaceArray<IMachine> machines;
    185     RTTestSub(g_hTest, "IVirtualBox::machines");
     221    RTTestSub(g_hTest, "IVirtualBox::machines2");
    186222    CHECK_ERROR(pVBox, COMGETTER(Machines)(ComSafeArrayAsOutParam(machines)));
    187223    if (SUCCEEDED(hrc))
    188224    {
    189         bool bFound = FALSE;
     225        bool fFound = FALSE;
    190226        for (size_t i = 0; i < machines.size(); ++i)
    191227        {
     
    198234                    if (tmpName == tstMachineName)
    199235                    {
    200                         bFound = TRUE;
     236                        fFound = TRUE;
    201237                        break;
    202238                    }
     
    205241        }
    206242
    207         if (bFound)
     243        if (fFound)
    208244            RTTestPassed(g_hTest, "IVirtualBox::machines");
    209245        else
     
    212248    else
    213249        RTTestFailed(g_hTest, "%d: IVirtualBox::machines failed", __LINE__);
     250
     251    RTTestSub(g_hTest, "IMachine::FirmwareSettings");
     252    ComPtr<IFirmwareSettings> ptrFirmwareSettings;
     253    CHECK_ERROR(ptrMachine, COMGETTER(FirmwareSettings)(ptrFirmwareSettings.asOutParam()));
     254    FirmwareType_T firmwareType;
     255    CHECK_ERROR(ptrFirmwareSettings, COMGETTER(FirmwareType)(&firmwareType));
     256
     257//    CHECK_ERROR(ptrMachine, LockMachine());
     258//    RTTestSub(g_hTest, "IMachine::saveSettings");
     259//    CHECK_ERROR(ptrMachine, SaveSettings());
     260
     261    Bstr bstSettingsFile;
     262    CHECK_ERROR(ptrMachine, COMGETTER(SettingsFilePath)(bstSettingsFile.asOutParam()));
     263    RTTestPrintf(g_hTest, RTTESTLVL_DEBUG, "Settings file: %ls\n", bstSettingsFile.raw());
     264//    CHECK_ERROR(ptrMachine, UnlockMachine());
    214265
    215266#if 0 /** Not yet implemented */
     
    344395    else
    345396        RTTestFailed(g_hTest, "%d: IVirtualBox::genericNetworkDrivers failed", __LINE__);
    346 
    347     return TRUE;
    348397}
    349398
    350399
    351 static BOOL tstApiClean(IVirtualBox *pVBox)
     400static void tstApiClean(IVirtualBox *pVBox)
    352401{
    353402    HRESULT hrc;
     
    355404    /** Delete created VM and its files */
    356405    ComPtr<IMachine> machine;
    357     CHECK_ERROR_RET(pVBox, FindMachine(Bstr(tstMachineName).raw(), machine.asOutParam()), FALSE);
     406    CHECK_ERROR(pVBox, FindMachine(Bstr(tstMachineName).raw(), machine.asOutParam()));
    358407    SafeIfaceArray<IMedium> media;
    359     CHECK_ERROR_RET(machine, Unregister(CleanupMode_DetachAllReturnHardDisksOnly,
    360                                     ComSafeArrayAsOutParam(media)), FALSE);
     408    CHECK_ERROR(machine, Unregister(CleanupMode_DetachAllReturnHardDisksOnly, ComSafeArrayAsOutParam(media)));
    361409    ComPtr<IProgress> progress;
    362     CHECK_ERROR_RET(machine, DeleteConfig(ComSafeArrayAsInParam(media), progress.asOutParam()), FALSE);
    363     CHECK_ERROR_RET(progress, WaitForCompletion(-1), FALSE);
    364 
    365     return TRUE;
     410    CHECK_ERROR(machine, DeleteConfig(ComSafeArrayAsInParam(media), progress.asOutParam()));
     411    CHECK_ERROR(progress, WaitForCompletion(-1));
    366412}
    367413
     
    402448                tstApiIVirtualBox(ptrVBox);
    403449
    404 
    405450                /** Clean files/configs */
    406451                tstApiClean(ptrVBox);
  • trunk/src/VBox/Main/testcase/tstVBoxAPIXPCOM.cpp

    r99775 r101035  
    198198    rc = virtualBox->CreateMachine(NULL,        /* settings file */
    199199                                   NS_LITERAL_STRING("A brand new name").get(),
     200                                   PlatformArchitecture_x86,
    200201                                   0, nsnull,   /* groups (safearray)*/
    201202                                   nsnull,      /* ostype */
  • trunk/src/VBox/Main/testcase/tstVBoxMultipleVM.cpp

    r98103 r101035  
    334334        /* Default VM settings */
    335335        CHECK_ERROR_L(pVBox, CreateMachine(NULL,                          /* Settings */
    336                                          machineName.raw(),             /* Name */
    337                                          ComSafeArrayAsInParam(groups), /* Groups */
    338                                          NULL,                          /* OS Type */
    339                                          NULL,                          /** Cipher */
    340                                          NULL,                          /** Password id */
    341                                          NULL,                          /** Password */
    342                                          NULL,                          /* Create flags */
    343                                          ptrMachine.asOutParam()));
     336                                           machineName.raw(),             /* Name */
     337                                           PlatformArchitecture_x86,
     338                                           ComSafeArrayAsInParam(groups), /* Groups */
     339                                           NULL,                          /* OS Type */
     340                                           NULL,                          /** Cipher */
     341                                           NULL,                          /** Password id */
     342                                           NULL,                          /** Password */
     343                                           NULL,                          /* Create flags */
     344                                           ptrMachine.asOutParam()));
    344345        if (SUCCEEDED(hrc))
    345346        {
  • trunk/src/VBox/Main/webservice/samples/java/jax-ws/clienttest.java

    r98103 r101035  
    100100        vbox.openSession(session, id);
    101101        IMachine mach = session.getMachine();
    102         IBIOSSettings bios = mach.getBIOSSettings();
    103         bios.setIOAPICEnabled(true);
     102        IFirmwareSettings firmware = mach.getFirmwareSettings();
     103        firmware.setIOAPICEnabled(true);
    104104        mach.saveSettings();
    105105        session.close();
  • trunk/src/VBox/Main/xml/Settings.cpp

    r99723 r101035  
    430430            else if (uMinor == 19)
    431431                sv = SettingsVersion_v1_19;
    432             else if (uMinor > 19)
     432            else if (uMinor == 20)
     433                sv = SettingsVersion_v1_20;
     434            else if (uMinor > 20)
    433435                sv = SettingsVersion_Future;
    434436        }
     
    10721074            break;
    10731075
     1076        case SettingsVersion_v1_20:
     1077            pcszVersion = "1.20";
     1078            break;
     1079
    10741080        default:
    10751081            // catch human error: the assertion below will trigger in debug
     
    10941100                // but as it's an omission of someone who changed this file
    10951101                // it's the only generic possibility.
    1096                 pcszVersion = "1.19";
    1097                 m->sv = SettingsVersion_v1_19;
     1102                pcszVersion = "1.20";
     1103                m->sv = SettingsVersion_v1_20;
    10981104            }
    10991105            break;
     
    16481654////////////////////////////////////////////////////////////////////////////////
    16491655
     1656PlatformProperties::PlatformProperties()
     1657    : fExclusiveHwVirt(true)
     1658{
     1659#if defined(RT_OS_DARWIN) || defined(RT_OS_WINDOWS) || defined(RT_OS_SOLARIS)
     1660    fExclusiveHwVirt = false; /** BUGBUG Does this apply to MacOS on ARM as well? */
     1661#endif
     1662}
     1663
    16501664/**
    16511665 * Constructor. Needs to set sane defaults which stand the test of time.
     
    16541668    : uProxyMode(ProxyMode_System)
    16551669    , uLogHistoryCount(3)
    1656     , fExclusiveHwVirt(true)
    1657 {
    1658 #if defined(RT_OS_DARWIN) || defined(RT_OS_WINDOWS) || defined(RT_OS_SOLARIS)
    1659     fExclusiveHwVirt = false;
    1660 #endif
     1670{
    16611671}
    16621672
     
    23522362                        pelmGlobalChild->getAttributeValue("autostartDatabasePath", systemProperties.strAutostartDatabasePath);
    23532363                        pelmGlobalChild->getAttributeValue("defaultFrontend", systemProperties.strDefaultFrontend);
    2354                         pelmGlobalChild->getAttributeValue("exclusiveHwVirt", systemProperties.fExclusiveHwVirt);
     2364                        if (m->sv < SettingsVersion_v1_20) /* exclusiveHwVirt was part of SystemProperties for < v1.20. */
     2365                            pelmGlobalChild->getAttributeValue("exclusiveHwVirt", platformProperties.fExclusiveHwVirt);
    23552366                        if (!pelmGlobalChild->getAttributeValue("proxyMode", systemProperties.uProxyMode))
    23562367                            fCopyProxySettingsFromExtraData = true;
    23572368                        pelmGlobalChild->getAttributeValue("proxyUrl", systemProperties.strProxyUrl);
    23582369                        pelmGlobalChild->getAttributeValue("LanguageId", systemProperties.strLanguageId);
     2370                    }
     2371                    if (   pelmGlobalChild->nameEquals("PlatformProperties")
     2372                        && m->sv >= SettingsVersion_v1_20)
     2373                    {
     2374                        /* Since settings v1.20 exclusiveHwVirt is part of PlatformProperties. */
     2375                        pelmGlobalChild->getAttributeValue("exclusiveHwVirt", platformProperties.fExclusiveHwVirt);
    23592376                    }
    23602377#ifdef VBOX_WITH_UPDATE_AGENT
     
    26502667        pelmSysProps->setAttribute("proxyUrl", systemProperties.strProxyUrl);
    26512668    pelmSysProps->setAttribute("proxyMode", systemProperties.uProxyMode);
    2652     pelmSysProps->setAttribute("exclusiveHwVirt", systemProperties.fExclusiveHwVirt);
     2669    if (m->sv >= SettingsVersion_v1_20) /* Since settings v1.20 exclusiveHwVirt is part of PlatformProperties. */
     2670    {
     2671        xml::ElementNode *pelmPlatProps = pelmGlobal->createChild("PlatformProperties");
     2672        pelmPlatProps->setAttribute("exclusiveHwVirt", platformProperties.fExclusiveHwVirt);
     2673    }
     2674    else
     2675        pelmSysProps->setAttribute("exclusiveHwVirt", platformProperties.fExclusiveHwVirt);
    26532676    if (systemProperties.strLanguageId.isNotEmpty())
    26542677        pelmSysProps->setAttribute("LanguageId", systemProperties.strLanguageId);
     
    27262749 * Constructor. Needs to set sane defaults which stand the test of time.
    27272750 */
    2728 BIOSSettings::BIOSSettings() :
     2751FirmwareSettings::FirmwareSettings() :
     2752    firmwareType(FirmwareType_BIOS),
    27292753    fACPIEnabled(true),
    27302754    fIOAPICEnabled(false),
     
    27342758    fSmbiosUuidLittleEndian(true),
    27352759    ulLogoDisplayTime(0),
    2736     biosBootMenuMode(BIOSBootMenuMode_MessageAndMenu),
     2760    enmBootMenuMode(FirmwareBootMenuMode_MessageAndMenu),
    27372761    apicMode(APICMode_APIC),
    27382762    llTimeOffset(0)
     
    27412765
    27422766/**
    2743  * Check if all settings have default values.
    2744  */
    2745 bool BIOSSettings::areDefaultSettings() const
    2746 {
    2747     return fACPIEnabled
    2748         && !fIOAPICEnabled
    2749         && fLogoFadeIn
    2750         && fLogoFadeOut
    2751         && !fPXEDebugEnabled
    2752         && !fSmbiosUuidLittleEndian
    2753         && ulLogoDisplayTime == 0
    2754         && biosBootMenuMode == BIOSBootMenuMode_MessageAndMenu
    2755         && apicMode == APICMode_APIC
    2756         && llTimeOffset == 0
    2757         && strLogoImagePath.isEmpty();
     2767 * Returns if all settings have default values.
     2768 *
     2769 * @returns \c true if all settings have default values, \c false if not.
     2770 * @param   enmCPUArch              CPU architecture to use for checking the default values for.
     2771 */
     2772bool FirmwareSettings::areDefaultSettings(CPUArchitecture_T enmCPUArch) const
     2773{
     2774    switch (enmCPUArch)
     2775    {
     2776        case CPUArchitecture_x86:
     2777            RT_FALL_THROUGH();
     2778        case CPUArchitecture_AMD64:
     2779            return
     2780                   firmwareType == FirmwareType_BIOS
     2781                && !fIOAPICEnabled
     2782                && fLogoFadeIn
     2783                && fLogoFadeOut
     2784                && !fPXEDebugEnabled
     2785                && !fSmbiosUuidLittleEndian
     2786                && ulLogoDisplayTime == 0
     2787                && enmBootMenuMode == FirmwareBootMenuMode_MessageAndMenu
     2788                && apicMode == APICMode_APIC
     2789                && llTimeOffset == 0
     2790                && strLogoImagePath.isEmpty();
     2791
     2792        case CPUArchitecture_ARMv8_32:
     2793            RT_FALL_THROUGH();
     2794        case CPUArchitecture_ARMv8_64:
     2795            return
     2796                   (    enmCPUArch == CPUArchitecture_ARMv8_32
     2797                    ? firmwareType == FirmwareType_EFI32
     2798                    : firmwareType == FirmwareType_EFI64)
     2799                && !fIOAPICEnabled
     2800                && fLogoFadeIn
     2801                && fLogoFadeOut
     2802                && !fPXEDebugEnabled
     2803                && !fSmbiosUuidLittleEndian
     2804                && ulLogoDisplayTime == 0
     2805                && enmBootMenuMode == FirmwareBootMenuMode_MessageAndMenu
     2806                && apicMode == APICMode_APIC
     2807                && llTimeOffset == 0
     2808                && strLogoImagePath.isEmpty();
     2809            break;
     2810
     2811        default:
     2812            break;
     2813    }
     2814
     2815    AssertFailedReturn(false);
    27582816}
    27592817
     
    27632821 * machine settings have really changed and thus need to be written out to disk.
    27642822 */
    2765 bool BIOSSettings::operator==(const BIOSSettings &d) const
     2823bool FirmwareSettings::operator==(const FirmwareSettings &d) const
    27662824{
    27672825    return (this == &d)
    2768         || (   fACPIEnabled            == d.fACPIEnabled
     2826        || (   firmwareType            == d.firmwareType
     2827            && fACPIEnabled            == d.fACPIEnabled
    27692828            && fIOAPICEnabled          == d.fIOAPICEnabled
    27702829            && fLogoFadeIn             == d.fLogoFadeIn
     
    27732832            && fSmbiosUuidLittleEndian == d.fSmbiosUuidLittleEndian
    27742833            && ulLogoDisplayTime       == d.ulLogoDisplayTime
    2775             && biosBootMenuMode        == d.biosBootMenuMode
     2834            && enmBootMenuMode        == d.enmBootMenuMode
    27762835            && apicMode                == d.apicMode
    27772836            && llTimeOffset            == d.llTimeOffset
     
    36293688    ulSlot(0),
    36303689    fEnabled(false),
    3631     ulIOBase(0x3f8),
     3690    ulIOAddress(0x3f8),
    36323691    ulIRQ(4),
    36333692    portMode(PortMode_Disconnected),
     
    36473706        || (   ulSlot            == s.ulSlot
    36483707            && fEnabled          == s.fEnabled
    3649             && ulIOBase          == s.ulIOBase
     3708            && ulIOAddress       == s.ulIOAddress
    36503709            && ulIRQ             == s.ulIRQ
    36513710            && portMode          == s.portMode
     
    37743833 * Constructor. Needs to set sane defaults which stand the test of time.
    37753834 */
    3776 CpuIdLeaf::CpuIdLeaf() :
     3835CpuIdLeafX86::CpuIdLeafX86() :
    37773836    idx(UINT32_MAX),
    37783837    idxSub(0),
     
    37893848 * machine settings have really changed and thus need to be written out to disk.
    37903849 */
    3791 bool CpuIdLeaf::operator==(const CpuIdLeaf &c) const
     3850bool CpuIdLeafX86::operator==(const CpuIdLeafX86 &c) const
    37923851{
    37933852    return (this == &c)
     
    39033962}
    39043963
    3905 
    3906 /**
    3907  * Constructor. Needs to set sane defaults which stand the test of time.
    3908  */
    3909 Hardware::Hardware() :
    3910     strVersion("1"),
    3911     fHardwareVirt(true),
    3912     fNestedPaging(true),
    3913     fVPID(true),
    3914     fUnrestrictedExecution(true),
    3915     fHardwareVirtForce(false),
    3916     fUseNativeApi(false),
    3917     fTripleFaultReset(false),
     3964#ifdef VBOX_WITH_VIRT_ARMV8
     3965PlatformARM::PlatformARM()
     3966    /** @todo BUGBUG Anything for ARM here? */
     3967{
     3968
     3969}
     3970
     3971bool PlatformARM::operator==(const PlatformARM& h) const
     3972{
     3973    RT_NOREF(h);
     3974    return true; /** @todo BUGBUG Anything for ARM here? */
     3975}
     3976#endif /* VBOX_WITH_VIRT_ARMV8 */
     3977
     3978PlatformX86::PlatformX86() :
    39183979    fPAE(false),
    39193980    fAPIC(true),
    39203981    fX2APIC(false),
     3982    fHPETEnabled(false),
     3983    enmLongMode(HC_ARCH_BITS == 64 ? PlatformX86::LongMode_Enabled : PlatformX86::LongMode_Disabled),
     3984    fTripleFaultReset(false),
    39213985    fIBPBOnVMExit(false),
    39223986    fIBPBOnVMEntry(false),
     
    39273991    fMDSClearOnSched(true),
    39283992    fMDSClearOnVMEntry(false),
    3929     fNestedHWVirt(false),
    3930     fVirtVmsaveVmload(true),
    3931     enmLongMode(HC_ARCH_BITS == 64 ? Hardware::LongMode_Enabled : Hardware::LongMode_Disabled),
     3993    fHWVirtEx(true),
     3994    fHWVirtExNestedPaging(true),
     3995    fHWVirtExVPID(true),
     3996    fHWVirtExUX(true),
     3997    fHWVirtExForce(false),
     3998    fHWVirtExUseNativeApi(false),
     3999    fHWVirtExVirtVmsaveVmload(true),
     4000    fNestedHWVirt(false)
     4001{
     4002    /* The default value for PAE depends on the host:
     4003     * - 64 bits host -> always true
     4004     * - 32 bits host -> true for Windows & Darwin (masked off if the host cpu doesn't support it anyway)
     4005     */
     4006#if HC_ARCH_BITS == 64 || defined(RT_OS_WINDOWS) || defined(RT_OS_DARWIN)
     4007    fPAE = true;
     4008#endif
     4009
     4010    /* The default value of large page supports depends on the host:
     4011     * - 64 bits host -> true, unless it's Linux (pending further prediction work due to excessively expensive large page allocations)
     4012     * - 32 bits host -> false
     4013     */
     4014#if HC_ARCH_BITS == 64 && !defined(RT_OS_LINUX)
     4015    fHWVirtExLargePages = true; /** @todo BUGBUG Does this apply for ARM as well? */
     4016#else
     4017    /* Not supported on 32 bits hosts. */
     4018    fHWVirtExLargePages = false;
     4019#endif
     4020}
     4021
     4022/**
     4023 * Comparison operator. This gets called from MachineConfigFile::operator==,
     4024 * which in turn gets called from Platform::saveSettings to figure out whether
     4025 * machine settings have really changed and thus need to be written out to disk.
     4026 */
     4027bool PlatformX86::operator==(const PlatformX86& h) const
     4028{
     4029    return (this == &h)
     4030        || (   fPAE                         == h.fPAE
     4031            && fAPIC                        == h.fAPIC
     4032            && fX2APIC                      == h.fX2APIC
     4033            && fHPETEnabled                 == h.fHPETEnabled
     4034            && enmLongMode                  == h.enmLongMode
     4035            && llCpuIdLeafs                 == h.llCpuIdLeafs
     4036            && fTripleFaultReset            == h.fTripleFaultReset
     4037            && fIBPBOnVMExit                == h.fIBPBOnVMExit
     4038            && fIBPBOnVMEntry               == h.fIBPBOnVMEntry
     4039            && fSpecCtrl                    == h.fSpecCtrl
     4040            && fSpecCtrlByHost              == h.fSpecCtrlByHost
     4041            && fL1DFlushOnSched             == h.fL1DFlushOnSched
     4042            && fL1DFlushOnVMEntry           == h.fL1DFlushOnVMEntry
     4043            && fMDSClearOnSched             == h.fMDSClearOnSched
     4044            && fMDSClearOnVMEntry           == h.fMDSClearOnVMEntry
     4045            && fHWVirtEx                    == h.fHWVirtEx
     4046            && fHWVirtExNestedPaging        == h.fHWVirtExNestedPaging
     4047            && fHWVirtExLargePages          == h.fHWVirtExLargePages
     4048            && fHWVirtExVPID                == h.fHWVirtExVPID
     4049            && fHWVirtExUX                  == h.fHWVirtExUX
     4050            && fHWVirtExForce               == h.fHWVirtExForce
     4051            && fHWVirtExUseNativeApi        == h.fHWVirtExUseNativeApi
     4052            && fHWVirtExVirtVmsaveVmload    == h.fHWVirtExVirtVmsaveVmload
     4053            && fNestedHWVirt                == h.fNestedHWVirt);
     4054}
     4055
     4056/**
     4057 * Constructor. Needs to set sane defaults which stand the test of time.
     4058 */
     4059Platform::Platform() :
     4060    architectureType(PlatformArchitecture_x86), /* We default to x86 here, as this is what we ever had so far. */
     4061    chipsetType(ChipsetType_PIIX3),
     4062    iommuType(IommuType_None),
     4063    fRTCUseUTC(false)
     4064{
     4065}
     4066
     4067/**
     4068 * Comparison operator. This gets called from MachineConfigFile::operator==,
     4069 * which in turn gets called from Platform::saveSettings to figure out whether
     4070 * machine settings have really changed and thus need to be written out to disk.
     4071 */
     4072bool Platform::operator==(const Platform& h) const
     4073{
     4074    bool fRc = (this == &h)
     4075            || (   architectureType == h.architectureType
     4076                && chipsetType      == h.chipsetType
     4077                && iommuType        == h.iommuType
     4078                && fRTCUseUTC       == h.fRTCUseUTC);
     4079    if (fRc)
     4080    {
     4081        switch (architectureType)
     4082        {
     4083            case PlatformArchitecture_x86:
     4084                return x86 == h.x86;
     4085#ifdef VBOX_WITH_VIRT_ARMV8
     4086            case PlatformArchitecture_ARM:
     4087                return arm == h.arm;
     4088#endif
     4089            default:
     4090                AssertFailedReturn(false);
     4091        }
     4092    }
     4093
     4094    return fRc;
     4095}
     4096
     4097/**
     4098 * Constructor. Needs to set sane defaults which stand the test of time.
     4099 */
     4100Hardware::Hardware() :
     4101    strVersion("1"),
    39324102    cCPUs(1),
    39334103    fCpuHotPlug(false),
    3934     fHPETEnabled(false),
    39354104    ulCpuExecutionCap(100),
    39364105    uCpuIdPortabilityLevel(0),
    39374106    strCpuProfile("host"),
    39384107    ulMemorySizeMB((uint32_t)-1),
    3939     firmwareType(FirmwareType_BIOS),
    39404108    pointingHIDType(PointingHIDType_PS2Mouse),
    39414109    keyboardHIDType(KeyboardHIDType_PS2Keyboard),
    3942     chipsetType(ChipsetType_PIIX3),
    3943     iommuType(IommuType_None),
    39444110    paravirtProvider(ParavirtProvider_Legacy), // default for old VMs, for new ones it's ParavirtProvider_Default
    39454111    strParavirtDebug(""),
     
    39514117    fPageFusionEnabled(false)
    39524118{
    3953     mapBootOrder[0] = DeviceType_Floppy;
     4119    mapBootOrder[0] = DeviceType_Floppy; /** @todo BUGBUG Handle ARM. */
    39544120    mapBootOrder[1] = DeviceType_DVD;
    39554121    mapBootOrder[2] = DeviceType_HardDisk;
    3956 
    3957     /* The default value for PAE depends on the host:
    3958      * - 64 bits host -> always true
    3959      * - 32 bits host -> true for Windows & Darwin (masked off if the host cpu doesn't support it anyway)
    3960      */
    3961 #if HC_ARCH_BITS == 64 || defined(RT_OS_WINDOWS) || defined(RT_OS_DARWIN)
    3962     fPAE = true;
    3963 #endif
    3964 
    3965     /* The default value of large page supports depends on the host:
    3966      * - 64 bits host -> true, unless it's Linux (pending further prediction work due to excessively expensive large page allocations)
    3967      * - 32 bits host -> false
    3968      */
    3969 #if HC_ARCH_BITS == 64 && !defined(RT_OS_LINUX)
    3970     fLargePages = true;
    3971 #else
    3972     /* Not supported on 32 bits hosts. */
    3973     fLargePages = false;
    3974 #endif
    39754122}
    39764123
     
    40304177        || (   strVersion                     == h.strVersion
    40314178            && uuid                           == h.uuid
    4032             && fHardwareVirt                  == h.fHardwareVirt
    4033             && fNestedPaging                  == h.fNestedPaging
    4034             && fLargePages                    == h.fLargePages
    4035             && fVPID                          == h.fVPID
    4036             && fUnrestrictedExecution         == h.fUnrestrictedExecution
    4037             && fHardwareVirtForce             == h.fHardwareVirtForce
    4038             && fUseNativeApi                  == h.fUseNativeApi
    4039             && fPAE                           == h.fPAE
    4040             && enmLongMode                    == h.enmLongMode
    4041             && fTripleFaultReset              == h.fTripleFaultReset
    4042             && fAPIC                          == h.fAPIC
    4043             && fX2APIC                        == h.fX2APIC
    4044             && fIBPBOnVMExit                  == h.fIBPBOnVMExit
    4045             && fIBPBOnVMEntry                 == h.fIBPBOnVMEntry
    4046             && fSpecCtrl                      == h.fSpecCtrl
    4047             && fSpecCtrlByHost                == h.fSpecCtrlByHost
    4048             && fL1DFlushOnSched               == h.fL1DFlushOnSched
    4049             && fL1DFlushOnVMEntry             == h.fL1DFlushOnVMEntry
    4050             && fMDSClearOnSched               == h.fMDSClearOnSched
    4051             && fMDSClearOnVMEntry             == h.fMDSClearOnVMEntry
    4052             && fNestedHWVirt                  == h.fNestedHWVirt
    4053             && fVirtVmsaveVmload              == h.fVirtVmsaveVmload
    40544179            && cCPUs                          == h.cCPUs
    40554180            && fCpuHotPlug                    == h.fCpuHotPlug
     
    40574182            && uCpuIdPortabilityLevel         == h.uCpuIdPortabilityLevel
    40584183            && strCpuProfile                  == h.strCpuProfile
    4059             && fHPETEnabled                   == h.fHPETEnabled
    40604184            && llCpus                         == h.llCpus
    4061             && llCpuIdLeafs                   == h.llCpuIdLeafs
    40624185            && ulMemorySizeMB                 == h.ulMemorySizeMB
    40634186            && mapBootOrder                   == h.mapBootOrder
    4064             && firmwareType                   == h.firmwareType
    40654187            && pointingHIDType                == h.pointingHIDType
    40664188            && keyboardHIDType                == h.keyboardHIDType
    4067             && chipsetType                    == h.chipsetType
    4068             && iommuType                      == h.iommuType
    40694189            && paravirtProvider               == h.paravirtProvider
    40704190            && strParavirtDebug               == h.strParavirtDebug
    40714191            && fEmulatedUSBCardReader         == h.fEmulatedUSBCardReader
    40724192            && vrdeSettings                   == h.vrdeSettings
    4073             && biosSettings                   == h.biosSettings
     4193            && platformSettings               == h.platformSettings
     4194            && firmwareSettings               == h.firmwareSettings
    40744195            && nvramSettings                  == h.nvramSettings
    40754196            && graphicsAdapter                == h.graphicsAdapter
     
    42864407    fTeleporterEnabled(false),
    42874408    uTeleporterPort(0),
    4288     fRTCUseUTC(false),
    42894409    enmVMPriority(VMProcPriority_Default)
    42904410{
     
    43114431            && strTeleporterAddress       == c.strTeleporterAddress
    43124432            && strTeleporterPassword      == c.strTeleporterPassword
    4313             && fRTCUseUTC                 == c.fRTCUseUTC
    43144433            && ovIcon                     == c.ovIcon
    43154434            && enmVMPriority              == c.enmVMPriority);
     
    44614580
    44624581/**
    4463  * Called from MachineConfigFile::readHardware() to read cpu information.
     4582 * Called from MachineConfigFile::readHardware() to read CPU information.
     4583 *
    44644584 * @param elmCpu
    44654585 * @param ll
     
    44824602
    44834603/**
    4484  * Called from MachineConfigFile::readHardware() to cpuid information.
     4604 * Called from MachineConfigFile::readPlatformX86() to read x86 CPUID information.
     4605 *
    44854606 * @param elmCpuid
    44864607 * @param ll
    44874608 */
    4488 void MachineConfigFile::readCpuIdTree(const xml::ElementNode &elmCpuid,
    4489                                       CpuIdLeafsList &ll)
     4609void MachineConfigFile::readCpuIdTreeX86(const xml::ElementNode &elmCpuid,
     4610                                         CpuIdLeafsX86List &ll)
    44904611{
    44914612    xml::NodesLoop nl1(elmCpuid, "CpuIdLeaf");
     
    44934614    while ((pelmCpuIdLeaf = nl1.forAllNodes()))
    44944615    {
    4495         CpuIdLeaf leaf;
     4616        CpuIdLeafX86 leaf;
    44964617
    44974618        if (!pelmCpuIdLeaf->getAttributeValue("id", leaf.idx))
    4498             throw ConfigFileError(this, pelmCpuIdLeaf, N_("Required CpuId/@id attribute is missing"));
     4619            throw ConfigFileError(this, pelmCpuIdLeaf, N_("Required CpuIdLeaf/@id attribute is missing"));
    44994620
    45004621        if (!pelmCpuIdLeaf->getAttributeValue("subleaf", leaf.idxSub))
     
    47894910        if (!pelmPort->getAttributeValue("enabled", port.fEnabled))
    47904911            throw ConfigFileError(this, pelmPort, N_("Required UART/Port/@enabled attribute is missing"));
    4791         if (!pelmPort->getAttributeValue("IOBase", port.ulIOBase))
    4792             throw ConfigFileError(this, pelmPort, N_("Required UART/Port/@IOBase attribute is missing"));
     4912        if (m->sv >= SettingsVersion_v1_20) /* IOBase was changed to IOAddress since settings v1.20. */
     4913        {
     4914            if (!pelmPort->getAttributeValue("IOAddress", port.ulIOAddress))
     4915               throw ConfigFileError(this, pelmPort, N_("Required UART/Port/@IOAddress attribute is missing"));
     4916        }
     4917        else /* Settings < v1.20. */
     4918        {
     4919            if (!pelmPort->getAttributeValue("IOBase", port.ulIOAddress))
     4920               throw ConfigFileError(this, pelmPort, N_("Required UART/Port/@IOBase attribute is missing"));
     4921        }
    47934922        if (!pelmPort->getAttributeValue("IRQ", port.ulIRQ))
    47944923            throw ConfigFileError(this, pelmPort, N_("Required UART/Port/@IRQ attribute is missing"));
     
    50595188
    50605189/**
     5190 * Reads the x86 CPUID tree.
     5191 *
     5192 * For settings >= v1.20 these were stored under the "Platform/x86/CPU" node.
     5193 * For settings <  v1.20 these were stored under the "Hardware/CPU" node.
     5194 *
     5195 * @param elmPlatformOrHardware     Platform or Hardware node to read from.
     5196 * @param platX86                   Where to store the platform settings.
     5197 */
     5198void MachineConfigFile::readPlatformCPUIDTreeX86(const xml::ElementNode &elmChild,
     5199                                                 PlatformX86 &platX86)
     5200{
     5201    const xml::ElementNode *pelmCPUChild;
     5202    if ((pelmCPUChild = elmChild.findChildElement("CpuIdTree")))
     5203        readCpuIdTreeX86(*pelmCPUChild, platX86.llCpuIdLeafs);
     5204}
     5205
     5206/**
     5207 * Reads the x86 platform settings.
     5208 *
     5209 * For settings >= v1.20 these were stored under the "Platform/x86" node.
     5210 * For settings <  v1.20 these were stored under the "Hardware" node.
     5211 *
     5212 * @param elmPlatformX86OrHardware  Platform/x86 or Hardware node to read from.
     5213 * @param platX86                   Where to store the x86 platform settings.
     5214 */
     5215void MachineConfigFile::readPlatformX86(const xml::ElementNode &elmPlatformX86OrHardware,
     5216                                        PlatformX86 &platX86)
     5217{
     5218    xml::NodesLoop nl1(elmPlatformX86OrHardware);
     5219
     5220    const xml::ElementNode *pelChild;
     5221    while ((pelChild = nl1.forAllNodes()))
     5222    {
     5223        if (pelChild->nameEquals("HPET"))
     5224        {
     5225            pelChild->getAttributeValue("enabled", platX86.fHPETEnabled);
     5226        }
     5227        else if (pelChild->nameEquals("CPU"))
     5228        {
     5229            const xml::ElementNode *pelmCPUChild;
     5230            if ((pelmCPUChild = pelChild->findChildElement("HardwareVirtEx")))
     5231                pelmCPUChild->getAttributeValue("enabled", platX86.fHWVirtEx);
     5232            if ((pelmCPUChild = pelChild->findChildElement("HardwareVirtExNestedPaging")))
     5233                pelmCPUChild->getAttributeValue("enabled", platX86.fHWVirtExNestedPaging);
     5234            if ((pelmCPUChild = pelChild->findChildElement("HardwareVirtExLargePages")))
     5235                pelmCPUChild->getAttributeValue("enabled", platX86.fHWVirtExLargePages);
     5236            if ((pelmCPUChild = pelChild->findChildElement("HardwareVirtExVPID")))
     5237                pelmCPUChild->getAttributeValue("enabled", platX86.fHWVirtExVPID);
     5238            if ((pelmCPUChild = pelChild->findChildElement("HardwareVirtExUX")))
     5239                pelmCPUChild->getAttributeValue("enabled", platX86.fHWVirtExUX);
     5240            if ((pelmCPUChild = pelChild->findChildElement("HardwareVirtForce")))
     5241                pelmCPUChild->getAttributeValue("enabled", platX86.fHWVirtExForce);
     5242            if ((pelmCPUChild = pelChild->findChildElement("HardwareVirtExUseNativeApi")))
     5243                pelmCPUChild->getAttributeValue("enabled", platX86.fHWVirtExUseNativeApi);
     5244            if ((pelmCPUChild = pelChild->findChildElement("HardwareVirtExVirtVmsaveVmload")))
     5245                pelmCPUChild->getAttributeValue("enabled", platX86.fHWVirtExVirtVmsaveVmload);
     5246
     5247            if (!(pelmCPUChild = pelChild->findChildElement("PAE")))
     5248            {
     5249                /* The default for pre 3.1 was false, so we must respect that. */
     5250                if (m->sv < SettingsVersion_v1_9)
     5251                    platX86.fPAE = false;
     5252            }
     5253            else
     5254                pelmCPUChild->getAttributeValue("enabled", platX86.fPAE);
     5255
     5256            bool fLongMode;
     5257            if (   (pelmCPUChild = pelChild->findChildElement("LongMode"))
     5258                && pelmCPUChild->getAttributeValue("enabled", fLongMode) )
     5259                platX86.enmLongMode = fLongMode ? PlatformX86::LongMode_Enabled : PlatformX86::LongMode_Disabled;
     5260            else
     5261                platX86.enmLongMode = PlatformX86::LongMode_Legacy;
     5262
     5263            if ((pelmCPUChild = pelChild->findChildElement("TripleFaultReset")))
     5264                pelmCPUChild->getAttributeValue("enabled", platX86.fTripleFaultReset);
     5265            if ((pelmCPUChild = pelChild->findChildElement("APIC")))
     5266                pelmCPUChild->getAttributeValue("enabled", platX86.fAPIC);
     5267            if ((pelmCPUChild = pelChild->findChildElement("X2APIC")))
     5268                pelmCPUChild->getAttributeValue("enabled", platX86.fX2APIC);
     5269
     5270            if ((pelmCPUChild = pelChild->findChildElement("IBPBOn")))
     5271            {
     5272                pelmCPUChild->getAttributeValue("vmexit", platX86.fIBPBOnVMExit);
     5273                pelmCPUChild->getAttributeValue("vmentry", platX86.fIBPBOnVMEntry);
     5274            }
     5275            if ((pelmCPUChild = pelChild->findChildElement("SpecCtrl")))
     5276                pelmCPUChild->getAttributeValue("enabled", platX86.fSpecCtrl);
     5277            if ((pelmCPUChild = pelChild->findChildElement("SpecCtrlByHost")))
     5278                pelmCPUChild->getAttributeValue("enabled", platX86.fSpecCtrlByHost);
     5279            if ((pelmCPUChild = pelChild->findChildElement("L1DFlushOn")))
     5280            {
     5281                pelmCPUChild->getAttributeValue("scheduling", platX86.fL1DFlushOnSched);
     5282                pelmCPUChild->getAttributeValue("vmentry", platX86.fL1DFlushOnVMEntry);
     5283            }
     5284            if ((pelmCPUChild = pelChild->findChildElement("MDSClearOn")))
     5285            {
     5286                pelmCPUChild->getAttributeValue("scheduling", platX86.fMDSClearOnSched);
     5287                pelmCPUChild->getAttributeValue("vmentry", platX86.fMDSClearOnVMEntry);
     5288            }
     5289            if ((pelmCPUChild = pelChild->findChildElement("NestedHWVirt")))
     5290                pelmCPUChild->getAttributeValue("enabled", platX86.fNestedHWVirt);
     5291
     5292            readPlatformCPUIDTreeX86(*pelChild, platX86);
     5293        }
     5294    }
     5295}
     5296
     5297/**
     5298 * Reads the platform settings.
     5299 *
     5300 * For settings >= v1.20 (>= VirtualBox 7.1) these were stored under the "Platform" node.
     5301 * For settings <  v1.20 (<= VirtualBox 7.0) these were stored under the "Hardware" node.
     5302 *
     5303 * @param elmPlatformOrHardware     Platform or Hardware node to read from.
     5304 * @param plat                      Where to store the platform settings.
     5305 */
     5306void MachineConfigFile::readPlatform(const xml::ElementNode &elmPlatformOrHardware,
     5307                                     Platform &plat)
     5308{
     5309    /*
     5310     * Platform-generic stuff.
     5311     */
     5312    xml::NodesLoop nl1(elmPlatformOrHardware);
     5313    const xml::ElementNode *pelmChild;
     5314    while ((pelmChild = nl1.forAllNodes()))
     5315    {
     5316        if (pelmChild->nameEquals("Chipset"))
     5317        {
     5318            Utf8Str strChipsetType;
     5319            if (pelmChild->getAttributeValue("type", strChipsetType))
     5320            {
     5321                if (strChipsetType == "PIIX3")
     5322                    plat.chipsetType = ChipsetType_PIIX3;
     5323                else if (strChipsetType == "ICH9")
     5324                    plat.chipsetType = ChipsetType_ICH9;
     5325                else if (strChipsetType == "ARMv8Virtual")
     5326                    plat.chipsetType = ChipsetType_ARMv8Virtual;
     5327                else
     5328                    throw ConfigFileError(this,
     5329                                          pelmChild,
     5330                                          N_("Invalid value '%s' in Chipset/@type"),
     5331                                          strChipsetType.c_str());
     5332            }
     5333        }
     5334        else if (pelmChild->nameEquals("Iommu"))
     5335        {
     5336            Utf8Str strIommuType;
     5337            if (pelmChild->getAttributeValue("type", strIommuType))
     5338            {
     5339                if (strIommuType == "None")
     5340                    plat.iommuType = IommuType_None;
     5341                else if (strIommuType == "Automatic")
     5342                    plat.iommuType = IommuType_Automatic;
     5343                else if (strIommuType == "AMD")
     5344                    plat.iommuType = IommuType_AMD;
     5345                else if (strIommuType == "Intel")
     5346                    plat.iommuType = IommuType_Intel;
     5347                else
     5348                    throw ConfigFileError(this,
     5349                                          pelmChild,
     5350                                          N_("Invalid value '%s' in Iommu/@type"),
     5351                                          strIommuType.c_str());
     5352            }
     5353        }
     5354        else if (pelmChild->nameEquals("RTC"))
     5355        {
     5356            Utf8Str strLocalOrUTC;
     5357            plat.fRTCUseUTC =    pelmChild->getAttributeValue("localOrUTC", strLocalOrUTC)
     5358                              && strLocalOrUTC == "UTC";
     5359        }
     5360    }
     5361
     5362    if (m->sv >= SettingsVersion_v1_20) /* Settings v1.20 introduced platform architecture support. */
     5363    {
     5364        Utf8Str strArch;
     5365        if (elmPlatformOrHardware.getAttributeValue("architecture", strArch))
     5366        {
     5367            if (strArch.equalsIgnoreCase("x86"))
     5368                plat.architectureType = PlatformArchitecture_x86;
     5369            else if (strArch.equalsIgnoreCase("ARM"))
     5370                plat.architectureType = PlatformArchitecture_ARM;
     5371            else
     5372                throw ConfigFileError(this,
     5373                                      &elmPlatformOrHardware,
     5374                                      N_("Platform/@architecture '%s' invalid"), strArch.c_str());
     5375        }
     5376        else
     5377            throw ConfigFileError(this, &elmPlatformOrHardware, N_("Platform/@architecture missing"));
     5378    }
     5379
     5380    /*
     5381     * Platform-specific stuff.
     5382     */
     5383    switch (plat.architectureType)
     5384    {
     5385        case PlatformArchitecture_x86:
     5386        {
     5387            const xml::ElementNode *pelmPlatformX86OrHardware;
     5388            if (m->sv >= SettingsVersion_v1_20) /* Settings v1.20 introduced platform support with a x86 sub node. */
     5389            {
     5390                pelmPlatformX86OrHardware = elmPlatformOrHardware.findChildElement("x86");
     5391                if (!pelmPlatformX86OrHardware)
     5392                    throw ConfigFileError(this, &elmPlatformOrHardware, N_("Required Platform/@x86 element is missing"));
     5393            }
     5394            else /* For settings < v1.20 we stored everyhing in the Hardware node. */
     5395                pelmPlatformX86OrHardware = &elmPlatformOrHardware;
     5396
     5397            readPlatformX86(*pelmPlatformX86OrHardware, plat.x86);
     5398            break;
     5399        }
     5400
     5401#ifdef VBOX_WITH_VIRT_ARMV8
     5402        case PlatformArchitecture_ARM:
     5403        {
     5404            /** @todo BUGBUG Implement loading ARM platform stuff here. */
     5405            break;
     5406        }
     5407#endif
     5408        default:
     5409            AssertFailed();
     5410            break;
     5411    }
     5412}
     5413
     5414/**
    50615415 * Reads in a \<Hardware\> block and stores it in the given structure. Used
    50625416 * both directly from readMachine and from readSnapshot, since snapshots
     
    51345488            }
    51355489
    5136             if ((pelmCPUChild = pelmHwChild->findChildElement("HardwareVirtEx")))
    5137             {
    5138                 pelmCPUChild->getAttributeValue("enabled", hw.fHardwareVirt);
    5139             }
    5140             if ((pelmCPUChild = pelmHwChild->findChildElement("HardwareVirtExNestedPaging")))
    5141                 pelmCPUChild->getAttributeValue("enabled", hw.fNestedPaging);
    5142             if ((pelmCPUChild = pelmHwChild->findChildElement("HardwareVirtExLargePages")))
    5143                 pelmCPUChild->getAttributeValue("enabled", hw.fLargePages);
    5144             if ((pelmCPUChild = pelmHwChild->findChildElement("HardwareVirtExVPID")))
    5145                 pelmCPUChild->getAttributeValue("enabled", hw.fVPID);
    5146             if ((pelmCPUChild = pelmHwChild->findChildElement("HardwareVirtExUX")))
    5147                 pelmCPUChild->getAttributeValue("enabled", hw.fUnrestrictedExecution);
    5148             if ((pelmCPUChild = pelmHwChild->findChildElement("HardwareVirtForce")))
    5149                 pelmCPUChild->getAttributeValue("enabled", hw.fHardwareVirtForce);
    5150             if ((pelmCPUChild = pelmHwChild->findChildElement("HardwareVirtExUseNativeApi")))
    5151                 pelmCPUChild->getAttributeValue("enabled", hw.fUseNativeApi);
    5152             if ((pelmCPUChild = pelmHwChild->findChildElement("HardwareVirtExVirtVmsaveVmload")))
    5153                 pelmCPUChild->getAttributeValue("enabled", hw.fVirtVmsaveVmload);
    5154 
    5155             if (!(pelmCPUChild = pelmHwChild->findChildElement("PAE")))
    5156             {
    5157                 /* The default for pre 3.1 was false, so we must respect that. */
    5158                 if (m->sv < SettingsVersion_v1_9)
    5159                     hw.fPAE = false;
    5160             }
    5161             else
    5162                 pelmCPUChild->getAttributeValue("enabled", hw.fPAE);
    5163 
    5164             bool fLongMode;
    5165             if (   (pelmCPUChild = pelmHwChild->findChildElement("LongMode"))
    5166                 && pelmCPUChild->getAttributeValue("enabled", fLongMode) )
    5167                 hw.enmLongMode = fLongMode ? Hardware::LongMode_Enabled : Hardware::LongMode_Disabled;
    5168             else
    5169                 hw.enmLongMode = Hardware::LongMode_Legacy;
    5170 
    51715490            if ((pelmCPUChild = pelmHwChild->findChildElement("SyntheticCpu")))
    51725491            {
     
    51775496            pelmHwChild->getAttributeValue("CpuIdPortabilityLevel", hw.uCpuIdPortabilityLevel);
    51785497            pelmHwChild->getAttributeValue("CpuProfile", hw.strCpuProfile);
    5179 
    5180             if ((pelmCPUChild = pelmHwChild->findChildElement("TripleFaultReset")))
    5181                 pelmCPUChild->getAttributeValue("enabled", hw.fTripleFaultReset);
    5182 
    5183             if ((pelmCPUChild = pelmHwChild->findChildElement("APIC")))
    5184                 pelmCPUChild->getAttributeValue("enabled", hw.fAPIC);
    5185             if ((pelmCPUChild = pelmHwChild->findChildElement("X2APIC")))
    5186                 pelmCPUChild->getAttributeValue("enabled", hw.fX2APIC);
    5187             if (hw.fX2APIC)
    5188                 hw.fAPIC = true;
    5189             pelmCPUChild = pelmHwChild->findChildElement("IBPBOn");
    5190             if (pelmCPUChild)
    5191             {
    5192                 pelmCPUChild->getAttributeValue("vmexit", hw.fIBPBOnVMExit);
    5193                 pelmCPUChild->getAttributeValue("vmentry", hw.fIBPBOnVMEntry);
    5194             }
    5195             pelmCPUChild = pelmHwChild->findChildElement("SpecCtrl");
    5196             if (pelmCPUChild)
    5197                 pelmCPUChild->getAttributeValue("enabled", hw.fSpecCtrl);
    5198             pelmCPUChild = pelmHwChild->findChildElement("SpecCtrlByHost");
    5199             if (pelmCPUChild)
    5200                 pelmCPUChild->getAttributeValue("enabled", hw.fSpecCtrlByHost);
    5201             pelmCPUChild = pelmHwChild->findChildElement("L1DFlushOn");
    5202             if (pelmCPUChild)
    5203             {
    5204                 pelmCPUChild->getAttributeValue("scheduling", hw.fL1DFlushOnSched);
    5205                 pelmCPUChild->getAttributeValue("vmentry", hw.fL1DFlushOnVMEntry);
    5206             }
    5207             pelmCPUChild = pelmHwChild->findChildElement("MDSClearOn");
    5208             if (pelmCPUChild)
    5209             {
    5210                 pelmCPUChild->getAttributeValue("scheduling", hw.fMDSClearOnSched);
    5211                 pelmCPUChild->getAttributeValue("vmentry", hw.fMDSClearOnVMEntry);
    5212             }
    5213             pelmCPUChild = pelmHwChild->findChildElement("NestedHWVirt");
    5214             if (pelmCPUChild)
    5215                 pelmCPUChild->getAttributeValue("enabled", hw.fNestedHWVirt);
    5216 
    5217             if ((pelmCPUChild = pelmHwChild->findChildElement("CpuIdTree")))
    5218                 readCpuIdTree(*pelmCPUChild, hw.llCpuIdLeafs);
    52195498        }
    52205499        else if (pelmHwChild->nameEquals("Memory"))
     
    52225501            pelmHwChild->getAttributeValue("RAMSize", hw.ulMemorySizeMB);
    52235502            pelmHwChild->getAttributeValue("PageFusion", hw.fPageFusionEnabled);
    5224         }
    5225         else if (pelmHwChild->nameEquals("Firmware"))
    5226         {
    5227             Utf8Str strFirmwareType;
    5228             if (pelmHwChild->getAttributeValue("type", strFirmwareType))
    5229             {
    5230                 if (    (strFirmwareType == "BIOS")
    5231                      || (strFirmwareType == "1")                // some trunk builds used the number here
    5232                    )
    5233                     hw.firmwareType = FirmwareType_BIOS;
    5234                 else if (    (strFirmwareType == "EFI")
    5235                           || (strFirmwareType == "2")           // some trunk builds used the number here
    5236                         )
    5237                     hw.firmwareType = FirmwareType_EFI;
    5238                 else if (    strFirmwareType == "EFI32")
    5239                     hw.firmwareType = FirmwareType_EFI32;
    5240                 else if (    strFirmwareType == "EFI64")
    5241                     hw.firmwareType = FirmwareType_EFI64;
    5242                 else if (    strFirmwareType == "EFIDUAL")
    5243                     hw.firmwareType = FirmwareType_EFIDUAL;
    5244                 else
    5245                     throw ConfigFileError(this,
    5246                                           pelmHwChild,
    5247                                           N_("Invalid value '%s' in Firmware/@type"),
    5248                                           strFirmwareType.c_str());
    5249             }
    52505503        }
    52515504        else if (pelmHwChild->nameEquals("HID"))
     
    52915544            }
    52925545        }
    5293         else if (pelmHwChild->nameEquals("Chipset"))
    5294         {
    5295             Utf8Str strChipsetType;
    5296             if (pelmHwChild->getAttributeValue("type", strChipsetType))
    5297             {
    5298                 if (strChipsetType == "PIIX3")
    5299                     hw.chipsetType = ChipsetType_PIIX3;
    5300                 else if (strChipsetType == "ICH9")
    5301                     hw.chipsetType = ChipsetType_ICH9;
    5302                 else
    5303                     throw ConfigFileError(this,
    5304                                           pelmHwChild,
    5305                                           N_("Invalid value '%s' in Chipset/@type"),
    5306                                           strChipsetType.c_str());
    5307             }
    5308         }
    5309         else if (pelmHwChild->nameEquals("Iommu"))
    5310         {
    5311             Utf8Str strIommuType;
    5312             if (pelmHwChild->getAttributeValue("type", strIommuType))
    5313             {
    5314                 if (strIommuType == "None")
    5315                     hw.iommuType = IommuType_None;
    5316                 else if (strIommuType == "Automatic")
    5317                     hw.iommuType = IommuType_Automatic;
    5318                 else if (strIommuType == "AMD")
    5319                     hw.iommuType = IommuType_AMD;
    5320                 else if (strIommuType == "Intel")
    5321                     hw.iommuType = IommuType_Intel;
    5322                 else
    5323                     throw ConfigFileError(this,
    5324                                           pelmHwChild,
    5325                                           N_("Invalid value '%s' in Iommu/@type"),
    5326                                           strIommuType.c_str());
    5327             }
    5328         }
    53295546        else if (pelmHwChild->nameEquals("Paravirt"))
    53305547        {
     
    53535570            pelmHwChild->getAttributeValue("debug", hw.strParavirtDebug);
    53545571        }
    5355         else if (pelmHwChild->nameEquals("HPET"))
    5356         {
    5357             pelmHwChild->getAttributeValue("enabled", hw.fHPETEnabled);
    5358         }
    53595572        else if (pelmHwChild->nameEquals("Boot"))
    53605573        {
     
    55035716            }
    55045717        }
    5505         else if (pelmHwChild->nameEquals("BIOS"))
    5506         {
    5507             const xml::ElementNode *pelmBIOSChild;
    5508             if ((pelmBIOSChild = pelmHwChild->findChildElement("ACPI")))
    5509                 pelmBIOSChild->getAttributeValue("enabled", hw.biosSettings.fACPIEnabled);
    5510             if ((pelmBIOSChild = pelmHwChild->findChildElement("IOAPIC")))
    5511                 pelmBIOSChild->getAttributeValue("enabled", hw.biosSettings.fIOAPICEnabled);
    5512             if ((pelmBIOSChild = pelmHwChild->findChildElement("APIC")))
    5513             {
    5514                 Utf8Str strAPIC;
    5515                 if (pelmBIOSChild->getAttributeValue("mode", strAPIC))
     5718        /* Since v1.20 (VBox 7.1) we store BIOS / UEFI settings inside the "Firmware" element.
     5719         * Older versions (< v1.20) stored those settings in a "BIOS" element (see down below) for that. See also down below. */
     5720        else if (   pelmHwChild->nameEquals("BIOS")
     5721                 || pelmHwChild->nameEquals("Firmware"))
     5722        {
     5723            /* For settings <  v1.20 we already has an element "Firmware", which only contained the firmware type. The rest lived in the "BIOS" element.
     5724             * For settings >= v1.20 we moved the "BIOS" element attributes also to "Firmware". */
     5725            if (pelmHwChild->nameEquals("Firmware"))
     5726            {
     5727                Utf8Str strFirmwareType;
     5728                if (pelmHwChild->getAttributeValue("type", strFirmwareType))
    55165729                {
    5517                     strAPIC.toUpper();
    5518                     if (strAPIC == "DISABLED")
    5519                         hw.biosSettings.apicMode = APICMode_Disabled;
    5520                     else if (strAPIC == "APIC")
    5521                         hw.biosSettings.apicMode = APICMode_APIC;
    5522                     else if (strAPIC == "X2APIC")
    5523                         hw.biosSettings.apicMode = APICMode_X2APIC;
     5730                    if (    (strFirmwareType == "BIOS")
     5731                         || (strFirmwareType == "1")                // some trunk builds used the number here
     5732                       )
     5733                        hw.firmwareSettings.firmwareType = FirmwareType_BIOS;
     5734                    else if (    (strFirmwareType == "EFI")
     5735                              || (strFirmwareType == "2")           // some trunk builds used the number here
     5736                            )
     5737                        hw.firmwareSettings.firmwareType = FirmwareType_EFI;
     5738                    else if (    strFirmwareType == "EFI32")
     5739                        hw.firmwareSettings.firmwareType = FirmwareType_EFI32;
     5740                    else if (    strFirmwareType == "EFI64")
     5741                        hw.firmwareSettings.firmwareType = FirmwareType_EFI64;
     5742                    else if (    strFirmwareType == "EFIDUAL")
     5743                        hw.firmwareSettings.firmwareType = FirmwareType_EFIDUAL;
    55245744                    else
    5525                         throw ConfigFileError(this, pelmBIOSChild, N_("Invalid value '%s' in APIC/@mode attribute"), strAPIC.c_str());
     5745                        throw ConfigFileError(this,
     5746                                              pelmHwChild,
     5747                                              N_("Invalid value '%s' in Firmware/@type"),
     5748                                              strFirmwareType.c_str());
    55265749                }
    55275750            }
    5528             if ((pelmBIOSChild = pelmHwChild->findChildElement("Logo")))
    5529             {
    5530                 pelmBIOSChild->getAttributeValue("fadeIn", hw.biosSettings.fLogoFadeIn);
    5531                 pelmBIOSChild->getAttributeValue("fadeOut", hw.biosSettings.fLogoFadeOut);
    5532                 pelmBIOSChild->getAttributeValue("displayTime", hw.biosSettings.ulLogoDisplayTime);
    5533                 pelmBIOSChild->getAttributeValue("imagePath", hw.biosSettings.strLogoImagePath);
    5534             }
    5535             if ((pelmBIOSChild = pelmHwChild->findChildElement("BootMenu")))
    5536             {
    5537                 Utf8Str strBootMenuMode;
    5538                 if (pelmBIOSChild->getAttributeValue("mode", strBootMenuMode))
     5751
     5752            /* Read the firmware settings either from the "Firmware" or "BIOS" elements, depending on the settings version. */
     5753            if (   (   pelmHwChild->nameEquals("Firmware")
     5754                    && m->sv >= SettingsVersion_v1_20)
     5755                || (   pelmHwChild->nameEquals("BIOS")
     5756                    && m->sv < SettingsVersion_v1_20)
     5757               )
     5758            {
     5759                const xml::ElementNode *pelmFirmwareOrBIOSChild;
     5760                if ((pelmFirmwareOrBIOSChild = pelmHwChild->findChildElement("ACPI")))
     5761                    pelmFirmwareOrBIOSChild->getAttributeValue("enabled", hw.firmwareSettings.fACPIEnabled);
     5762                if ((pelmFirmwareOrBIOSChild = pelmHwChild->findChildElement("IOAPIC")))
     5763                    pelmFirmwareOrBIOSChild->getAttributeValue("enabled", hw.firmwareSettings.fIOAPICEnabled);
     5764                if ((pelmFirmwareOrBIOSChild = pelmHwChild->findChildElement("APIC")))
    55395765                {
    5540                     // settings before 1.3 used lower case so make sure this is case-insensitive
    5541                     strBootMenuMode.toUpper();
    5542                     if (strBootMenuMode == "DISABLED")
    5543                         hw.biosSettings.biosBootMenuMode = BIOSBootMenuMode_Disabled;
    5544                     else if (strBootMenuMode == "MENUONLY")
    5545                         hw.biosSettings.biosBootMenuMode = BIOSBootMenuMode_MenuOnly;
    5546                     else if (strBootMenuMode == "MESSAGEANDMENU")
    5547                         hw.biosSettings.biosBootMenuMode = BIOSBootMenuMode_MessageAndMenu;
    5548                     else
    5549                         throw ConfigFileError(this, pelmBIOSChild, N_("Invalid value '%s' in BootMenu/@mode attribute"), strBootMenuMode.c_str());
     5766                    Utf8Str strAPIC;
     5767                    if (pelmFirmwareOrBIOSChild->getAttributeValue("mode", strAPIC))
     5768                    {
     5769                        strAPIC.toUpper();
     5770                        if (strAPIC == "DISABLED")
     5771                            hw.firmwareSettings.apicMode = APICMode_Disabled;
     5772                        else if (strAPIC == "APIC")
     5773                            hw.firmwareSettings.apicMode = APICMode_APIC;
     5774                        else if (strAPIC == "X2APIC")
     5775                            hw.firmwareSettings.apicMode = APICMode_X2APIC;
     5776                        else
     5777                            throw ConfigFileError(this, pelmFirmwareOrBIOSChild, N_("Invalid value '%s' in APIC/@mode attribute"), strAPIC.c_str());
     5778                    }
    55505779                }
    5551             }
    5552             if ((pelmBIOSChild = pelmHwChild->findChildElement("PXEDebug")))
    5553                 pelmBIOSChild->getAttributeValue("enabled", hw.biosSettings.fPXEDebugEnabled);
    5554             if ((pelmBIOSChild = pelmHwChild->findChildElement("TimeOffset")))
    5555                 pelmBIOSChild->getAttributeValue("value", hw.biosSettings.llTimeOffset);
    5556             if ((pelmBIOSChild = pelmHwChild->findChildElement("NVRAM")))
    5557             {
    5558                 pelmBIOSChild->getAttributeValue("path", hw.nvramSettings.strNvramPath);
    5559                 if (m->sv >= SettingsVersion_v1_19)
     5780                if ((pelmFirmwareOrBIOSChild = pelmHwChild->findChildElement("Logo")))
    55605781                {
    5561                     pelmBIOSChild->getAttributeValue("keyId", hw.nvramSettings.strKeyId);
    5562                     pelmBIOSChild->getAttributeValue("keyStore", hw.nvramSettings.strKeyStore);
     5782                    pelmFirmwareOrBIOSChild->getAttributeValue("fadeIn", hw.firmwareSettings.fLogoFadeIn);
     5783                    pelmFirmwareOrBIOSChild->getAttributeValue("fadeOut", hw.firmwareSettings.fLogoFadeOut);
     5784                    pelmFirmwareOrBIOSChild->getAttributeValue("displayTime", hw.firmwareSettings.ulLogoDisplayTime);
     5785                    pelmFirmwareOrBIOSChild->getAttributeValue("imagePath", hw.firmwareSettings.strLogoImagePath);
    55635786                }
    5564             }
    5565             if ((pelmBIOSChild = pelmHwChild->findChildElement("SmbiosUuidLittleEndian")))
    5566                 pelmBIOSChild->getAttributeValue("enabled", hw.biosSettings.fSmbiosUuidLittleEndian);
    5567             else
    5568                 hw.biosSettings.fSmbiosUuidLittleEndian = false; /* Default for existing VMs. */
    5569 
    5570             // legacy BIOS/IDEController (pre 1.7)
    5571             if (    (m->sv < SettingsVersion_v1_7)
    5572                  && (pelmBIOSChild = pelmHwChild->findChildElement("IDEController"))
    5573                )
    5574             {
    5575                 StorageController sctl;
    5576                 sctl.strName = "IDE Controller";
    5577                 sctl.storageBus = StorageBus_IDE;
    5578 
    5579                 Utf8Str strType;
    5580                 if (pelmBIOSChild->getAttributeValue("type", strType))
     5787                if ((pelmFirmwareOrBIOSChild = pelmHwChild->findChildElement("BootMenu")))
    55815788                {
    5582                     if (strType == "PIIX3")
    5583                         sctl.controllerType = StorageControllerType_PIIX3;
    5584                     else if (strType == "PIIX4")
    5585                         sctl.controllerType = StorageControllerType_PIIX4;
    5586                     else if (strType == "ICH6")
    5587                         sctl.controllerType = StorageControllerType_ICH6;
    5588                     else
    5589                         throw ConfigFileError(this, pelmBIOSChild, N_("Invalid value '%s' for IDEController/@type attribute"), strType.c_str());
     5789                    Utf8Str strBootMenuMode;
     5790                    if (pelmFirmwareOrBIOSChild->getAttributeValue("mode", strBootMenuMode))
     5791                    {
     5792                        // settings before 1.3 used lower case so make sure this is case-insensitive
     5793                        strBootMenuMode.toUpper();
     5794                        if (strBootMenuMode == "DISABLED")
     5795                            hw.firmwareSettings.enmBootMenuMode = FirmwareBootMenuMode_Disabled;
     5796                        else if (strBootMenuMode == "MENUONLY")
     5797                            hw.firmwareSettings.enmBootMenuMode = FirmwareBootMenuMode_MenuOnly;
     5798                        else if (strBootMenuMode == "MESSAGEANDMENU")
     5799                            hw.firmwareSettings.enmBootMenuMode = FirmwareBootMenuMode_MessageAndMenu;
     5800                        else
     5801                            throw ConfigFileError(this, pelmFirmwareOrBIOSChild, N_("Invalid value '%s' in BootMenu/@mode attribute"), strBootMenuMode.c_str());
     5802                    }
    55905803                }
    5591                 sctl.ulPortCount = 2;
    5592                 hw.storage.llStorageControllers.push_back(sctl);
     5804                if ((pelmFirmwareOrBIOSChild = pelmHwChild->findChildElement("PXEDebug")))
     5805                    pelmFirmwareOrBIOSChild->getAttributeValue("enabled", hw.firmwareSettings.fPXEDebugEnabled);
     5806                if ((pelmFirmwareOrBIOSChild = pelmHwChild->findChildElement("TimeOffset")))
     5807                    pelmFirmwareOrBIOSChild->getAttributeValue("value", hw.firmwareSettings.llTimeOffset);
     5808                if ((pelmFirmwareOrBIOSChild = pelmHwChild->findChildElement("NVRAM")))
     5809                {
     5810                    pelmFirmwareOrBIOSChild->getAttributeValue("path", hw.nvramSettings.strNvramPath);
     5811                    if (m->sv >= SettingsVersion_v1_19)
     5812                    {
     5813                        pelmFirmwareOrBIOSChild->getAttributeValue("keyId", hw.nvramSettings.strKeyId);
     5814                        pelmFirmwareOrBIOSChild->getAttributeValue("keyStore", hw.nvramSettings.strKeyStore);
     5815                    }
     5816                }
     5817                if ((pelmFirmwareOrBIOSChild = pelmHwChild->findChildElement("SmbiosUuidLittleEndian")))
     5818                    pelmFirmwareOrBIOSChild->getAttributeValue("enabled", hw.firmwareSettings.fSmbiosUuidLittleEndian);
     5819                else
     5820                    hw.firmwareSettings.fSmbiosUuidLittleEndian = false; /* Default for existing VMs. */
     5821
     5822                // legacy BIOS/IDEController (pre 1.7)
     5823                if (    (m->sv < SettingsVersion_v1_7)
     5824                     && (pelmFirmwareOrBIOSChild = pelmHwChild->findChildElement("IDEController"))
     5825                   )
     5826                {
     5827                    StorageController sctl;
     5828                    sctl.strName = "IDE Controller";
     5829                    sctl.storageBus = StorageBus_IDE;
     5830
     5831                    Utf8Str strType;
     5832                    if (pelmFirmwareOrBIOSChild->getAttributeValue("type", strType))
     5833                    {
     5834                        if (strType == "PIIX3")
     5835                            sctl.controllerType = StorageControllerType_PIIX3;
     5836                        else if (strType == "PIIX4")
     5837                            sctl.controllerType = StorageControllerType_PIIX4;
     5838                        else if (strType == "ICH6")
     5839                            sctl.controllerType = StorageControllerType_ICH6;
     5840                        else
     5841                            throw ConfigFileError(this, pelmFirmwareOrBIOSChild, N_("Invalid value '%s' for IDEController/@type attribute"), strType.c_str());
     5842                    }
     5843                    sctl.ulPortCount = 2;
     5844                    hw.storage.llStorageControllers.push_back(sctl);
     5845                }
    55935846            }
    55945847        }
     
    57015954        else if (pelmHwChild->nameEquals("Network"))
    57025955            readNetworkAdapters(*pelmHwChild, hw.llNetworkAdapters);
    5703         else if (pelmHwChild->nameEquals("RTC"))
    5704         {
    5705             Utf8Str strLocalOrUTC;
    5706             machineUserData.fRTCUseUTC = pelmHwChild->getAttributeValue("localOrUTC", strLocalOrUTC)
    5707                                       && strLocalOrUTC == "UTC";
    5708         }
    57095956        else if (    pelmHwChild->nameEquals("UART")
    57105957                  || pelmHwChild->nameEquals("Uart")      // used before 1.3
     
    58646111            readStorageControllers(*pelmHwChild, hw.storage);
    58656112    }
     6113
     6114    /* We read the platform settings here, which were part of the "Hardware" node for settings < 1.2.0.
     6115     * For newer settings (>= v1.20) we read the platform settings outside readHardware(). */
     6116    if (m->sv < SettingsVersion_v1_20)
     6117        readPlatform(elmHardware, hw.platformSettings);
    58666118
    58676119    if (hw.ulMemorySizeMB == (uint32_t)-1)
     
    64826734
    64836735        pElement->getAttributeValuePath("stateFile", pSnap->strStateFile);      // online snapshots only
     6736
     6737        /* We read the platform settings here for newer settings (>= v1.20).
     6738         * For older settings (< v1.20) we read the platform settings in readHardware(). */
     6739        if (m->sv >= SettingsVersion_v1_20)
     6740        {
     6741            const xml::ElementNode *pelmPlatform;
     6742            if (!(pelmPlatform = pElement->findChildElement("Platform")))
     6743                throw ConfigFileError(this, pElement, N_("Required Snapshot/@Platform element is missing"));
     6744            readPlatform(*pelmPlatform, pSnap->hardware.platformSettings);
     6745        }
    64846746
    64856747        // parse Hardware before the other elements because other things depend on it
     
    66766938        parseBase64(machineUserData.ovIcon, str, &elmMachine);
    66776939
     6940        /* We read the platform settings here for newer settings (>= v1.20).
     6941         * For older settings (< v1.20) we read the platform settings in readHardware(). */
     6942        if (m->sv >= SettingsVersion_v1_20)
     6943        {
     6944            const xml::ElementNode *pelmPlatform;
     6945            if (!(pelmPlatform = elmMachine.findChildElement("Platform")))
     6946                throw ConfigFileError(this, &elmMachine, N_("Required Machine/@Platform element is missing"));
     6947            readPlatform(*pelmPlatform, hardwareMachine.platformSettings);
     6948        }
     6949
    66786950        // parse Hardware before the other elements because other things depend on it
    66796951        const xml::ElementNode *pelmHardware;
    66806952        if (!(pelmHardware = elmMachine.findChildElement("Hardware")))
    6681             throw ConfigFileError(this, &elmMachine, N_("Required Machine/Hardware element is missing"));
     6953            throw ConfigFileError(this, &elmMachine, N_("Required Machine/@Hardware element is missing"));
    66826954        readHardware(*pelmHardware, hardwareMachine);
    66836955
     
    68227094
    68237095/**
    6824  * Creates a \<Hardware\> node under elmParent and then writes out the XML
     7096 * Writes x86-specific platform settings out to the XML.
     7097 *
     7098 * For settings >= v1.20 this creates a \<x86\> node under elmParent.
    68257099 * keys under that. Called for both the \<Machine\> node and for snapshots.
    6826  * @param elmParent
    6827  * @param hw
    6828  * @param fl
    6829  * @param pllElementsWithUuidAttributes
    6830  */
    6831 void MachineConfigFile::buildHardwareXML(xml::ElementNode &elmParent,
    6832                                          const Hardware &hw,
    6833                                          uint32_t fl,
    6834                                          std::list<xml::ElementNode*> *pllElementsWithUuidAttributes)
    6835 {
    6836     xml::ElementNode *pelmHardware = elmParent.createChild("Hardware");
    6837 
    6838     if (   m->sv >= SettingsVersion_v1_4
    6839         && (m->sv < SettingsVersion_v1_7 ? hw.strVersion != "1" : hw.strVersion != "2"))
    6840         pelmHardware->setAttribute("version", hw.strVersion);
    6841 
    6842     if ((m->sv >= SettingsVersion_v1_9)
    6843          && !hw.uuid.isZero()
    6844          && hw.uuid.isValid()
    6845        )
    6846         pelmHardware->setAttribute("uuid", hw.uuid.toStringCurly());
    6847 
    6848     xml::ElementNode *pelmCPU      = pelmHardware->createChild("CPU");
    6849 
    6850     if (!hw.fHardwareVirt)
    6851         pelmCPU->createChild("HardwareVirtEx")->setAttribute("enabled", hw.fHardwareVirt);
    6852     if (!hw.fNestedPaging)
    6853         pelmCPU->createChild("HardwareVirtExNestedPaging")->setAttribute("enabled", hw.fNestedPaging);
    6854     if (!hw.fVPID)
    6855         pelmCPU->createChild("HardwareVirtExVPID")->setAttribute("enabled", hw.fVPID);
    6856     if (!hw.fUnrestrictedExecution)
    6857         pelmCPU->createChild("HardwareVirtExUX")->setAttribute("enabled", hw.fUnrestrictedExecution);
     7100 *
     7101 * @param elmParent                         Parent element.
     7102 *                                          For settings >= v1.20 this is the \<Platform\> element.
     7103 *                                          For settings  < v1.20 this is the \<Hardware\> element.
     7104 * @param elmCPU                            CPU element platform-generic settings.
     7105 *                                          For settings >= v1.20 this is the \<Platform/CPU\> element.
     7106 *                                          For settings  < v1.20 this is the \<Hardware/CPU\> element.
     7107 * @param platX86                           x86-specific platform settings to use for building the XML.
     7108 */
     7109void MachineConfigFile::buildPlatformX86XML(xml::ElementNode &elmParent, xml::ElementNode &elmCPU, const PlatformX86 &platX86)
     7110{
     7111    xml::ElementNode *pelmX86Root;
     7112    xml::ElementNode *pelmX86CPU;
     7113    if (m->sv >= SettingsVersion_v1_20)
     7114    {
     7115        pelmX86Root = elmParent.createChild("x86");
     7116        pelmX86CPU  = pelmX86Root->createChild("CPU");
     7117
     7118    }
     7119    else
     7120    {
     7121        pelmX86Root = &elmParent; /* Before settings v1.20 the x86-specifics were sprinkled across the Machine element. */
     7122        pelmX86CPU  = &elmCPU;    /* Use the generic CPU element, even for x86-specific things. */
     7123    }
     7124
     7125    if (   (m->sv >= SettingsVersion_v1_10)
     7126        && platX86.fHPETEnabled)
     7127    {
     7128        xml::ElementNode *pelmHPET = pelmX86Root->createChild("HPET");
     7129        pelmHPET->setAttribute("enabled", platX86.fHPETEnabled);
     7130    }
     7131
     7132    // HardwareVirtExLargePages has too crazy default handling, must always save this setting.
     7133    pelmX86CPU->createChild("HardwareVirtExLargePages")->setAttribute("enabled", platX86.fHWVirtExLargePages);
     7134
     7135    if (m->sv >= SettingsVersion_v1_9)
     7136    {
     7137        if (platX86.fHWVirtExForce)
     7138            pelmX86CPU->createChild("HardwareVirtForce")->setAttribute("enabled", platX86.fHWVirtExForce);
     7139    }
     7140
     7141    if (m->sv >= SettingsVersion_v1_9 && platX86.fHWVirtExUseNativeApi)
     7142        pelmX86CPU->createChild("HardwareVirtExUseNativeApi")->setAttribute("enabled", platX86.fHWVirtExUseNativeApi);
     7143
     7144    if (!platX86.fHWVirtEx)
     7145        pelmX86CPU->createChild("HardwareVirtEx")->setAttribute("enabled", platX86.fHWVirtEx);
     7146    if (!platX86.fHWVirtExNestedPaging)
     7147        pelmX86CPU->createChild("HardwareVirtExNestedPaging")->setAttribute("enabled", platX86.fHWVirtExNestedPaging);
     7148    if (!platX86.fHWVirtExVPID)
     7149        pelmX86CPU->createChild("HardwareVirtExVPID")->setAttribute("enabled", platX86.fHWVirtExVPID);
     7150    if (!platX86.fHWVirtExUX)
     7151        pelmX86CPU->createChild("HardwareVirtExUX")->setAttribute("enabled", platX86.fHWVirtExUX);
    68587152    // PAE has too crazy default handling, must always save this setting.
    6859     pelmCPU->createChild("PAE")->setAttribute("enabled", hw.fPAE);
     7153    pelmX86CPU->createChild("PAE")->setAttribute("enabled", platX86.fPAE);
    68607154    if (m->sv >= SettingsVersion_v1_16)
    68617155    {
    6862         if (hw.fIBPBOnVMEntry || hw.fIBPBOnVMExit)
    6863         {
    6864             xml::ElementNode *pelmChild = pelmCPU->createChild("IBPBOn");
    6865             if (hw.fIBPBOnVMExit)
    6866                 pelmChild->setAttribute("vmexit", hw.fIBPBOnVMExit);
    6867             if (hw.fIBPBOnVMEntry)
    6868                 pelmChild->setAttribute("vmentry", hw.fIBPBOnVMEntry);
    6869         }
    6870         if (hw.fSpecCtrl)
    6871             pelmCPU->createChild("SpecCtrl")->setAttribute("enabled", hw.fSpecCtrl);
    6872         if (hw.fSpecCtrlByHost)
    6873             pelmCPU->createChild("SpecCtrlByHost")->setAttribute("enabled", hw.fSpecCtrlByHost);
    6874         if (!hw.fL1DFlushOnSched || hw.fL1DFlushOnVMEntry)
    6875         {
    6876             xml::ElementNode *pelmChild = pelmCPU->createChild("L1DFlushOn");
    6877             if (!hw.fL1DFlushOnSched)
    6878                 pelmChild->setAttribute("scheduling", hw.fL1DFlushOnSched);
    6879             if (hw.fL1DFlushOnVMEntry)
    6880                 pelmChild->setAttribute("vmentry", hw.fL1DFlushOnVMEntry);
    6881         }
    6882         if (!hw.fMDSClearOnSched || hw.fMDSClearOnVMEntry)
    6883         {
    6884             xml::ElementNode *pelmChild = pelmCPU->createChild("MDSClearOn");
    6885             if (!hw.fMDSClearOnSched)
    6886                 pelmChild->setAttribute("scheduling", hw.fMDSClearOnSched);
    6887             if (hw.fMDSClearOnVMEntry)
    6888                 pelmChild->setAttribute("vmentry", hw.fMDSClearOnVMEntry);
    6889         }
    6890     }
    6891     if (m->sv >= SettingsVersion_v1_17 && hw.fNestedHWVirt)
    6892         pelmCPU->createChild("NestedHWVirt")->setAttribute("enabled", hw.fNestedHWVirt);
    6893 
    6894     if (m->sv >= SettingsVersion_v1_18 && !hw.fVirtVmsaveVmload)
    6895         pelmCPU->createChild("HardwareVirtExVirtVmsaveVmload")->setAttribute("enabled", hw.fVirtVmsaveVmload);
    6896 
    6897     if (m->sv >= SettingsVersion_v1_14 && hw.enmLongMode != Hardware::LongMode_Legacy)
     7156        if (platX86.fIBPBOnVMEntry || platX86.fIBPBOnVMExit)
     7157        {
     7158            xml::ElementNode *pelmChild = pelmX86CPU->createChild("IBPBOn");
     7159            if (platX86.fIBPBOnVMExit)
     7160                pelmChild->setAttribute("vmexit", platX86.fIBPBOnVMExit);
     7161            if (platX86.fIBPBOnVMEntry)
     7162                pelmChild->setAttribute("vmentry", platX86.fIBPBOnVMEntry);
     7163        }
     7164        if (platX86.fSpecCtrl)
     7165            pelmX86CPU->createChild("SpecCtrl")->setAttribute("enabled", platX86.fSpecCtrl);
     7166        if (platX86.fSpecCtrlByHost)
     7167            pelmX86CPU->createChild("SpecCtrlByHost")->setAttribute("enabled", platX86.fSpecCtrlByHost);
     7168        if (!platX86.fL1DFlushOnSched || platX86.fL1DFlushOnVMEntry)
     7169        {
     7170            xml::ElementNode *pelmChild = pelmX86CPU->createChild("L1DFlushOn");
     7171            if (!platX86.fL1DFlushOnSched)
     7172                pelmChild->setAttribute("scheduling", platX86.fL1DFlushOnSched);
     7173            if (platX86.fL1DFlushOnVMEntry)
     7174                pelmChild->setAttribute("vmentry", platX86.fL1DFlushOnVMEntry);
     7175        }
     7176        if (!platX86.fMDSClearOnSched || platX86.fMDSClearOnVMEntry)
     7177        {
     7178            xml::ElementNode *pelmChild = pelmX86CPU->createChild("MDSClearOn");
     7179            if (!platX86.fMDSClearOnSched)
     7180                pelmChild->setAttribute("scheduling", platX86.fMDSClearOnSched);
     7181            if (platX86.fMDSClearOnVMEntry)
     7182                pelmChild->setAttribute("vmentry", platX86.fMDSClearOnVMEntry);
     7183        }
     7184    }
     7185    if (m->sv >= SettingsVersion_v1_17 && platX86.fNestedHWVirt)
     7186        pelmX86CPU->createChild("NestedHWVirt")->setAttribute("enabled", platX86.fNestedHWVirt);
     7187
     7188    if (m->sv >= SettingsVersion_v1_18 && !platX86.fHWVirtExVirtVmsaveVmload)
     7189        pelmX86CPU->createChild("HardwareVirtExVirtVmsaveVmload")->setAttribute("enabled", platX86.fHWVirtExVirtVmsaveVmload);
     7190
     7191    if (m->sv >= SettingsVersion_v1_14 && platX86.enmLongMode != PlatformX86::LongMode_Legacy)
    68987192    {
    68997193        // LongMode has too crazy default handling, must always save this setting.
    6900         pelmCPU->createChild("LongMode")->setAttribute("enabled", hw.enmLongMode == Hardware::LongMode_Enabled);
    6901     }
    6902 
    6903     if (hw.fTripleFaultReset)
    6904         pelmCPU->createChild("TripleFaultReset")->setAttribute("enabled", hw.fTripleFaultReset);
     7194        pelmX86CPU->createChild("LongMode")->setAttribute("enabled", platX86.enmLongMode == PlatformX86::LongMode_Enabled);
     7195    }
     7196
     7197    if (platX86.fTripleFaultReset)
     7198        pelmX86CPU->createChild("TripleFaultReset")->setAttribute("enabled", platX86.fTripleFaultReset);
    69057199    if (m->sv >= SettingsVersion_v1_14)
    69067200    {
    6907         if (hw.fX2APIC)
    6908             pelmCPU->createChild("X2APIC")->setAttribute("enabled", hw.fX2APIC);
    6909         else if (!hw.fAPIC)
    6910             pelmCPU->createChild("APIC")->setAttribute("enabled", hw.fAPIC);
    6911     }
     7201        if (platX86.fX2APIC)
     7202            pelmX86CPU->createChild("X2APIC")->setAttribute("enabled", platX86.fX2APIC);
     7203        else if (!platX86.fAPIC)
     7204            pelmX86CPU->createChild("APIC")->setAttribute("enabled", platX86.fAPIC);
     7205    }
     7206
     7207    xml::ElementNode *pelmCpuIdTree = NULL;
     7208    for (CpuIdLeafsX86List::const_iterator it  = platX86.llCpuIdLeafs.begin();
     7209                                           it != platX86.llCpuIdLeafs.end();
     7210         ++it)
     7211    {
     7212        const CpuIdLeafX86 &leaf = *it;
     7213
     7214        if (pelmCpuIdTree == NULL)
     7215             pelmCpuIdTree = pelmX86CPU->createChild("CpuIdTree");
     7216
     7217        xml::ElementNode *pelmCpuIdLeaf = pelmCpuIdTree->createChild("CpuIdLeaf");
     7218        pelmCpuIdLeaf->setAttribute("id",  leaf.idx);
     7219        if (leaf.idxSub != 0)
     7220            pelmCpuIdLeaf->setAttribute("subleaf",  leaf.idxSub);
     7221        pelmCpuIdLeaf->setAttribute("eax", leaf.uEax);
     7222        pelmCpuIdLeaf->setAttribute("ebx", leaf.uEbx);
     7223        pelmCpuIdLeaf->setAttribute("ecx", leaf.uEcx);
     7224        pelmCpuIdLeaf->setAttribute("edx", leaf.uEdx);
     7225    }
     7226}
     7227
     7228/**
     7229 * Stores platform-generic and platform-specific data and then writes out the XML.
     7230 *
     7231 * For settings >= v.120 this creates a \<Platform\> node under elmParent.
     7232 * For settings  < v.120 this stores the data directly under elmParent.
     7233 *
     7234 * Called for both the \<Machine\> node and for snapshots.
     7235 *
     7236 * @param elmParent                         Parent element.
     7237 * @param hw                                Hardware settings to use for building the XML.
     7238 *                                          For CPU stuff we don't have in Platform (yet).
     7239 * @param plat                              Platform settings to use for building the XML.
     7240 */
     7241void MachineConfigFile::buildPlatformXML(xml::ElementNode &elmParent,
     7242                                         const Hardware &hw, const Platform &plat)
     7243{
     7244    xml::ElementNode *pelmPlatformOrHardware;
     7245    if (m->sv >= SettingsVersion_v1_20) /* Since settings v1.20 we have a dedicated Platform element. */
     7246    {
     7247        pelmPlatformOrHardware = elmParent.createChild("Platform");
     7248
     7249        switch (plat.architectureType)
     7250        {
     7251            case PlatformArchitecture_x86:
     7252                pelmPlatformOrHardware->setAttribute("architecture", "x86");
     7253                break;
     7254
     7255            case PlatformArchitecture_ARM:
     7256                pelmPlatformOrHardware->setAttribute("architecture", "ARM");
     7257                break;
     7258
     7259            default:
     7260                AssertFailed();
     7261                break;
     7262        }
     7263    }
     7264    else /* For settings < v1.20 we use the parent element (which is Hardware). */
     7265        pelmPlatformOrHardware = &elmParent;
     7266
     7267    if (   m->sv >= SettingsVersion_v1_10
     7268        && plat.fRTCUseUTC)
     7269    {
     7270        xml::ElementNode *pelmRTC = pelmPlatformOrHardware->createChild("RTC");
     7271        pelmRTC->setAttribute("localOrUTC", plat.fRTCUseUTC ? "UTC" : "local");
     7272    }
     7273
     7274    if (m->sv >= SettingsVersion_v1_11)
     7275    {
     7276        if (plat.chipsetType != ChipsetType_PIIX3)
     7277        {
     7278            xml::ElementNode *pelmChipset = pelmPlatformOrHardware->createChild("Chipset");
     7279            const char *pcszChipset;
     7280
     7281            switch (plat.chipsetType)
     7282            {
     7283                case ChipsetType_PIIX3:             pcszChipset = "PIIX3";        break;
     7284                case ChipsetType_ICH9:              pcszChipset = "ICH9";         break;
     7285                case ChipsetType_ARMv8Virtual:      pcszChipset = "ARMv8Virtual"; break;
     7286                default:            Assert(false);  pcszChipset = "PIIX3";        break;
     7287            }
     7288            pelmChipset->setAttribute("type", pcszChipset);
     7289        }
     7290    }
     7291
     7292    if (   m->sv >= SettingsVersion_v1_19
     7293        && plat.iommuType != IommuType_None)
     7294    {
     7295        const char *pcszIommuType;
     7296        switch (plat.iommuType)
     7297        {
     7298            case IommuType_None:         pcszIommuType = "None";        break;
     7299            case IommuType_Automatic:    pcszIommuType = "Automatic";   break;
     7300            case IommuType_AMD:          pcszIommuType = "AMD";         break;
     7301            case IommuType_Intel:        pcszIommuType = "Intel";       break;
     7302            default:     Assert(false);  pcszIommuType = "None";        break;
     7303        }
     7304
     7305        xml::ElementNode *pelmIommu = pelmPlatformOrHardware->createChild("Iommu");
     7306        pelmIommu->setAttribute("type", pcszIommuType);
     7307    }
     7308
     7309    xml::ElementNode *pelmCPU = pelmPlatformOrHardware->createChild("CPU");
     7310
    69127311    if (hw.cCPUs > 1)
    69137312        pelmCPU->setAttribute("count", hw.cCPUs);
     
    69197318        pelmCPU->setAttribute("CpuProfile", hw.strCpuProfile);
    69207319
    6921     // HardwareVirtExLargePages has too crazy default handling, must always save this setting.
    6922     pelmCPU->createChild("HardwareVirtExLargePages")->setAttribute("enabled", hw.fLargePages);
    6923 
    6924     if (m->sv >= SettingsVersion_v1_9)
    6925     {
    6926         if (hw.fHardwareVirtForce)
    6927             pelmCPU->createChild("HardwareVirtForce")->setAttribute("enabled", hw.fHardwareVirtForce);
    6928     }
    6929 
    6930     if (m->sv >= SettingsVersion_v1_9 && hw.fUseNativeApi)
    6931         pelmCPU->createChild("HardwareVirtExUseNativeApi")->setAttribute("enabled", hw.fUseNativeApi);
    6932 
    69337320    if (m->sv >= SettingsVersion_v1_10)
    69347321    {
     
    69517338    }
    69527339
    6953     xml::ElementNode *pelmCpuIdTree = NULL;
    6954     for (CpuIdLeafsList::const_iterator it = hw.llCpuIdLeafs.begin();
    6955          it != hw.llCpuIdLeafs.end();
    6956          ++it)
    6957     {
    6958         const CpuIdLeaf &leaf = *it;
    6959 
    6960         if (pelmCpuIdTree == NULL)
    6961              pelmCpuIdTree = pelmCPU->createChild("CpuIdTree");
    6962 
    6963         xml::ElementNode *pelmCpuIdLeaf = pelmCpuIdTree->createChild("CpuIdLeaf");
    6964         pelmCpuIdLeaf->setAttribute("id",  leaf.idx);
    6965         if (leaf.idxSub != 0)
    6966             pelmCpuIdLeaf->setAttribute("subleaf",  leaf.idxSub);
    6967         pelmCpuIdLeaf->setAttribute("eax", leaf.uEax);
    6968         pelmCpuIdLeaf->setAttribute("ebx", leaf.uEbx);
    6969         pelmCpuIdLeaf->setAttribute("ecx", leaf.uEcx);
    6970         pelmCpuIdLeaf->setAttribute("edx", leaf.uEdx);
    6971     }
     7340    /* We only store specific stuff for the selected platform. */
     7341    if (plat.architectureType == PlatformArchitecture_x86)
     7342        buildPlatformX86XML(*pelmPlatformOrHardware, *pelmCPU, plat.x86);
     7343    /** @todo BUGBUG Put ARM stuff here. */
     7344}
     7345
     7346/**
     7347 * Creates a \<Hardware\> node under elmParent and then writes out the XML
     7348 * keys under that. Called for both the \<Machine\> node and for snapshots.
     7349 *
     7350 * @param elmParent                         Parent element.
     7351 * @param hw                                Hardware settings to use for building the XML.
     7352 * @param fl                                Flags.
     7353 * @param pllElementsWithUuidAttributes     Document me.
     7354 */
     7355void MachineConfigFile::buildHardwareXML(xml::ElementNode &elmParent,
     7356                                         const Hardware &hw,
     7357                                         uint32_t fl,
     7358                                         std::list<xml::ElementNode*> *pllElementsWithUuidAttributes)
     7359{
     7360    xml::ElementNode *pelmHardware = elmParent.createChild("Hardware");
     7361
     7362    if (   m->sv >= SettingsVersion_v1_4
     7363        && (m->sv < SettingsVersion_v1_7 ? hw.strVersion != "1" : hw.strVersion != "2"))
     7364        pelmHardware->setAttribute("version", hw.strVersion);
     7365
     7366    if ((m->sv >= SettingsVersion_v1_9)
     7367         && !hw.uuid.isZero()
     7368         && hw.uuid.isValid()
     7369       )
     7370        pelmHardware->setAttribute("uuid", hw.uuid.toStringCurly());
    69727371
    69737372    xml::ElementNode *pelmMemory = pelmHardware->createChild("Memory");
     
    69777376        if (hw.fPageFusionEnabled)
    69787377            pelmMemory->setAttribute("PageFusion", hw.fPageFusionEnabled);
    6979     }
    6980 
    6981     if (    (m->sv >= SettingsVersion_v1_9)
    6982          && (hw.firmwareType >= FirmwareType_EFI)
    6983        )
    6984     {
    6985         xml::ElementNode *pelmFirmware = pelmHardware->createChild("Firmware");
    6986         const char *pcszFirmware;
    6987 
    6988         switch (hw.firmwareType)
    6989         {
    6990             case FirmwareType_EFI:      pcszFirmware = "EFI";     break;
    6991             case FirmwareType_EFI32:    pcszFirmware = "EFI32";   break;
    6992             case FirmwareType_EFI64:    pcszFirmware = "EFI64";   break;
    6993             case FirmwareType_EFIDUAL:  pcszFirmware = "EFIDUAL"; break;
    6994             default:                    pcszFirmware = "None";    break;
    6995         }
    6996         pelmFirmware->setAttribute("type", pcszFirmware);
    69977378    }
    69987379
     
    70347415    }
    70357416
    7036     if (    (m->sv >= SettingsVersion_v1_10)
    7037         &&  hw.fHPETEnabled
    7038        )
    7039     {
    7040         xml::ElementNode *pelmHPET = pelmHardware->createChild("HPET");
    7041         pelmHPET->setAttribute("enabled", hw.fHPETEnabled);
    7042     }
    7043 
    7044     if (    (m->sv >= SettingsVersion_v1_11)
    7045        )
    7046     {
    7047         if (hw.chipsetType != ChipsetType_PIIX3)
    7048         {
    7049             xml::ElementNode *pelmChipset = pelmHardware->createChild("Chipset");
    7050             const char *pcszChipset;
    7051 
    7052             switch (hw.chipsetType)
    7053             {
    7054                 case ChipsetType_PIIX3:             pcszChipset = "PIIX3";   break;
    7055                 case ChipsetType_ICH9:              pcszChipset = "ICH9";    break;
    7056                 default:            Assert(false);  pcszChipset = "PIIX3";   break;
    7057             }
    7058             pelmChipset->setAttribute("type", pcszChipset);
    7059         }
    7060     }
     7417
    70617418
    70627419    if (    (m->sv >= SettingsVersion_v1_15)
     
    70827439            && hw.strParavirtDebug.isNotEmpty())
    70837440            pelmParavirt->setAttribute("debug", hw.strParavirtDebug);
    7084     }
    7085 
    7086     if (   m->sv >= SettingsVersion_v1_19
    7087         && hw.iommuType != IommuType_None)
    7088     {
    7089         const char *pcszIommuType;
    7090         switch (hw.iommuType)
    7091         {
    7092             case IommuType_None:         pcszIommuType = "None";        break;
    7093             case IommuType_Automatic:    pcszIommuType = "Automatic";   break;
    7094             case IommuType_AMD:          pcszIommuType = "AMD";         break;
    7095             case IommuType_Intel:        pcszIommuType = "Intel";       break;
    7096             default:     Assert(false);  pcszIommuType = "None";        break;
    7097         }
    7098 
    7099         xml::ElementNode *pelmIommu = pelmHardware->createChild("Iommu");
    7100         pelmIommu->setAttribute("type", pcszIommuType);
    71017441    }
    71027442
     
    72457585    }
    72467586
    7247     if (!hw.biosSettings.areDefaultSettings() || !hw.nvramSettings.areDefaultSettings())
    7248     {
    7249         xml::ElementNode *pelmBIOS = pelmHardware->createChild("BIOS");
    7250         if (!hw.biosSettings.fACPIEnabled)
    7251             pelmBIOS->createChild("ACPI")->setAttribute("enabled", hw.biosSettings.fACPIEnabled);
    7252         if (hw.biosSettings.fIOAPICEnabled)
    7253             pelmBIOS->createChild("IOAPIC")->setAttribute("enabled", hw.biosSettings.fIOAPICEnabled);
    7254         if (hw.biosSettings.apicMode != APICMode_APIC)
     7587    if (   !hw.firmwareSettings.areDefaultSettings(  hw.platformSettings.architectureType == PlatformArchitecture_ARM
     7588                                                   /* Good enough for now (we don't support ARMv7). */
     7589                                                   ? CPUArchitecture_ARMv8_64 : CPUArchitecture_x86)
     7590        || !hw.nvramSettings.areDefaultSettings())
     7591    {
     7592        xml::ElementNode *pelmFirmwareOrBIOS;
     7593        if (m->sv >= SettingsVersion_v1_20) /* Since settings v1.20 the element was renamed to "Firmware". */
     7594            pelmFirmwareOrBIOS = pelmHardware->createChild("Firmware");
     7595        else
     7596            pelmFirmwareOrBIOS = pelmHardware->createChild("BIOS");
     7597
     7598        if (   (m->sv >= SettingsVersion_v1_9)
     7599            && (hw.firmwareSettings.firmwareType >= FirmwareType_EFI)
     7600           )
     7601        {
     7602            const char *pcszFirmware;
     7603
     7604            switch (hw.firmwareSettings.firmwareType)
     7605            {
     7606                case FirmwareType_EFI:      pcszFirmware = "EFI";     break;
     7607                case FirmwareType_EFI32:    pcszFirmware = "EFI32";   break;
     7608                case FirmwareType_EFI64:    pcszFirmware = "EFI64";   break;
     7609                case FirmwareType_EFIDUAL:  pcszFirmware = "EFIDUAL"; break;
     7610                default:                    pcszFirmware = "None";    break;
     7611            }
     7612            pelmFirmwareOrBIOS->setAttribute("type", pcszFirmware);
     7613        }
     7614
     7615        if (!hw.firmwareSettings.fACPIEnabled)
     7616            pelmFirmwareOrBIOS->createChild("ACPI")->setAttribute("enabled", hw.firmwareSettings.fACPIEnabled);
     7617        if (hw.firmwareSettings.fIOAPICEnabled)
     7618            pelmFirmwareOrBIOS->createChild("IOAPIC")->setAttribute("enabled", hw.firmwareSettings.fIOAPICEnabled);
     7619        if (hw.firmwareSettings.apicMode != APICMode_APIC)
    72557620        {
    72567621            const char *pcszAPIC;
    7257             switch (hw.biosSettings.apicMode)
     7622            switch (hw.firmwareSettings.apicMode)
    72587623            {
    72597624                case APICMode_Disabled:
     
    72687633                    break;
    72697634            }
    7270             pelmBIOS->createChild("APIC")->setAttribute("mode", pcszAPIC);
    7271         }
    7272 
    7273         if (   !hw.biosSettings.fLogoFadeIn
    7274             || !hw.biosSettings.fLogoFadeOut
    7275             || hw.biosSettings.ulLogoDisplayTime
    7276             || !hw.biosSettings.strLogoImagePath.isEmpty())
    7277         {
    7278             xml::ElementNode *pelmLogo = pelmBIOS->createChild("Logo");
    7279             pelmLogo->setAttribute("fadeIn", hw.biosSettings.fLogoFadeIn);
    7280             pelmLogo->setAttribute("fadeOut", hw.biosSettings.fLogoFadeOut);
    7281             pelmLogo->setAttribute("displayTime", hw.biosSettings.ulLogoDisplayTime);
    7282             if (!hw.biosSettings.strLogoImagePath.isEmpty())
    7283                 pelmLogo->setAttribute("imagePath", hw.biosSettings.strLogoImagePath);
    7284         }
    7285 
    7286         if (hw.biosSettings.biosBootMenuMode != BIOSBootMenuMode_MessageAndMenu)
     7635            pelmFirmwareOrBIOS->createChild("APIC")->setAttribute("mode", pcszAPIC);
     7636        }
     7637
     7638        if (   !hw.firmwareSettings.fLogoFadeIn
     7639            || !hw.firmwareSettings.fLogoFadeOut
     7640            ||  hw.firmwareSettings.ulLogoDisplayTime
     7641            || !hw.firmwareSettings.strLogoImagePath.isEmpty())
     7642        {
     7643            xml::ElementNode *pelmLogo = pelmFirmwareOrBIOS->createChild("Logo");
     7644            pelmLogo->setAttribute("fadeIn", hw.firmwareSettings.fLogoFadeIn);
     7645            pelmLogo->setAttribute("fadeOut", hw.firmwareSettings.fLogoFadeOut);
     7646            pelmLogo->setAttribute("displayTime", hw.firmwareSettings.ulLogoDisplayTime);
     7647            if (!hw.firmwareSettings.strLogoImagePath.isEmpty())
     7648                pelmLogo->setAttribute("imagePath", hw.firmwareSettings.strLogoImagePath);
     7649        }
     7650
     7651        if (hw.firmwareSettings.enmBootMenuMode != FirmwareBootMenuMode_MessageAndMenu)
    72877652        {
    72887653            const char *pcszBootMenu;
    7289             switch (hw.biosSettings.biosBootMenuMode)
    7290             {
    7291                 case BIOSBootMenuMode_Disabled: pcszBootMenu = "Disabled"; break;
    7292                 case BIOSBootMenuMode_MenuOnly: pcszBootMenu = "MenuOnly"; break;
    7293                 default: /*BIOSBootMenuMode_MessageAndMenu*/ pcszBootMenu = "MessageAndMenu"; break;
    7294             }
    7295             pelmBIOS->createChild("BootMenu")->setAttribute("mode", pcszBootMenu);
    7296         }
    7297         if (hw.biosSettings.llTimeOffset)
    7298             pelmBIOS->createChild("TimeOffset")->setAttribute("value", hw.biosSettings.llTimeOffset);
    7299         if (hw.biosSettings.fPXEDebugEnabled)
    7300             pelmBIOS->createChild("PXEDebug")->setAttribute("enabled", hw.biosSettings.fPXEDebugEnabled);
     7654            switch (hw.firmwareSettings.enmBootMenuMode)
     7655            {
     7656                case FirmwareBootMenuMode_Disabled: pcszBootMenu = "Disabled"; break;
     7657                case FirmwareBootMenuMode_MenuOnly: pcszBootMenu = "MenuOnly"; break;
     7658                default: /*FirmwareBootMenuMode_MessageAndMenu*/ pcszBootMenu = "MessageAndMenu"; break;
     7659            }
     7660            pelmFirmwareOrBIOS->createChild("BootMenu")->setAttribute("mode", pcszBootMenu);
     7661        }
     7662        if (hw.firmwareSettings.llTimeOffset)
     7663            pelmFirmwareOrBIOS->createChild("TimeOffset")->setAttribute("value", hw.firmwareSettings.llTimeOffset);
     7664        if (hw.firmwareSettings.fPXEDebugEnabled)
     7665            pelmFirmwareOrBIOS->createChild("PXEDebug")->setAttribute("enabled", hw.firmwareSettings.fPXEDebugEnabled);
    73017666        if (!hw.nvramSettings.areDefaultSettings())
    73027667        {
    7303             xml::ElementNode *pelmNvram = pelmBIOS->createChild("NVRAM");
     7668            xml::ElementNode *pelmNvram = pelmFirmwareOrBIOS->createChild("NVRAM");
    73047669            if (!hw.nvramSettings.strNvramPath.isEmpty())
    73057670                pelmNvram->setAttribute("path", hw.nvramSettings.strNvramPath);
     
    73127677            }
    73137678        }
    7314         if (hw.biosSettings.fSmbiosUuidLittleEndian)
    7315             pelmBIOS->createChild("SmbiosUuidLittleEndian")->setAttribute("enabled", hw.biosSettings.fSmbiosUuidLittleEndian);
     7679        if (hw.firmwareSettings.fSmbiosUuidLittleEndian)
     7680            pelmFirmwareOrBIOS->createChild("SmbiosUuidLittleEndian")->setAttribute("enabled", hw.firmwareSettings.fSmbiosUuidLittleEndian);
    73167681    }
    73177682
     
    76267991            pelmPort->setAttribute("slot", port.ulSlot);
    76277992            pelmPort->setAttribute("enabled", port.fEnabled);
    7628             pelmPort->setAttributeHex("IOBase", port.ulIOBase);
     7993            pelmPort->setAttributeHex("IOAddress", port.ulIOAddress);
    76297994            pelmPort->setAttribute("IRQ", port.ulIRQ);
    76307995
     
    78078172            }
    78088173        }
    7809     }
    7810 
    7811     if (m->sv >= SettingsVersion_v1_10 && machineUserData.fRTCUseUTC)
    7812     {
    7813         xml::ElementNode *pelmRTC = pelmHardware->createChild("RTC");
    7814         pelmRTC->setAttribute("localOrUTC", machineUserData.fRTCUseUTC ? "UTC" : "local");
    78158174    }
    78168175
     
    86028961        buildRecordingXML(*pelmSnapshot, pSnap->recordingSettings);
    86038962        // note: Groups exist only for Machine, not for Snapshot
     8963
     8964        if (m->sv < SettingsVersion_v1_20) /* Before settings v1.20 the platform stuff lived directly in the Hardware element. */
     8965        {
     8966            xml::ElementNode *pelHardware = unconst(pelmSnapshot->findChildElement("Hardware"));
     8967            if (pelHardware)
     8968                buildPlatformXML(*pelHardware, pSnap->hardware, pSnap->hardware.platformSettings);
     8969        }
     8970        else /* Now lives outside of "Hardware", in "Platform". */
     8971            buildPlatformXML(*pelmSnapshot, pSnap->hardware, pSnap->hardware.platformSettings);
    86048972
    86058973        if (pSnap->llChildSnapshots.size())
     
    87809148
    87819149    buildGroupsXML(elmMachine, machineUserData.llGroups);
     9150
     9151    /* Note: Must come *after* buildHardwareXML(), as the "Hardware" branch is needed. */
     9152    if (m->sv < SettingsVersion_v1_20)
     9153    {
     9154        xml::ElementNode *pelHardware = unconst(elmMachine.findChildElement("Hardware"));
     9155        if (pelHardware)
     9156            buildPlatformXML(*pelHardware, hardwareMachine, hardwareMachine.platformSettings);
     9157    }
     9158    else /* Now lives outside of "Hardware", in "Platform". */
     9159        buildPlatformXML(elmMachine, hardwareMachine, hardwareMachine.platformSettings);
    87829160}
    87839161
     
    89949372void MachineConfigFile::bumpSettingsVersionIfNeeded()
    89959373{
     9374    if (m->sv < SettingsVersion_v1_20)
     9375    {
     9376        // VirtualBox 7.1 (settings v1.20) adds support for different VM platforms.
     9377        if (   hardwareMachine.platformSettings.architectureType != PlatformArchitecture_None
     9378            && hardwareMachine.platformSettings.architectureType != PlatformArchitecture_x86)
     9379        {
     9380            /* Note: The new chipset type ARMv8Virtual implies setting the platform architecture type to ARM. */
     9381            m->sv = SettingsVersion_v1_20;
     9382            return;
     9383        }
     9384    }
     9385
    89969386    if (m->sv < SettingsVersion_v1_19)
    89979387    {
    89989388        // VirtualBox 7.0 adds iommu device and full VM encryption.
    8999         if (   hardwareMachine.iommuType != IommuType_None
     9389        if (   hardwareMachine.platformSettings.iommuType != IommuType_None
    90009390            || strKeyId.isNotEmpty()
    90019391            || strKeyStore.isNotEmpty()
     
    90679457
    90689458        // VirtualBox 6.1 adds AMD-V virtualized VMSAVE/VMLOAD setting.
    9069         if (hardwareMachine.fVirtVmsaveVmload == false)
     9459        if (hardwareMachine.platformSettings.x86.fHWVirtExVirtVmsaveVmload == false)
    90709460        {
    90719461            m->sv = SettingsVersion_v1_18;
     
    91149504
    91159505        // VirtualBox 6.0 adds nested hardware virtualization, using native API (NEM).
    9116         if (   hardwareMachine.fNestedHWVirt
    9117             || hardwareMachine.fUseNativeApi)
     9506        if (   hardwareMachine.platformSettings.x86.fNestedHWVirt
     9507            || hardwareMachine.platformSettings.x86.fHWVirtExUseNativeApi)
    91189508        {
    91199509            m->sv = SettingsVersion_v1_17;
     
    91519541        // options, cpu profile, APIC settings (CPU capability and BIOS).
    91529542
    9153         if (   hardwareMachine.strParavirtDebug.isNotEmpty()
     9543        if (    hardwareMachine.strParavirtDebug.isNotEmpty()
    91549544            || (!hardwareMachine.strCpuProfile.equals("host") && hardwareMachine.strCpuProfile.isNotEmpty())
    9155             || hardwareMachine.biosSettings.apicMode != APICMode_APIC
    9156             || !hardwareMachine.fAPIC
    9157             || hardwareMachine.fX2APIC
    9158             || hardwareMachine.fIBPBOnVMExit
    9159             || hardwareMachine.fIBPBOnVMEntry
    9160             || hardwareMachine.fSpecCtrl
    9161             || hardwareMachine.fSpecCtrlByHost
    9162             || !hardwareMachine.fL1DFlushOnSched
    9163             || hardwareMachine.fL1DFlushOnVMEntry
    9164             || !hardwareMachine.fMDSClearOnSched
    9165             || hardwareMachine.fMDSClearOnVMEntry)
     9545            ||  hardwareMachine.firmwareSettings.apicMode != APICMode_APIC
     9546            || !hardwareMachine.platformSettings.x86.fAPIC
     9547            ||  hardwareMachine.platformSettings.x86.fX2APIC
     9548            ||  hardwareMachine.platformSettings.x86.fIBPBOnVMExit
     9549            ||  hardwareMachine.platformSettings.x86.fIBPBOnVMEntry
     9550            ||  hardwareMachine.platformSettings.x86.fSpecCtrl
     9551            ||  hardwareMachine.platformSettings.x86.fSpecCtrlByHost
     9552            || !hardwareMachine.platformSettings.x86.fL1DFlushOnSched
     9553            ||  hardwareMachine.platformSettings.x86.fL1DFlushOnVMEntry
     9554            || !hardwareMachine.platformSettings.x86.fMDSClearOnSched
     9555            ||  hardwareMachine.platformSettings.x86.fMDSClearOnVMEntry)
    91669556        {
    91679557            m->sv = SettingsVersion_v1_16;
     
    91829572        }
    91839573
    9184         for (CpuIdLeafsList::const_iterator it = hardwareMachine.llCpuIdLeafs.begin();
    9185              it != hardwareMachine.llCpuIdLeafs.end();
     9574        for (CpuIdLeafsX86List::const_iterator it = hardwareMachine.platformSettings.x86.llCpuIdLeafs.begin();
     9575             it != hardwareMachine.platformSettings.x86.llCpuIdLeafs.end();
    91869576             ++it)
    91879577            if (it->idxSub != 0)
     
    92809670        if (   !hardwareMachine.strDefaultFrontend.isEmpty()
    92819671            || hardwareMachine.graphicsAdapter.graphicsControllerType != GraphicsControllerType_VBoxVGA
    9282             || hardwareMachine.enmLongMode != Hardware::LongMode_Legacy
     9672            || hardwareMachine.platformSettings.x86.enmLongMode != PlatformX86::LongMode_Legacy
    92839673            || machineUserData.ovIcon.size() > 0
    92849674            || recordingSettings.common.fEnabled)
     
    94089798             || machineUserData.strOsType == "JRockitVE"
    94099799             || hardwareMachine.ioSettings.llBandwidthGroups.size()
    9410              || hardwareMachine.chipsetType == ChipsetType_ICH9
     9800             || hardwareMachine.platformSettings.chipsetType == ChipsetType_ICH9
    94119801           )
    94129802            m->sv = SettingsVersion_v1_11;
     
    95899979            || (hardwareMachine.fPageFusionEnabled)
    95909980                // and CPU hotplug, RTC timezone control, HID type and HPET
    9591             || machineUserData.fRTCUseUTC
     9981            || hardwareMachine.platformSettings.fRTCUseUTC
    95929982            || hardwareMachine.fCpuHotPlug
    95939983            || hardwareMachine.pointingHIDType != PointingHIDType_PS2Mouse
    95949984            || hardwareMachine.keyboardHIDType != KeyboardHIDType_PS2Keyboard
    9595             || hardwareMachine.fHPETEnabled
     9985            || hardwareMachine.platformSettings.x86.fHPETEnabled
    95969986           )
    95979987            m->sv = SettingsVersion_v1_10;
     
    965210042    // all the following require settings version 1.9
    965310043    if (    (m->sv < SettingsVersion_v1_9)
    9654          && (    (hardwareMachine.firmwareType >= FirmwareType_EFI)
     10044        && (    (hardwareMachine.firmwareSettings.firmwareType >= FirmwareType_EFI)
    965510045              || machineUserData.fTeleporterEnabled
    965610046              || machineUserData.uTeleporterPort
  • trunk/src/VBox/Main/xml/VirtualBox-settings.xsd

    r98108 r101035  
    218218</xsd:simpleType>
    219219
    220 <xsd:simpleType name="TBIOSBootMenuModeType">
     220<xsd:simpleType name="TFirmwareBootMenuModeType">
    221221  <xsd:restriction base="xsd:string">
    222222    <xsd:enumeration value="Disabled"/>
     
    456456  <xsd:attribute name="LogHistoryCount" type="xsd:unsignedInt" default="3"/>
    457457  <xsd:attribute name="defaultVRDEExtPack" type="xsd:string"/>
    458   <xsd:attribute name="exclusiveHwVirt" type="xsd:boolean"/>
     458  <xsd:attribute name="exclusiveHwVirt" type="xsd:boolean"/> <!-- deprecated since v1.20 -->
    459459  <xsd:attribute name="proxyMode" type="xsd:string"/>
    460460</xsd:complexType>
     
    582582</xsd:complexType>
    583583
     584<xsd:complexType name="THardwareVirtExUseNativeApi">
     585  <xsd:attribute name="enabled" type="xsd:boolean"/>
     586</xsd:complexType>
     587
     588<xsd:complexType name="TIBPBOn">
     589  <xsd:attribute name="vmexit" type="xsd:boolean"/>
     590  <xsd:attribute name="vmentry" type="xsd:boolean"/>
     591</xsd:complexType>
     592
     593<xsd:complexType name="TSpecCtrl">
     594  <xsd:attribute name="enabled" type="xsd:boolean"/>
     595</xsd:complexType>
     596
     597<xsd:complexType name="TSpecCtrlByHost">
     598  <xsd:attribute name="enabled" type="xsd:boolean"/>
     599</xsd:complexType>
     600
     601<xsd:complexType name="TL1DFlushOn">
     602  <xsd:attribute name="scheduling" type="xsd:boolean"/>
     603  <xsd:attribute name="vmentry" type="xsd:boolean"/>
     604</xsd:complexType>
     605
     606<xsd:complexType name="TMDSClearOn">
     607  <xsd:attribute name="scheduling" type="xsd:boolean"/>
     608  <xsd:attribute name="vmentry" type="xsd:boolean"/>
     609</xsd:complexType>
     610
     611<xsd:complexType name="TNestedHWVirt">
     612  <xsd:attribute name="enabled" type="xsd:boolean"/>
     613</xsd:complexType>
     614
     615<xsd:complexType name="THardwareVirtExVirtVmsaveVmload">
     616  <xsd:attribute name="enabled" type="xsd:boolean"/>
     617</xsd:complexType>
     618
     619<xsd:complexType name="TTripleFaultReset">
     620  <xsd:attribute name="enabled" type="xsd:boolean"/>
     621</xsd:complexType>
     622
     623<xsd:complexType name="TX2APIC">
     624  <xsd:attribute name="enabled" type="xsd:boolean"/>
     625</xsd:complexType>
     626
     627<xsd:complexType name="TAPIC">
     628  <xsd:attribute name="enabled" type="xsd:boolean"/>
     629</xsd:complexType>
     630
    584631<xsd:simpleType name="TCPUCount">
    585632  <xsd:restriction base="xsd:unsignedInt">
     
    589636</xsd:simpleType>
    590637
    591 <xsd:complexType name="TCpuIdLeaf">
     638<xsd:complexType name="TCpuIdLeafX86">
    592639  <xsd:attribute name="id"        type="xsd:unsignedInt"       use="required"/>
    593640  <xsd:attribute name="eax"       type="xsd:unsignedInt"       use="required"/>
     
    597644</xsd:complexType>
    598645
    599 <xsd:complexType name="TCpuIdTree">
    600   <xsd:sequence>
    601     <xsd:element name="CpuIdLeaf" type="TCpuIdLeaf"
     646<xsd:complexType name="TCpuIdTreeX86">
     647  <xsd:sequence>
     648    <xsd:element name="CpuIdLeaf" type="TCpuIdLeafX86"
    602649                 minOccurs="0" maxOccurs="unbounded"/>
    603650  </xsd:sequence>
    604651</xsd:complexType>
    605652
    606 <xsd:complexType name="TCPU">
    607   <xsd:sequence>
     653<xsd:complexType name="TCPUX86"> <!-- Contains the "x86" sub element of the CPU element. New since v1.20. -->
     654  <xsd:sequence>
     655    <xsd:element name="HPET" type="THPET" minOccurs="0"/>
     656    <xsd:element name="HardwareVirtExLargePages" type="THardwareVirtExLargePages" minOccurs="0"/>
     657    <xsd:element name="HardwareVirtForce" type="THardwareVirtForce" minOccurs="0"/>
     658    <xsd:element name="HardwareVirtExUseNativeApi" type="THardwareVirtExUseNativeApi" minOccurs="0"/>
    608659    <xsd:element name="HardwareVirtEx" type="THWVirtExType" minOccurs="0"/>
    609660    <xsd:element name="HardwareVirtExNestedPaging" type="THWVirtExNestedPagingType" minOccurs="0"/>
     
    611662    <xsd:element name="HardwareVirtExUX" type="THWVirtExUXType" minOccurs="0"/>
    612663    <xsd:element name="PAE" type="TPAEType" minOccurs="0"/>
     664    <xsd:element name="IBPBOn" type="TIBPBOn" minOccurs="0"/>
     665    <xsd:element name="SpecCtrl" type="TSpecCtrl" minOccurs="0"/>
     666    <xsd:element name="SpecCtrlByHost" type="TSpecCtrlByHost" minOccurs="0"/>
     667    <xsd:element name="L1DFlushOn" type="TL1DFlushOn" minOccurs="0"/>
     668    <xsd:element name="MDSClearOn" type="TMDSClearOn" minOccurs="0"/>
     669    <xsd:element name="NestedHWVirt" type="TNestedHWVirt" minOccurs="0"/>
     670    <xsd:element name="HardwareVirtExVirtVmsaveVmload" type="THardwareVirtExVirtVmsaveVmload" minOccurs="0"/>
    613671    <xsd:element name="LongMode" type="TLongModeType" minOccurs="0"/>
    614     <xsd:element name="HardwareVirtExLargePages" type="THardwareVirtExLargePages" minOccurs="0"/>
    615     <xsd:element name="HardwareVirtForce" type="THardwareVirtForce" minOccurs="0"/>
     672    <xsd:element name="TripleFaultReset" type="TTripleFaultReset" minOccurs="0"/>
     673    <xsd:element name="X2APIC" type="TX2APIC" minOccurs="0"/>
     674    <xsd:element name="APIC" type="TAPIC" minOccurs="0"/>
     675    <xsd:element name="CpuIdTree" type="TCpuIdTreeX86" minOccurs="0">
     676      <xsd:unique name="TCPUX86-CpuIdTree-CpuIdLeaf">
     677        <xsd:selector xpath="vb:CpuIdLeaf"/>
     678        <xsd:field xpath="@id"/>
     679      </xsd:unique>
     680    </xsd:element>
     681  </xsd:sequence>
     682</xsd:complexType>
     683
     684<xsd:complexType name="TCPU">
     685  <xsd:sequence>
     686    <xsd:element name="HardwareVirtEx" type="THWVirtExType" minOccurs="0"/> <!-- deprecated since v1.20. -->
     687    <xsd:element name="HardwareVirtExNestedPaging" type="THWVirtExNestedPagingType" minOccurs="0"/> <!-- deprecated since v1.20. -->
     688    <xsd:element name="HardwareVirtExVPID" type="THWVirtExVPIDType" minOccurs="0"/> <!-- deprecated since v1.20. -->
     689    <xsd:element name="HardwareVirtExUX" type="THWVirtExUXType" minOccurs="0"/> <!-- deprecated since v1.20. -->
     690    <xsd:element name="PAE" type="TPAEType" minOccurs="0"/> <!-- deprecated since v1.20. -->
     691    <xsd:element name="LongMode" type="TLongModeType" minOccurs="0"/> <!-- deprecated since v1.20. -->
     692    <xsd:element name="HardwareVirtExLargePages" type="THardwareVirtExLargePages" minOccurs="0"/> <!-- deprecated since v1.20. -->
     693    <xsd:element name="HardwareVirtForce" type="THardwareVirtForce" minOccurs="0"/> <!-- deprecated since v1.20. -->
    616694    <xsd:element name="SyntheticCpu" type="TSyntheticCpuType" minOccurs="0"/>
    617     <xsd:element name="CpuIdTree" type="TCpuIdTree" minOccurs="0">
     695    <xsd:element name="CpuIdTree" type="TCpuIdTreeX86" minOccurs="0"> <!-- deprecated since v1.20. -->
    618696      <xsd:unique name="TCPU-CpuIdTree-CpuIdLeaf">
    619697        <xsd:selector xpath="vb:CpuIdLeaf"/>
     
    720798</xsd:complexType>
    721799
    722 <xsd:complexType name="TBIOS">
     800<xsd:complexType name="TFirmware"> <!-- Note: Is named as element "BIOS" for settings < v1.20. -->
    723801  <xsd:all>
    724802    <xsd:element name="ACPI" minOccurs="0">
     
    742820    <xsd:element name="BootMenu" minOccurs="0">
    743821      <xsd:complexType>
    744         <xsd:attribute name="mode" type="TBIOSBootMenuModeType" default="MessageAndMenu"/>
     822        <xsd:attribute name="mode" type="TFirmwareBootMenuModeType" default="MessageAndMenu"/>
    745823      </xsd:complexType>
    746824    </xsd:element>
     
    780858    </xsd:element>
    781859  </xsd:all>
     860  <xsd:attribute name="type" type="TFirmwareType" use="required"/> <!-- new since v1.20. -->
    782861</xsd:complexType>
    783862
     
    12811360</xsd:complexType>
    12821361
    1283 <xsd:complexType name="TFirmware">
    1284   <xsd:attribute name="type" use="required">
    1285     <xsd:simpleType>
    1286       <xsd:restriction base="xsd:token">
    1287         <xsd:enumeration value="BIOS"/>
    1288         <xsd:enumeration value="EFI"/>
    1289         <xsd:enumeration value="EFI32"/>
    1290         <xsd:enumeration value="EFI64"/>
    1291         <xsd:enumeration value="EFIDUAL"/>
    1292       </xsd:restriction>
    1293     </xsd:simpleType>
    1294   </xsd:attribute>
    1295 </xsd:complexType>
     1362<xsd:simpleType name="TFirmwareType">
     1363  <xsd:restriction base="xsd:token">
     1364    <xsd:enumeration value="BIOS"/>
     1365    <xsd:enumeration value="EFI"/>
     1366    <xsd:enumeration value="EFI32"/>
     1367    <xsd:enumeration value="EFI64"/>
     1368    <xsd:enumeration value="EFIDUAL"/>
     1369  </xsd:restriction>
     1370</xsd:simpleType>
    12961371
    12971372<xsd:complexType name="THID">
     
    13271402        <xsd:enumeration value="PIIX3"/>
    13281403        <xsd:enumeration value="ICH9"/>
     1404      </xsd:restriction>
     1405    </xsd:simpleType>
     1406  </xsd:attribute>
     1407</xsd:complexType>
     1408
     1409<xsd:complexType name="TIommu"> <!-- new since v1.19. -->
     1410  <xsd:attribute name="type" use="required">
     1411    <xsd:simpleType>
     1412      <xsd:restriction base="xsd:token">
     1413        <xsd:enumeration value="None"/>
     1414        <xsd:enumeration value="Automatic"/>
     1415        <xsd:enumeration value="AMD"/>
     1416        <xsd:enumeration value="Intel"/>
    13291417      </xsd:restriction>
    13301418    </xsd:simpleType>
     
    13551443</xsd:complexType>
    13561444
     1445<xsd:simpleType name="TPlatformArchitecture"> <!-- new since v1.20. -->
     1446  <xsd:restriction base="xsd:token">
     1447    <xsd:enumeration value="None"/>
     1448    <xsd:enumeration value="x86"/>
     1449    <xsd:enumeration value="ARM"/>
     1450  </xsd:restriction>
     1451</xsd:simpleType>
     1452
     1453<xsd:complexType name="TPlatformProperties"> <!-- new since v1.20. -->
     1454  <xsd:attribute name="exclusiveHwVirt" type="xsd:boolean"/>
     1455</xsd:complexType>
     1456
     1457<xsd:complexType name="TPlatformX86"> <!-- new since v1.20. -->
     1458</xsd:complexType>
     1459
     1460<xsd:complexType name="TPlatformARM"> <!-- new since v1.20. -->
     1461</xsd:complexType>
     1462
     1463<xsd:complexType name="TPlatform"> <!-- new since v1.20. -->
     1464  <xsd:all>
     1465    <xsd:element name="Chipset" type="TChipset" minOccurs="0"/>
     1466    <xsd:element name="Iommu" type="TIommu" minOccurs="0"/>
     1467    <xsd:element name="RTC" type="TRTC" minOccurs="0"/>
     1468    <xsd:element name="CPU" type="TCPU"/>
     1469    <xsd:element name="x86" type="TPlatformX86" minOccurs="0"/>
     1470  </xsd:all>
     1471  <xsd:attribute name="architecture" type="TPlatformArchitecture" use="required"/>
     1472</xsd:complexType>
     1473
    13571474<xsd:complexType name="THardware">
    13581475  <xsd:all>
    1359     <xsd:element name="CPU" type="TCPU" minOccurs="0"/>
     1476    <xsd:element name="CPU" type="TCPU" minOccurs="0"/> <!-- deprecated since v1.20. -->
    13601477    <xsd:element name="Memory" type="TMemory"/>
    13611478    <xsd:element name="Firmware" type="TFirmware" minOccurs="0"/>
    13621479    <xsd:element name="HID" type="THID" minOccurs="0"/>
    1363     <xsd:element name="HPET" type="THPET" minOccurs="0"/>
    1364     <xsd:element name="Chipset" type="TChipset" minOccurs="0"/>
     1480    <xsd:element name="HPET" type="THPET" minOccurs="0"/> <!-- deprecated since v1.20. -->
     1481    <xsd:element name="Chipset" type="TChipset" minOccurs="0"/> <!-- deprecated since v1.20. -->
    13651482    <xsd:element name="Paravirt" type="TParavirt" minOccurs="0"/>
    13661483    <xsd:element name="Boot" type="TBoot" minOccurs="0">
     
    13741491    <xsd:element name="VideoCapture" type="TVideoCapture" minOccurs="0"/>
    13751492    <xsd:element name="RemoteDisplay" type="TRemoteDisplay" minOccurs="0"/>
    1376     <xsd:element name="BIOS" type="TBIOS" minOccurs="0"/>
     1493    <xsd:element name="BIOS" type="TFirmware" minOccurs="0"/> <!-- deprecated since v1.20. -->
    13771494    <xsd:element name="DVDDrive" type="TDVDDrive" minOccurs="0"/>
    13781495    <xsd:element name="FloppyDrive" type="TFloppyDrive" minOccurs="0"/>
     
    14111528    </xsd:element>
    14121529    <xsd:element name="AudioAdapter" type="TAudioAdapter" minOccurs="0"/>
    1413     <xsd:element name="RTC" type="TRTC" minOccurs="0"/>
     1530    <xsd:element name="RTC" type="TRTC" minOccurs="0"/> <!-- deprecated since v1.20. -->
    14141531    <xsd:element name="SharedFolders" type="TSharedFolders" minOccurs="0">
    14151532      <xsd:unique name="THardware-SharedFolders-SharedFolder">
     
    14511568    <xsd:element name="Teleporter" type="TTeleporter" minOccurs="0"/>
    14521569    <xsd:element name="Hardware" type="THardware"/>
     1570    <xsd:element name="Platform" type="TPlatform" minOccurs="0"/> <!-- new since v1.20. -->
    14531571    <xsd:element name="StorageControllers" type="TStorageControllers" minOccurs="0"/>
    14541572    <xsd:element name="HardDiskAttachments" type="THardDiskAttachments" minOccurs="0"/> <!-- deprecated -->
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