VirtualBox

Changeset 77796 in vbox for trunk/src/VBox


Ignore:
Timestamp:
Mar 19, 2019 4:52:25 PM (6 years ago)
Author:
vboxsync
Message:

EFI: Tweaked memory map for more than 2G RAM.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/EFI/FirmwareNew/OvmfPkg/PlatformPei/Platform.c

    r77795 r77796  
    266266    TopOfLowRam = GetSystemMemorySizeBelow4gb ();
    267267    PciExBarBase = 0;
     268#ifndef VBOX
    268269    if (mHostBridgeDevId == INTEL_Q35_MCH_DEVICE_ID) {
    269270      //
     
    299300    ASSERT_RETURN_ERROR (PcdStatus);
    300301
    301 #ifdef VBOX
     302    AddIoMemoryRangeHob (TopOfLowRam < BASE_2GB ?
     303                         BASE_2GB : TopOfLowRam, 0xFC000000);
     304#else
    302305    GetVmVariable(EFI_INFO_INDEX_MCFG_BASE, (CHAR8 *)&McfgBase, sizeof(McfgBase));
    303306    GetVmVariable(EFI_INFO_INDEX_MCFG_SIZE, (CHAR8 *)&McfgSize, sizeof(McfgSize));
     
    309312      AddIoMemoryRangeHob (TopOfLowRam, McfgBase);
    310313    AddIoMemoryRangeHob (McfgBase + McfgSize, 0xFC000000);
     314
    311315    PcdSet64S (PcdPciExpressBaseAddress, McfgBase);
    312 #else
    313     AddIoMemoryRangeHob (TopOfLowRam < BASE_2GB ?
    314                          BASE_2GB : TopOfLowRam, 0xFC000000);
    315 #endif
     316
     317    ASSERT (McfgBase == (UINT32)McfgBase);
     318    ASSERT (McfgBase + McfgSize < 0xFC000000);
     319
     320    PciBase = (UINT32)(McfgBase + McfgSize);
     321    PciSize = 0xFC000000 - PciBase;
     322    PcdStatus = PcdSet64S (PcdPciMmio32Base, PciBase);
     323    ASSERT_RETURN_ERROR (PcdStatus);
     324    PcdStatus = PcdSet64S (PcdPciMmio32Size, PciSize);
     325    ASSERT_RETURN_ERROR (PcdStatus);
     326#endif
     327
    316328    AddIoMemoryBaseSizeHob (0xFEC00000, SIZE_4KB);
    317329    AddIoMemoryBaseSizeHob (0xFED00000, SIZE_1KB);
     330#ifndef VBOX
    318331    if (mHostBridgeDevId == INTEL_Q35_MCH_DEVICE_ID) {
    319332      AddIoMemoryBaseSizeHob (ICH9_ROOT_COMPLEX_BASE, SIZE_16KB);
     
    343356        EfiReservedMemoryType);
    344357    }
     358#endif
    345359    AddIoMemoryBaseSizeHob (PcdGet32(PcdCpuLocalApicBaseAddress), SIZE_1MB);
    346360
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