VirtualBox

Changeset 81557 in vbox


Ignore:
Timestamp:
Oct 28, 2019 7:37:58 AM (5 years ago)
Author:
vboxsync
Message:

DevEFI.cpp,DevPcBios.cpp: The SMBIOS spec requires UUID to be stored in little endian format (see chapter 7.2.1), introduce a CFGM key to control the behavior from the Main API to not cause trouble with existing guests (Windows reactivation etc.)

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

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/EFI/DevEFI.cpp

    r81514 r81557  
    23862386                                  "McfgLength|"
    23872387                                  "UUID|"
     2388                                  "UuidLe|"
    23882389                                  "IOAPIC|"
    23892390                                  "APIC|"
     
    24632464                                N_("Configuration error: Querying \"UUID\" failed"));
    24642465
    2465     /*
    2466      * Convert the UUID to network byte order. Not entirely straightforward as
    2467      * parts are MSB already...
    2468      */
    2469     uuid.Gen.u32TimeLow = RT_H2BE_U32(uuid.Gen.u32TimeLow);
    2470     uuid.Gen.u16TimeMid = RT_H2BE_U16(uuid.Gen.u16TimeMid);
    2471     uuid.Gen.u16TimeHiAndVersion = RT_H2BE_U16(uuid.Gen.u16TimeHiAndVersion);
     2466    bool fUuidLe;
     2467    rc = pHlp->pfnCFGMQueryBoolDef(pCfg, "UuidLe", &fUuidLe, false);
     2468    if (RT_FAILURE(rc))
     2469        return PDMDEV_SET_ERROR(pDevIns, rc,
     2470                                N_("Configuration error: Querying \"UuidLe\" failed"));
     2471
     2472    if (!fUuidLe)
     2473    {
     2474        /*
     2475         * UUIDs are stored little endian actually (see chapter 7.2.1 System — UUID
     2476         * of the DMI/SMBIOS spec) but to not force reactivation of existing guests we have
     2477         * to carry this bug along... (see also DevPcBios.cpp when changing this)
     2478         *
     2479         * Convert the UUID to network byte order. Not entirely straightforward as
     2480         * parts are MSB already...
     2481         */
     2482        uuid.Gen.u32TimeLow = RT_H2BE_U32(uuid.Gen.u32TimeLow);
     2483        uuid.Gen.u16TimeMid = RT_H2BE_U16(uuid.Gen.u16TimeMid);
     2484        uuid.Gen.u16TimeHiAndVersion = RT_H2BE_U16(uuid.Gen.u16TimeHiAndVersion);
     2485    }
    24722486    memcpy(&pThisCC->aUuid, &uuid, sizeof pThisCC->aUuid);
    24732487
  • trunk/src/VBox/Devices/PC/DevPcBios.cpp

    r80704 r81557  
    12161216                              "PXEDebug\0"
    12171217                              "UUID\0"
     1218                              "UuidLe\0"
    12181219                              "IOAPIC\0"
    12191220                              "APIC\0"
     
    15751576                                N_("Configuration error: Querying \"UUID\" failed"));
    15761577
    1577     /* Convert the UUID to network byte order. Not entirely straightforward as parts are MSB already... */
    1578     uuid.Gen.u32TimeLow = RT_H2BE_U32(uuid.Gen.u32TimeLow);
    1579     uuid.Gen.u16TimeMid = RT_H2BE_U16(uuid.Gen.u16TimeMid);
    1580     uuid.Gen.u16TimeHiAndVersion = RT_H2BE_U16(uuid.Gen.u16TimeHiAndVersion);
     1578    bool fUuidLe;
     1579    rc = CFGMR3QueryBoolDef(pCfg, "UuidLe", &fUuidLe, false);
     1580    if (RT_FAILURE(rc))
     1581        return PDMDEV_SET_ERROR(pDevIns, rc,
     1582                                N_("Configuration error: Querying \"UuidLe\" failed"));
     1583
     1584    if (!fUuidLe)
     1585    {
     1586        /*
     1587         * UUIDs are stored little endian actually (see chapter 7.2.1 System — UUID
     1588         * of the DMI/SMBIOS spec) but to not force reactivation of existing guests we have
     1589         * to carry this bug along... (see also DevEFI.cpp when changing this)
     1590         *
     1591         * Convert the UUID to network byte order. Not entirely straightforward as
     1592         * parts are MSB already...
     1593         */
     1594        uuid.Gen.u32TimeLow = RT_H2BE_U32(uuid.Gen.u32TimeLow);
     1595        uuid.Gen.u16TimeMid = RT_H2BE_U16(uuid.Gen.u16TimeMid);
     1596        uuid.Gen.u16TimeHiAndVersion = RT_H2BE_U16(uuid.Gen.u16TimeHiAndVersion);
     1597    }
     1598
    15811599    uint16_t cbDmiTables = 0;
    15821600    uint16_t cNumDmiTables = 0;
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