VirtualBox

Changeset 71061 in vbox


Ignore:
Timestamp:
Feb 19, 2018 5:03:41 PM (7 years ago)
Author:
vboxsync
Message:

EFI: Moved SMBIOS header into the ROM area which already holds the SMBIOS and MPS tables.

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

Legend:

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

    r69500 r71061  
    17931793     * Plant some structures in RAM.
    17941794     */
    1795     FwCommonPlantSmbiosAndDmiHdrs(pDevIns, pThis->cbDmiTables, pThis->cNumDmiTables);
    17961795    if (pThis->u8IOAPIC)
    17971796        FwCommonPlantMpsFloatPtr(pDevIns);
     
    23882387
    23892388    /*
    2390      * Plant DMI and MPS tables.
    2391      */
    2392     /** @todo XXX I wonder if we really need these tables as there is no SMBIOS header... */
     2389     * Plant DMI and MPS tables in the ROM region.
     2390     */
    23932391    rc = FwCommonPlantDMITable(pDevIns, pThis->au8DMIPage, VBOX_DMI_TABLE_SIZE, &pThis->aUuid,
    23942392                               pDevIns->pCfg, pThis->cCpus, &pThis->cbDmiTables, &pThis->cNumDmiTables);
    23952393    AssertRCReturn(rc, rc);
     2394
     2395    /*
     2396     * NB: VBox/Devices/EFI/Firmware/VBoxPkg/VBoxSysTables/VBoxSysTables.c scans memory for
     2397     * the SMBIOS header. The header must be placed in a range that EFI will scan.
     2398     */
     2399    FwCommonPlantSmbiosAndDmiHdrs(pDevIns, pThis->au8DMIPage + VBOX_DMI_TABLE_SIZE,
     2400                                  pThis->cbDmiTables, pThis->cNumDmiTables);
     2401
    23962402    if (pThis->u8IOAPIC)
    23972403        FwCommonPlantMpsTable(pDevIns,
    2398                               pThis->au8DMIPage + VBOX_DMI_TABLE_SIZE,
    2399                               _4K - VBOX_DMI_TABLE_SIZE, pThis->cCpus);
     2404                              pThis->au8DMIPage + VBOX_DMI_TABLE_SIZE + VBOX_DMI_HDR_SIZE,
     2405                              _4K - VBOX_DMI_TABLE_SIZE - VBOX_DMI_HDR_SIZE, pThis->cCpus);
     2406
    24002407    rc = PDMDevHlpROMRegister(pDevIns, VBOX_DMI_TABLE_BASE, _4K, pThis->au8DMIPage, _4K,
    24012408                              PGMPHYS_ROM_FLAGS_PERMANENT_BINARY, "DMI tables");
  • trunk/src/VBox/Devices/PC/DevFwCommon.cpp

    r69500 r71061  
    118118} *DMIMAINHDRPTR;
    119119AssertCompileSize(DMIMAINHDR, 15);
     120
     121AssertCompile(sizeof(SMBIOSHDR) + sizeof(DMIMAINHDR) <= VBOX_DMI_HDR_SIZE);
    120122
    121123/** DMI header */
     
    956958 *
    957959 * @param   pDevIns         The device instance data.
     960 * @param   pHdr            Pointer to the header destination.
    958961 * @param   cbDmiTables     Size of all DMI tables planted in bytes.
    959962 * @param   cNumDmiTables   Number of DMI tables planted.
    960963 */
    961 void FwCommonPlantSmbiosAndDmiHdrs(PPDMDEVINS pDevIns, uint16_t cbDmiTables, uint16_t cNumDmiTables)
    962 {
     964void FwCommonPlantSmbiosAndDmiHdrs(PPDMDEVINS pDevIns, uint8_t *pHdr, uint16_t cbDmiTables, uint16_t cNumDmiTables)
     965{
     966    RT_NOREF(pDevIns);
     967
    963968    struct
    964969    {
     
    9951000    aBiosHeaders.dmi.u8Checksum      = fwCommonChecksum((uint8_t*)&aBiosHeaders.dmi,    sizeof(aBiosHeaders.dmi));
    9961001
    997     PDMDevHlpPhysWrite(pDevIns, 0xfe300, &aBiosHeaders, sizeof(aBiosHeaders));
     1002    memcpy(pHdr, &aBiosHeaders, sizeof(aBiosHeaders));
    9981003}
    9991004
  • trunk/src/VBox/Devices/PC/DevFwCommon.h

    r69500 r71061  
    2929/* Plant DMI table */
    3030int FwCommonPlantDMITable(PPDMDEVINS pDevIns, uint8_t *pTable, unsigned cbMax, PCRTUUID pUuid, PCFGMNODE pCfg, uint16_t cCpus, uint16_t *pcbDmiTables, uint16_t *pcNumDmiTables);
    31 void FwCommonPlantSmbiosAndDmiHdrs(PPDMDEVINS pDevIns, uint16_t cbDmiTables, uint16_t cNumDmiTables);
     31void FwCommonPlantSmbiosAndDmiHdrs(PPDMDEVINS pDevIns, uint8_t *pHdr, uint16_t cbDmiTables, uint16_t cNumDmiTables);
    3232
    3333/* Plant MPS table */
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