VirtualBox

Changeset 83133 in vbox


Ignore:
Timestamp:
Feb 21, 2020 1:41:09 PM (5 years ago)
Author:
vboxsync
Message:

SMBIOS: For memory sizes larger than 32766MB, use the extended size for DIMM descriptor. Fixes Mojave/Catalina panic with large guest RAM sizes.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/PC/DevFwCommon.cpp

    r83032 r83133  
    290290    /* v2.6+ */
    291291    uint8_t         u8Attributes;
     292    /* v2.7+ */
     293    uint32_t        u32ExtendedSize;
     294    uint16_t        u16CfgSpeed;    /* Configured speed in MT/sec. */
    292295} *PDMIMEMORYDEV;
    293 AssertCompileSize(DMIMEMORYDEV, 28);
     296AssertCompileSize(DMIMEMORYDEV, 34);
    294297
    295298/** MPS floating pointer structure */
     
    868871        pMemDev->u16DataWidth            = 0xffff; /* Unknown */
    869872        int16_t u16RamSizeM;
     873        int32_t u32ExtRamSizeM = 0;
    870874        if (cbRamSize / _1M > INT16_MAX)
    871875        {
    872             /** @todo 32G-1M limit. Provide multiple type-17 descriptors.
    873              * The highest bit of u16Size must be 0 to specify 'GB' units / 1 would be 'KB' */
     876            /* The highest bit of u16Size must be 0 to specify 'GB' units / 1 would be 'KB'.
     877             * SMBIOS 2.7 intruduced a 32-bit extended size. If module size is 32GB or greater,
     878             * the old u16Size is set to 7FFFh; old parsers will see 32GB-1MB, new parsers will
     879             * look at new u32ExtendedSize which can represent at least 128TB. OS X 10.14+ looks
     880             * at the extended size.
     881             */
    874882            AssertLogRelMsgFailed(("DMI: RAM size %#RX64 too big for one type-17 descriptor, clipping to %#RX64\n",
    875883                                   cbRamSize, (uint64_t)INT16_MAX * _1M));
    876884            u16RamSizeM = INT16_MAX;
     885            if (cbRamSize / _1M >= 0x8000000) {
     886                AssertLogRelMsgFailed(("DMI: RAM size %#RX64 too big for one type-17 descriptor, clipping to %#RX64\n",
     887                                       cbRamSize, (uint64_t)INT32_MAX * _1M));
     888                u32ExtRamSizeM = 0x8000000; /* 128TB */
     889            }
     890            else
     891                u32ExtRamSizeM = cbRamSize / _1M;
    877892        }
    878893        else
     
    881896            u16RamSizeM = 0x400; /* 1G */
    882897        pMemDev->u16Size                 = u16RamSizeM; /* RAM size */
     898        pMemDev->u32ExtendedSize         = u32ExtRamSizeM;
    883899        pMemDev->u8FormFactor            = 0x09; /* DIMM */
    884900        pMemDev->u8DeviceSet             = 0x00; /* Not part of a device set */
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