Index: trunk/include/VBox/err.h
===================================================================
--- trunk/include/VBox/err.h	(revision 100994)
+++ trunk/include/VBox/err.h	(revision 101035)
@@ -3136,4 +3136,12 @@
 /** @} */
 
+/** @name Platform Status Codes
+ * @{
+ */
+/** The selected platform architecture is not supported.
+ *  Depends on the context (host / VM). */
+#define VERR_PLATFORM_ARCH_NOT_SUPPORTED            (-7400)
+/** @} */
+
 /* SED-END */
 
Index: trunk/include/VBox/log.h
===================================================================
--- trunk/include/VBox/log.h	(revision 100994)
+++ trunk/include/VBox/log.h	(revision 101035)
@@ -399,6 +399,4 @@
     /** Main group, IBandwidthGroup. */
     LOG_GROUP_MAIN_BANDWIDTHGROUP,
-    /** Main group, IBIOSSettings. */
-    LOG_GROUP_MAIN_BIOSSETTINGS,
     /** Main group, IBooleanFormValue. */
     LOG_GROUP_MAIN_BOOLEANFORMVALUE,
@@ -483,4 +481,6 @@
     /** Main group, IFile. */
     LOG_GROUP_MAIN_FILE,
+    /** Main group, IFirmwareSettings. */
+    LOG_GROUP_MAIN_FIRMWARESETTINGS,
     /** Main group, IForm. */
     LOG_GROUP_MAIN_FORM,
@@ -557,4 +557,6 @@
     /** Main group, IHostVideoInputDevice. */
     LOG_GROUP_MAIN_HOSTVIDEOINPUTDEVICE,
+    /** Main group, IHostX86. */
+    LOG_GROUP_MAIN_HOSTX86,
     /** Main group, IInternalMachineControl. */
     LOG_GROUP_MAIN_INTERNALMACHINECONTROL,
@@ -599,4 +601,12 @@
     /** Main group, IPerformanceMetric. */
     LOG_GROUP_MAIN_PERFORMANCEMETRIC,
+    /** Main group, IPlatform. */
+    LOG_GROUP_MAIN_PLATFORM,
+    /** Main group, IPlatformARM. */
+    LOG_GROUP_MAIN_PLATFORMARM,
+    /** Main group, IPlatformProperties. */
+    LOG_GROUP_MAIN_PLATFORMPROPERTIES,
+    /** Main group, IPlatformX86. */
+    LOG_GROUP_MAIN_PLATFORMX86,
     /** Main group, IProcess. */
     LOG_GROUP_MAIN_PROCESS,
@@ -1021,5 +1031,4 @@
     "MAIN_BANDWIDTHCONTROL", \
     "MAIN_BANDWIDTHGROUP", \
-    "MAIN_BIOSSETTINGS", \
     "MAIN_BOOLEANFORMVALUE", \
     "MAIN_CERTIFICATE", \
@@ -1063,4 +1072,5 @@
     "MAIN_EXTPACKPLUGIN", \
     "MAIN_FILE", \
+    "MAIN_FIRMWARESETTINGS", \
     "MAIN_FORM", \
     "MAIN_FORMVALUE", \
@@ -1100,4 +1110,5 @@
     "MAIN_HOSTUSBDEVICEFILTER", \
     "MAIN_HOSTVIDEOINPUTDEVICE", \
+    "MAIN_HOSTX86", \
     "MAIN_INTERNALMACHINECONTROL", \
     "MAIN_INTERNALSESSIONCONTROL", \
@@ -1121,4 +1132,8 @@
     "MAIN_PERFORMANCECOLLECTOR", \
     "MAIN_PERFORMANCEMETRIC", \
+    "MAIN_PLATFORM", \
+    "MAIN_PLATFORMARM", \
+    "MAIN_PLATFORMPROPERTIES", \
+    "MAIN_PLATFORMX86", \
     "MAIN_PROCESS", \
     "MAIN_PROGRESS", \
Index: trunk/include/VBox/settings.h
===================================================================
--- trunk/include/VBox/settings.h	(revision 100994)
+++ trunk/include/VBox/settings.h	(revision 101035)
@@ -355,6 +355,12 @@
     uint32_t                uProxyMode; /**< ProxyMode_T */
     uint32_t                uLogHistoryCount;
+    com::Utf8Str            strLanguageId;
+};
+
+struct PlatformProperties
+{
+    PlatformProperties();
+
     bool                    fExclusiveHwVirt;
-    com::Utf8Str            strLanguageId;
 };
 
@@ -518,4 +524,5 @@
     Host                    host;
     SystemProperties        systemProperties;
+    PlatformProperties      platformProperties;
     MediaRegistry           mediaRegistry;
     MachinesRegistry        llMachines;
@@ -575,23 +582,24 @@
  * your settings might never get saved.
  */
-struct BIOSSettings
-{
-    BIOSSettings();
-
-    bool areDefaultSettings() const;
-
-    bool operator==(const BIOSSettings &d) const;
-
-    bool            fACPIEnabled,
-                    fIOAPICEnabled,
-                    fLogoFadeIn,
-                    fLogoFadeOut,
-                    fPXEDebugEnabled,
-                    fSmbiosUuidLittleEndian;
-    uint32_t        ulLogoDisplayTime;
-    BIOSBootMenuMode_T biosBootMenuMode;
-    APICMode_T      apicMode;           // requires settings version 1.16 (VirtualBox 5.1)
-    int64_t         llTimeOffset;
-    com::Utf8Str    strLogoImagePath;
+struct FirmwareSettings
+{
+    FirmwareSettings();
+
+    bool areDefaultSettings(CPUArchitecture_T enmCPUArch) const;
+
+    bool operator==(const FirmwareSettings &d) const;
+
+    FirmwareType_T         firmwareType;       // requires settings version 1.9 (VirtualBox 3.1)
+    bool                   fACPIEnabled,
+                           fIOAPICEnabled,
+                           fLogoFadeIn,
+                           fLogoFadeOut,
+                           fPXEDebugEnabled,
+                           fSmbiosUuidLittleEndian;
+    uint32_t               ulLogoDisplayTime;
+    FirmwareBootMenuMode_T enmBootMenuMode;
+    APICMode_T             apicMode;           // requires settings version 1.16 (VirtualBox 5.1)
+    int64_t                llTimeOffset;
+    com::Utf8Str           strLogoImagePath;
 };
 
@@ -931,5 +939,5 @@
 
     bool            fEnabled;
-    uint32_t        ulIOBase;
+    uint32_t        ulIOAddress;
     uint32_t        ulIRQ;
     PortMode_T      portMode;
@@ -1030,9 +1038,9 @@
  * your settings might never get saved.
  */
-struct CpuIdLeaf
-{
-    CpuIdLeaf();
-
-    bool operator==(const CpuIdLeaf &c) const;
+struct CpuIdLeafX86
+{
+    CpuIdLeafX86();
+
+    bool operator==(const CpuIdLeafX86 &c) const;
 
     uint32_t                idx;
@@ -1044,5 +1052,5 @@
 };
 
-typedef std::list<CpuIdLeaf> CpuIdLeafsList;
+typedef std::list<CpuIdLeafX86> CpuIdLeafsX86List;
 
 /**
@@ -1213,4 +1221,101 @@
 };
 
+#ifdef VBOX_WITH_VIRT_ARMV8
+struct PlatformARM
+{
+    PlatformARM();
+
+    bool operator==(const PlatformARM&) const;
+};
+#endif /* VBOX_WITH_VIRT_ARMV8 */
+
+/**
+ * Covers x86-specific platform attributes.
+ *
+ * New since settings v1.20 (VirtualBox 7.1).
+ * Contains attributes which were in the Hardware settings before.
+ */
+struct PlatformX86
+{
+    PlatformX86();
+
+    bool operator==(const PlatformX86&) const;
+
+    /** Note: Lived in Hardware for settings < version 1.20 (requires settings version 1.10 (VirtualBox 3.2). */
+    bool                    fPAE;
+    /** Note: Lived in Hardware for settings < version 1.20 (requires settings version 1.10 (VirtualBox 3.2). */
+    bool                    fAPIC;                  // requires settings version 1.16 (VirtualBox 5.1)
+    /** Note: Lived in Hardware for settings < version 1.20 (requires settings version 1.10 (VirtualBox 3.2). */
+    bool                    fX2APIC;                // requires settings version 1.16 (VirtualBox 5.1)
+    /** Note: Lived in Hardware for settings < version 1.20 (requires settings version 1.10 (VirtualBox 3.2). */
+    bool                    fHPETEnabled;
+    /** Note: Lived in Hardware for settings < version 1.20. */
+    typedef enum LongModeType { LongMode_Enabled, LongMode_Disabled, LongMode_Legacy } LongModeType;
+    /** Note: Lived in Hardware for settings < version 1.20. */
+    LongModeType            enmLongMode;
+    /** Custom x86 CPUID leafs list.
+     *  Note: Lived in Hardware for settings < version 1.20. */
+    CpuIdLeafsX86List       llCpuIdLeafs;
+    /** Note: Lived in Hardware for settings < version 1.20. */
+    bool                    fTripleFaultReset;
+    /** Note: Lived in Hardware for settings < version 1.20. */
+    bool                    fIBPBOnVMExit;          //< added out of cycle, after settings version 1.16 was out.
+    /** Note: Lived in Hardware for settings < version 1.20. */
+    bool                    fIBPBOnVMEntry;         //< added out of cycle, after settings version 1.16 was out.
+    /** Note: Lived in Hardware for settings < version 1.20. */
+    bool                    fSpecCtrl;              //< added out of cycle, after settings version 1.16 was out.
+    /** Note: Lived in Hardware for settings < version 1.20. */
+    bool                    fSpecCtrlByHost;        //< added out of cycle, after settings version 1.16 was out.
+    /** Note: Lived in Hardware for settings < version 1.20. */
+    bool                    fL1DFlushOnSched;       //< added out of cycle, after settings version 1.16 was out.
+    /** Note: Lived in Hardware for settings < version 1.20. */
+    bool                    fL1DFlushOnVMEntry;     //< added out of cycle, after settings version 1.16 was out.
+    /** Note: Lived in Hardware for settings < version 1.20. */
+    bool                    fMDSClearOnSched;       //< added out of cycle, after settings version 1.16 was out.
+    /** Note: Lived in Hardware for settings < version 1.20. */
+    bool                    fMDSClearOnVMEntry;     //< added out of cycle, after settings version 1.16 was out.
+    bool                    fHWVirtEx;
+    bool                    fHWVirtExNestedPaging;
+    bool                    fHWVirtExLargePages;
+    bool                    fHWVirtExVPID;
+    /** Unrestricted execution. */
+    bool                    fHWVirtExUX;
+    bool                    fHWVirtExForce;
+    bool                    fHWVirtExUseNativeApi;
+    /** AMD-V VMSAVE/VMLOAD. */
+    bool                    fHWVirtExVirtVmsaveVmload;
+    /** Nested VT-x / AMD-V.
+     *  Note: Lived in Hardware for settings < version 1.20. */
+    bool                    fNestedHWVirt;              //< requires settings version 1.17 (VirtualBox 6.0)
+};
+
+/**
+ * Covers common platform attributes.
+ *
+ * New since settings v1.20 (VirtualBox 7.1).
+ * Contains attributes which were in the Hardware settings before.
+ */
+struct Platform
+{
+    Platform();
+
+    bool operator==(const Platform&) const;
+
+    /** Requires settings version 1.20 (VirtualBox 7.1). */
+    PlatformArchitecture_T  architectureType;
+    /** Note: Lived in Hardware for settings < version 1.20 (requires settings version 1.11 (VirtualBox 4.0). */
+    ChipsetType_T           chipsetType;
+    /** Note: Lived in Hardware for settings < version 1.20 (requires settings version 1.19 (VirtualBox 6.2). */
+    IommuType_T             iommuType;
+    /** Note: Lived in Hardware for settings < version 1.20. */
+    bool                    fRTCUseUTC;
+    /** Note: Is a class, so we can't use a union here. */
+    PlatformX86             x86;
+#ifdef VBOX_WITH_VIRT_ARMV8
+    /** Note: Is a class, so we can't use a union here. */
+    PlatformARM             arm;
+#endif
+};
+
 /**
  * Representation of Machine hardware; this is used in the MachineConfigFile.hardwareMachine
@@ -1234,50 +1339,19 @@
     com::Utf8Str        strVersion;             // hardware version, optional
     com::Guid           uuid;                   // hardware uuid, optional (null).
-
-    bool                fHardwareVirt,
-                        fNestedPaging,
-                        fLargePages,
-                        fVPID,
-                        fUnrestrictedExecution,
-                        fHardwareVirtForce,
-                        fUseNativeApi,
-                        fSyntheticCpu,
-                        fTripleFaultReset,
-                        fPAE,
-                        fAPIC,                  // requires settings version 1.16 (VirtualBox 5.1)
-                        fX2APIC;                // requires settings version 1.16 (VirtualBox 5.1)
-    bool                fIBPBOnVMExit;          //< added out of cycle, after 1.16 was out.
-    bool                fIBPBOnVMEntry;         //< added out of cycle, after 1.16 was out.
-    bool                fSpecCtrl;              //< added out of cycle, after 1.16 was out.
-    bool                fSpecCtrlByHost;        //< added out of cycle, after 1.16 was out.
-    bool                fL1DFlushOnSched ;      //< added out of cycle, after 1.16 was out.
-    bool                fL1DFlushOnVMEntry ;    //< added out of cycle, after 1.16 was out.
-    bool                fMDSClearOnSched;       //< added out of cycle, after 1.16 was out.
-    bool                fMDSClearOnVMEntry;     //< added out of cycle, after 1.16 was out.
-    bool                fNestedHWVirt;          //< requires settings version 1.17 (VirtualBox 6.0)
-    bool                fVirtVmsaveVmload;      //< requires settings version 1.18 (VirtualBox 6.1)
-    typedef enum LongModeType { LongMode_Enabled, LongMode_Disabled, LongMode_Legacy } LongModeType;
-    LongModeType        enmLongMode;
+    bool                fSyntheticCpu;
     uint32_t            cCPUs;
     bool                fCpuHotPlug;            // requires settings version 1.10 (VirtualBox 3.2)
     CpuList             llCpus;                 // requires settings version 1.10 (VirtualBox 3.2)
-    bool                fHPETEnabled;           // requires settings version 1.10 (VirtualBox 3.2)
     uint32_t            ulCpuExecutionCap;      // requires settings version 1.11 (VirtualBox 3.3)
     uint32_t            uCpuIdPortabilityLevel; // requires settings version 1.15 (VirtualBox 5.0)
     com::Utf8Str        strCpuProfile;          // requires settings version 1.16 (VirtualBox 5.1)
 
-    CpuIdLeafsList      llCpuIdLeafs;
-
     uint32_t            ulMemorySizeMB;
 
     BootOrderMap        mapBootOrder;           // item 0 has highest priority
-
-    FirmwareType_T      firmwareType;           // requires settings version 1.9 (VirtualBox 3.1)
 
     PointingHIDType_T   pointingHIDType;        // requires settings version 1.10 (VirtualBox 3.2)
     KeyboardHIDType_T   keyboardHIDType;        // requires settings version 1.10 (VirtualBox 3.2)
 
-    ChipsetType_T       chipsetType;            // requires settings version 1.11 (VirtualBox 4.0)
-    IommuType_T         iommuType;              // requires settings version 1.19 (VirtualBox 6.2)
     ParavirtProvider_T  paravirtProvider;       // requires settings version 1.15 (VirtualBox 4.4)
     com::Utf8Str        strParavirtDebug;       // requires settings version 1.16 (VirtualBox 5.1)
@@ -1287,5 +1361,6 @@
     VRDESettings        vrdeSettings;
 
-    BIOSSettings        biosSettings;
+    Platform            platformSettings;       // new since 1.20 (VirtualBox 7.1)
+    FirmwareSettings    firmwareSettings;
     NvramSettings       nvramSettings;
     GraphicsAdapter     graphicsAdapter;
@@ -1408,5 +1483,4 @@
     com::Utf8Str            strTeleporterAddress;
     com::Utf8Str            strTeleporterPassword;
-    bool                    fRTCUseUTC;
     IconBlob                ovIcon;
     VMProcPriority_T        enmVMPriority;
@@ -1492,5 +1566,5 @@
     void readNetworkAdapters(const xml::ElementNode &elmHardware, NetworkAdaptersList &ll);
     void readAttachedNetworkMode(const xml::ElementNode &pelmMode, bool fEnabled, NetworkAdapter &nic);
-    void readCpuIdTree(const xml::ElementNode &elmCpuid, CpuIdLeafsList &ll);
+    void readCpuIdTreeX86(const xml::ElementNode &elmCpuid, CpuIdLeafsX86List &ll);
     void readCpuTree(const xml::ElementNode &elmCpu, CpuList &ll);
     void readSerialPorts(const xml::ElementNode &elmUART, SerialPortsList &ll);
@@ -1499,4 +1573,7 @@
     void readGuestProperties(const xml::ElementNode &elmGuestProperties, Hardware &hw);
     void readStorageControllerAttributes(const xml::ElementNode &elmStorageController, StorageController &sctl);
+    void readPlatformCPUIDTreeX86(const xml::ElementNode &elmChild, PlatformX86 &platX86);
+    void readPlatformX86(const xml::ElementNode &elmPlatform,PlatformX86 &platX86);
+    void readPlatform(const xml::ElementNode &elmPlatform, Platform &plat);
     void readHardware(const xml::ElementNode &elmHardware, Hardware &hw);
     void readHardDiskAttachments_pre1_7(const xml::ElementNode &elmHardDiskAttachments, Storage &strg);
@@ -1513,4 +1590,6 @@
     void readMachineEncrypted(const xml::ElementNode &elmMachine, PCVBOXCRYPTOIF pCryptoIf, const char *pszPassword);
 
+    void buildPlatformX86XML(xml::ElementNode &elmParent, xml::ElementNode &elmCPU, const PlatformX86 &plat);
+    void buildPlatformXML(xml::ElementNode &elmParent, const Hardware &h, const Platform &plat);
     void buildHardwareXML(xml::ElementNode &elmParent, const Hardware &hw, uint32_t fl, std::list<xml::ElementNode*> *pllElementsWithUuidAttributes);
     void buildNetworkXML(NetworkAttachmentType_T mode, bool fEnabled, xml::ElementNode &elmParent, const NetworkAdapter &nic);
