X-Git-Url: https://git.proxmox.com/?a=blobdiff_plain;f=OvmfPkg%2FPlatformPei%2FPlatform.c;h=3ba2459872d93d48ca9258fb12c1587ad0751d20;hb=b0663641c977f97bef785c86978603c3a31a3d1c;hp=c064b4ed9b8fb5e85ef3c9805a4dc4bcb40e1544;hpb=39b9a5ffe6618b7870be2a54fe7725000249c33a;p=mirror_edk2.git diff --git a/OvmfPkg/PlatformPei/Platform.c b/OvmfPkg/PlatformPei/Platform.c index c064b4ed9b..3ba2459872 100644 --- a/OvmfPkg/PlatformPei/Platform.c +++ b/OvmfPkg/PlatformPei/Platform.c @@ -174,23 +174,25 @@ MemMapInitialization ( AddIoMemoryRangeHob (0x0A0000, BASE_1MB); if (!mXen) { + UINT32 TopOfLowRam; UINT64 PciExBarBase; UINT32 PciBase; UINT32 PciSize; + TopOfLowRam = GetSystemMemorySizeBelow4gb (); PciExBarBase = 0; - PciBase = (mQemuUc32Base < BASE_2GB) ? BASE_2GB : mQemuUc32Base; if (mHostBridgeDevId == INTEL_Q35_MCH_DEVICE_ID) { // - // The 32-bit PCI host aperture is expected to fall between the top of - // low RAM and the base of the MMCONFIG area. + // The MMCONFIG area is expected to fall between the top of low RAM and + // the base of the 32-bit PCI host aperture. // PciExBarBase = FixedPcdGet64 (PcdPciExpressBaseAddress); - ASSERT (PciBase < PciExBarBase); + ASSERT (TopOfLowRam <= PciExBarBase); ASSERT (PciExBarBase <= MAX_UINT32 - SIZE_256MB); - PciSize = (UINT32)(PciExBarBase - PciBase); + PciBase = (UINT32)(PciExBarBase + SIZE_256MB); } else { - PciSize = 0xFC000000 - PciBase; + ASSERT (TopOfLowRam <= mQemuUc32Base); + PciBase = mQemuUc32Base; } // @@ -206,6 +208,7 @@ MemMapInitialization ( // 0xFED20000 gap 896 KB // 0xFEE00000 LAPIC 1 MB // + PciSize = 0xFC000000 - PciBase; AddIoMemoryBaseSizeHob (PciBase, PciSize); PcdStatus = PcdSet64S (PcdPciMmio32Base, PciBase); ASSERT_RETURN_ERROR (PcdStatus); @@ -648,6 +651,8 @@ InitializePlatform ( PublishPeiMemory (); + QemuUc32BaseInitialization (); + InitializeRamRegions (); if (mXen) {