VirtualBox

Changeset 101035 in vbox for trunk/include/VBox


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/include/VBox
Files:
3 edited

Legend:

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

    r100804 r101035  
    31363136/** @} */
    31373137
     3138/** @name Platform Status Codes
     3139 * @{
     3140 */
     3141/** The selected platform architecture is not supported.
     3142 *  Depends on the context (host / VM). */
     3143#define VERR_PLATFORM_ARCH_NOT_SUPPORTED            (-7400)
     3144/** @} */
     3145
    31383146/* SED-END */
    31393147
  • trunk/include/VBox/log.h

    r100868 r101035  
    399399    /** Main group, IBandwidthGroup. */
    400400    LOG_GROUP_MAIN_BANDWIDTHGROUP,
    401     /** Main group, IBIOSSettings. */
    402     LOG_GROUP_MAIN_BIOSSETTINGS,
    403401    /** Main group, IBooleanFormValue. */
    404402    LOG_GROUP_MAIN_BOOLEANFORMVALUE,
     
    483481    /** Main group, IFile. */
    484482    LOG_GROUP_MAIN_FILE,
     483    /** Main group, IFirmwareSettings. */
     484    LOG_GROUP_MAIN_FIRMWARESETTINGS,
    485485    /** Main group, IForm. */
    486486    LOG_GROUP_MAIN_FORM,
     
    557557    /** Main group, IHostVideoInputDevice. */
    558558    LOG_GROUP_MAIN_HOSTVIDEOINPUTDEVICE,
     559    /** Main group, IHostX86. */
     560    LOG_GROUP_MAIN_HOSTX86,
    559561    /** Main group, IInternalMachineControl. */
    560562    LOG_GROUP_MAIN_INTERNALMACHINECONTROL,
     
    599601    /** Main group, IPerformanceMetric. */
    600602    LOG_GROUP_MAIN_PERFORMANCEMETRIC,
     603    /** Main group, IPlatform. */
     604    LOG_GROUP_MAIN_PLATFORM,
     605    /** Main group, IPlatformARM. */
     606    LOG_GROUP_MAIN_PLATFORMARM,
     607    /** Main group, IPlatformProperties. */
     608    LOG_GROUP_MAIN_PLATFORMPROPERTIES,
     609    /** Main group, IPlatformX86. */
     610    LOG_GROUP_MAIN_PLATFORMX86,
    601611    /** Main group, IProcess. */
    602612    LOG_GROUP_MAIN_PROCESS,
     
    10211031    "MAIN_BANDWIDTHCONTROL", \
    10221032    "MAIN_BANDWIDTHGROUP", \
    1023     "MAIN_BIOSSETTINGS", \
    10241033    "MAIN_BOOLEANFORMVALUE", \
    10251034    "MAIN_CERTIFICATE", \
     
    10631072    "MAIN_EXTPACKPLUGIN", \
    10641073    "MAIN_FILE", \
     1074    "MAIN_FIRMWARESETTINGS", \
    10651075    "MAIN_FORM", \
    10661076    "MAIN_FORMVALUE", \
     
    11001110    "MAIN_HOSTUSBDEVICEFILTER", \
    11011111    "MAIN_HOSTVIDEOINPUTDEVICE", \
     1112    "MAIN_HOSTX86", \
    11021113    "MAIN_INTERNALMACHINECONTROL", \
    11031114    "MAIN_INTERNALSESSIONCONTROL", \
     
    11211132    "MAIN_PERFORMANCECOLLECTOR", \
    11221133    "MAIN_PERFORMANCEMETRIC", \
     1134    "MAIN_PLATFORM", \
     1135    "MAIN_PLATFORMARM", \
     1136    "MAIN_PLATFORMPROPERTIES", \
     1137    "MAIN_PLATFORMX86", \
    11231138    "MAIN_PROCESS", \
    11241139    "MAIN_PROGRESS", \
  • trunk/include/VBox/settings.h

    r98103 r101035  
    355355    uint32_t                uProxyMode; /**< ProxyMode_T */
    356356    uint32_t                uLogHistoryCount;
     357    com::Utf8Str            strLanguageId;
     358};
     359
     360struct PlatformProperties
     361{
     362    PlatformProperties();
     363
    357364    bool                    fExclusiveHwVirt;
    358     com::Utf8Str            strLanguageId;
    359365};
    360366
     
    518524    Host                    host;
    519525    SystemProperties        systemProperties;
     526    PlatformProperties      platformProperties;
    520527    MediaRegistry           mediaRegistry;
    521528    MachinesRegistry        llMachines;
     
    575582 * your settings might never get saved.
    576583 */
    577 struct BIOSSettings
    578 {
    579     BIOSSettings();
    580 
    581     bool areDefaultSettings() const;
    582 
    583     bool operator==(const BIOSSettings &d) const;
    584 
    585     bool            fACPIEnabled,
    586                     fIOAPICEnabled,
    587                     fLogoFadeIn,
    588                     fLogoFadeOut,
    589                     fPXEDebugEnabled,
    590                     fSmbiosUuidLittleEndian;
    591     uint32_t        ulLogoDisplayTime;
    592     BIOSBootMenuMode_T biosBootMenuMode;
    593     APICMode_T      apicMode;           // requires settings version 1.16 (VirtualBox 5.1)
    594     int64_t         llTimeOffset;
    595     com::Utf8Str    strLogoImagePath;
     584struct FirmwareSettings
     585{
     586    FirmwareSettings();
     587
     588    bool areDefaultSettings(CPUArchitecture_T enmCPUArch) const;
     589
     590    bool operator==(const FirmwareSettings &d) const;
     591
     592    FirmwareType_T         firmwareType;       // requires settings version 1.9 (VirtualBox 3.1)
     593    bool                   fACPIEnabled,
     594                           fIOAPICEnabled,
     595                           fLogoFadeIn,
     596                           fLogoFadeOut,
     597                           fPXEDebugEnabled,
     598                           fSmbiosUuidLittleEndian;
     599    uint32_t               ulLogoDisplayTime;
     600    FirmwareBootMenuMode_T enmBootMenuMode;
     601    APICMode_T             apicMode;           // requires settings version 1.16 (VirtualBox 5.1)
     602    int64_t                llTimeOffset;
     603    com::Utf8Str           strLogoImagePath;
    596604};
    597605
     
    931939
    932940    bool            fEnabled;
    933     uint32_t        ulIOBase;
     941    uint32_t        ulIOAddress;
    934942    uint32_t        ulIRQ;
    935943    PortMode_T      portMode;
     
    10301038 * your settings might never get saved.
    10311039 */
    1032 struct CpuIdLeaf
    1033 {
    1034     CpuIdLeaf();
    1035 
    1036     bool operator==(const CpuIdLeaf &c) const;
     1040struct CpuIdLeafX86
     1041{
     1042    CpuIdLeafX86();
     1043
     1044    bool operator==(const CpuIdLeafX86 &c) const;
    10371045
    10381046    uint32_t                idx;
     
    10441052};
    10451053
    1046 typedef std::list<CpuIdLeaf> CpuIdLeafsList;
     1054typedef std::list<CpuIdLeafX86> CpuIdLeafsX86List;
    10471055
    10481056/**
     
    12131221};
    12141222
     1223#ifdef VBOX_WITH_VIRT_ARMV8
     1224struct PlatformARM
     1225{
     1226    PlatformARM();
     1227
     1228    bool operator==(const PlatformARM&) const;
     1229};
     1230#endif /* VBOX_WITH_VIRT_ARMV8 */
     1231
     1232/**
     1233 * Covers x86-specific platform attributes.
     1234 *
     1235 * New since settings v1.20 (VirtualBox 7.1).
     1236 * Contains attributes which were in the Hardware settings before.
     1237 */
     1238struct PlatformX86
     1239{
     1240    PlatformX86();
     1241
     1242    bool operator==(const PlatformX86&) const;
     1243
     1244    /** Note: Lived in Hardware for settings < version 1.20 (requires settings version 1.10 (VirtualBox 3.2). */
     1245    bool                    fPAE;
     1246    /** Note: Lived in Hardware for settings < version 1.20 (requires settings version 1.10 (VirtualBox 3.2). */
     1247    bool                    fAPIC;                  // requires settings version 1.16 (VirtualBox 5.1)
     1248    /** Note: Lived in Hardware for settings < version 1.20 (requires settings version 1.10 (VirtualBox 3.2). */
     1249    bool                    fX2APIC;                // requires settings version 1.16 (VirtualBox 5.1)
     1250    /** Note: Lived in Hardware for settings < version 1.20 (requires settings version 1.10 (VirtualBox 3.2). */
     1251    bool                    fHPETEnabled;
     1252    /** Note: Lived in Hardware for settings < version 1.20. */
     1253    typedef enum LongModeType { LongMode_Enabled, LongMode_Disabled, LongMode_Legacy } LongModeType;
     1254    /** Note: Lived in Hardware for settings < version 1.20. */
     1255    LongModeType            enmLongMode;
     1256    /** Custom x86 CPUID leafs list.
     1257     *  Note: Lived in Hardware for settings < version 1.20. */
     1258    CpuIdLeafsX86List       llCpuIdLeafs;
     1259    /** Note: Lived in Hardware for settings < version 1.20. */
     1260    bool                    fTripleFaultReset;
     1261    /** Note: Lived in Hardware for settings < version 1.20. */
     1262    bool                    fIBPBOnVMExit;          //< added out of cycle, after settings version 1.16 was out.
     1263    /** Note: Lived in Hardware for settings < version 1.20. */
     1264    bool                    fIBPBOnVMEntry;         //< added out of cycle, after settings version 1.16 was out.
     1265    /** Note: Lived in Hardware for settings < version 1.20. */
     1266    bool                    fSpecCtrl;              //< added out of cycle, after settings version 1.16 was out.
     1267    /** Note: Lived in Hardware for settings < version 1.20. */
     1268    bool                    fSpecCtrlByHost;        //< added out of cycle, after settings version 1.16 was out.
     1269    /** Note: Lived in Hardware for settings < version 1.20. */
     1270    bool                    fL1DFlushOnSched;       //< added out of cycle, after settings version 1.16 was out.
     1271    /** Note: Lived in Hardware for settings < version 1.20. */
     1272    bool                    fL1DFlushOnVMEntry;     //< added out of cycle, after settings version 1.16 was out.
     1273    /** Note: Lived in Hardware for settings < version 1.20. */
     1274    bool                    fMDSClearOnSched;       //< added out of cycle, after settings version 1.16 was out.
     1275    /** Note: Lived in Hardware for settings < version 1.20. */
     1276    bool                    fMDSClearOnVMEntry;     //< added out of cycle, after settings version 1.16 was out.
     1277    bool                    fHWVirtEx;
     1278    bool                    fHWVirtExNestedPaging;
     1279    bool                    fHWVirtExLargePages;
     1280    bool                    fHWVirtExVPID;
     1281    /** Unrestricted execution. */
     1282    bool                    fHWVirtExUX;
     1283    bool                    fHWVirtExForce;
     1284    bool                    fHWVirtExUseNativeApi;
     1285    /** AMD-V VMSAVE/VMLOAD. */
     1286    bool                    fHWVirtExVirtVmsaveVmload;
     1287    /** Nested VT-x / AMD-V.
     1288     *  Note: Lived in Hardware for settings < version 1.20. */
     1289    bool                    fNestedHWVirt;              //< requires settings version 1.17 (VirtualBox 6.0)
     1290};
     1291
     1292/**
     1293 * Covers common platform attributes.
     1294 *
     1295 * New since settings v1.20 (VirtualBox 7.1).
     1296 * Contains attributes which were in the Hardware settings before.
     1297 */
     1298struct Platform
     1299{
     1300    Platform();
     1301
     1302    bool operator==(const Platform&) const;
     1303
     1304    /** Requires settings version 1.20 (VirtualBox 7.1). */
     1305    PlatformArchitecture_T  architectureType;
     1306    /** Note: Lived in Hardware for settings < version 1.20 (requires settings version 1.11 (VirtualBox 4.0). */
     1307    ChipsetType_T           chipsetType;
     1308    /** Note: Lived in Hardware for settings < version 1.20 (requires settings version 1.19 (VirtualBox 6.2). */
     1309    IommuType_T             iommuType;
     1310    /** Note: Lived in Hardware for settings < version 1.20. */
     1311    bool                    fRTCUseUTC;
     1312    /** Note: Is a class, so we can't use a union here. */
     1313    PlatformX86             x86;
     1314#ifdef VBOX_WITH_VIRT_ARMV8
     1315    /** Note: Is a class, so we can't use a union here. */
     1316    PlatformARM             arm;
     1317#endif
     1318};
     1319
    12151320/**
    12161321 * Representation of Machine hardware; this is used in the MachineConfigFile.hardwareMachine
     
    12341339    com::Utf8Str        strVersion;             // hardware version, optional
    12351340    com::Guid           uuid;                   // hardware uuid, optional (null).
    1236 
    1237     bool                fHardwareVirt,
    1238                         fNestedPaging,
    1239                         fLargePages,
    1240                         fVPID,
    1241                         fUnrestrictedExecution,
    1242                         fHardwareVirtForce,
    1243                         fUseNativeApi,
    1244                         fSyntheticCpu,
    1245                         fTripleFaultReset,
    1246                         fPAE,
    1247                         fAPIC,                  // requires settings version 1.16 (VirtualBox 5.1)
    1248                         fX2APIC;                // requires settings version 1.16 (VirtualBox 5.1)
    1249     bool                fIBPBOnVMExit;          //< added out of cycle, after 1.16 was out.
    1250     bool                fIBPBOnVMEntry;         //< added out of cycle, after 1.16 was out.
    1251     bool                fSpecCtrl;              //< added out of cycle, after 1.16 was out.
    1252     bool                fSpecCtrlByHost;        //< added out of cycle, after 1.16 was out.
    1253     bool                fL1DFlushOnSched ;      //< added out of cycle, after 1.16 was out.
    1254     bool                fL1DFlushOnVMEntry ;    //< added out of cycle, after 1.16 was out.
    1255     bool                fMDSClearOnSched;       //< added out of cycle, after 1.16 was out.
    1256     bool                fMDSClearOnVMEntry;     //< added out of cycle, after 1.16 was out.
    1257     bool                fNestedHWVirt;          //< requires settings version 1.17 (VirtualBox 6.0)
    1258     bool                fVirtVmsaveVmload;      //< requires settings version 1.18 (VirtualBox 6.1)
    1259     typedef enum LongModeType { LongMode_Enabled, LongMode_Disabled, LongMode_Legacy } LongModeType;
    1260     LongModeType        enmLongMode;
     1341    bool                fSyntheticCpu;
    12611342    uint32_t            cCPUs;
    12621343    bool                fCpuHotPlug;            // requires settings version 1.10 (VirtualBox 3.2)
    12631344    CpuList             llCpus;                 // requires settings version 1.10 (VirtualBox 3.2)
    1264     bool                fHPETEnabled;           // requires settings version 1.10 (VirtualBox 3.2)
    12651345    uint32_t            ulCpuExecutionCap;      // requires settings version 1.11 (VirtualBox 3.3)
    12661346    uint32_t            uCpuIdPortabilityLevel; // requires settings version 1.15 (VirtualBox 5.0)
    12671347    com::Utf8Str        strCpuProfile;          // requires settings version 1.16 (VirtualBox 5.1)
    12681348
    1269     CpuIdLeafsList      llCpuIdLeafs;
    1270 
    12711349    uint32_t            ulMemorySizeMB;
    12721350
    12731351    BootOrderMap        mapBootOrder;           // item 0 has highest priority
    1274 
    1275     FirmwareType_T      firmwareType;           // requires settings version 1.9 (VirtualBox 3.1)
    12761352
    12771353    PointingHIDType_T   pointingHIDType;        // requires settings version 1.10 (VirtualBox 3.2)
    12781354    KeyboardHIDType_T   keyboardHIDType;        // requires settings version 1.10 (VirtualBox 3.2)
    12791355
    1280     ChipsetType_T       chipsetType;            // requires settings version 1.11 (VirtualBox 4.0)
    1281     IommuType_T         iommuType;              // requires settings version 1.19 (VirtualBox 6.2)
    12821356    ParavirtProvider_T  paravirtProvider;       // requires settings version 1.15 (VirtualBox 4.4)
    12831357    com::Utf8Str        strParavirtDebug;       // requires settings version 1.16 (VirtualBox 5.1)
     
    12871361    VRDESettings        vrdeSettings;
    12881362
    1289     BIOSSettings        biosSettings;
     1363    Platform            platformSettings;       // new since 1.20 (VirtualBox 7.1)
     1364    FirmwareSettings    firmwareSettings;
    12901365    NvramSettings       nvramSettings;
    12911366    GraphicsAdapter     graphicsAdapter;
     
    14081483    com::Utf8Str            strTeleporterAddress;
    14091484    com::Utf8Str            strTeleporterPassword;
    1410     bool                    fRTCUseUTC;
    14111485    IconBlob                ovIcon;
    14121486    VMProcPriority_T        enmVMPriority;
     
    14921566    void readNetworkAdapters(const xml::ElementNode &elmHardware, NetworkAdaptersList &ll);
    14931567    void readAttachedNetworkMode(const xml::ElementNode &pelmMode, bool fEnabled, NetworkAdapter &nic);
    1494     void readCpuIdTree(const xml::ElementNode &elmCpuid, CpuIdLeafsList &ll);
     1568    void readCpuIdTreeX86(const xml::ElementNode &elmCpuid, CpuIdLeafsX86List &ll);
    14951569    void readCpuTree(const xml::ElementNode &elmCpu, CpuList &ll);
    14961570    void readSerialPorts(const xml::ElementNode &elmUART, SerialPortsList &ll);
     
    14991573    void readGuestProperties(const xml::ElementNode &elmGuestProperties, Hardware &hw);
    15001574    void readStorageControllerAttributes(const xml::ElementNode &elmStorageController, StorageController &sctl);
     1575    void readPlatformCPUIDTreeX86(const xml::ElementNode &elmChild, PlatformX86 &platX86);
     1576    void readPlatformX86(const xml::ElementNode &elmPlatform,PlatformX86 &platX86);
     1577    void readPlatform(const xml::ElementNode &elmPlatform, Platform &plat);
    15011578    void readHardware(const xml::ElementNode &elmHardware, Hardware &hw);
    15021579    void readHardDiskAttachments_pre1_7(const xml::ElementNode &elmHardDiskAttachments, Storage &strg);
     
    15131590    void readMachineEncrypted(const xml::ElementNode &elmMachine, PCVBOXCRYPTOIF pCryptoIf, const char *pszPassword);
    15141591
     1592    void buildPlatformX86XML(xml::ElementNode &elmParent, xml::ElementNode &elmCPU, const PlatformX86 &plat);
     1593    void buildPlatformXML(xml::ElementNode &elmParent, const Hardware &h, const Platform &plat);
    15151594    void buildHardwareXML(xml::ElementNode &elmParent, const Hardware &hw, uint32_t fl, std::list<xml::ElementNode*> *pllElementsWithUuidAttributes);
    15161595    void buildNetworkXML(NetworkAttachmentType_T mode, bool fEnabled, xml::ElementNode &elmParent, const NetworkAdapter &nic);
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