render / rpms / edk2

Forked from rpms/edk2 3 months ago
Clone

Blame SOURCES/edk2-OvmfPkg-raise-the-PCIEXBAR-base-to-2816-MB-on-Q35.patch

fcd20d
From d362291ada9ee22316e3c069dc788c4c801b0796 Mon Sep 17 00:00:00 2001
fcd20d
From: Laszlo Ersek <lersek@redhat.com>
fcd20d
Date: Tue, 4 Jun 2019 11:06:44 +0200
fcd20d
Subject: [PATCH 2/3] OvmfPkg: raise the PCIEXBAR base to 2816 MB on Q35
fcd20d
MIME-Version: 1.0
fcd20d
Content-Type: text/plain; charset=UTF-8
fcd20d
Content-Transfer-Encoding: 8bit
fcd20d
fcd20d
Message-id: <20190604090645.2847-3-lersek@redhat.com>
fcd20d
Patchwork-id: 88481
fcd20d
O-Subject:  [RHEL-8.1.0 edk2 PATCH v2 2/3] OvmfPkg: raise the PCIEXBAR base to
fcd20d
	2816 MB on Q35
fcd20d
Bugzilla: 1666941
fcd20d
Acked-by: Philippe Mathieu-Daudé <philmd@redhat.com>
fcd20d
Acked-by: Vitaly Kuznetsov <vkuznets@redhat.com>
fcd20d
fcd20d
(This is a replacement for commit 75136b29541b, "OvmfPkg/PlatformPei:
fcd20d
reorder the 32-bit PCI window vs. the PCIEXBAR on q35", 2019-05-16).
fcd20d
fcd20d
Commit 7b8fe63561b4 ("OvmfPkg: PlatformPei: enable PCIEXBAR (aka MMCONFIG
fcd20d
/ ECAM) on Q35", 2016-03-10) claimed that,
fcd20d
fcd20d
  On Q35 machine types that QEMU intends to support in the long term, QEMU
fcd20d
  never lets the RAM below 4 GB exceed 2 GB.
fcd20d
fcd20d
Alas, this statement came from a misunderstanding that occurred while we
fcd20d
worked out the interface contract. In fact QEMU does allow the 32-bit RAM
fcd20d
extend up to 0xB000_0000 (exclusive), in case the RAM size falls in the
fcd20d
range (0x8000_0000, 0xB000_0000) (i.e., the RAM size is greater than
fcd20d
2048MB and smaller than 2816MB).
fcd20d
fcd20d
In turn, such a RAM size (justifiedly) triggers
fcd20d
fcd20d
  ASSERT (TopOfLowRam <= PciExBarBase);
fcd20d
fcd20d
in MemMapInitialization(), because we placed the 256MB PCIEXBAR at
fcd20d
0x8000_0000 (2GB) exactly, relying on the interface contract. (And, the
fcd20d
32-bit PCI window would follow the PCIEXBAR, covering the [0x9000_0000,
fcd20d
0xFC00_0000) range.)
fcd20d
fcd20d
In order to fix this, place the PCIEXBAR at 2816MB (0xB000_0000), and
fcd20d
start the 32-bit PCI window at 3 GB (0xC000_0000). This shrinks the 32-bit
fcd20d
PCI window to
fcd20d
fcd20d
  0xFC00_0000 - 0xC000_0000 = 0x3C00_0000 = 960 MB.
fcd20d
fcd20d
Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
fcd20d
Cc: Gerd Hoffmann <kraxel@redhat.com>
fcd20d
Cc: Jordan Justen <jordan.l.justen@intel.com>
fcd20d
Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=1859
fcd20d
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
fcd20d
Reviewed-by: Philippe Mathieu-Daude <philmd@redhat.com>
fcd20d
Acked-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
fcd20d
(cherry picked from commit b07de0974b65a6a393c2d477427d1d6c7acce002)
fcd20d
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
fcd20d
---
fcd20d
 OvmfPkg/OvmfPkgIa32.dsc    | 4 ++--
fcd20d
 OvmfPkg/OvmfPkgIa32X64.dsc | 4 ++--
fcd20d
 OvmfPkg/OvmfPkgX64.dsc     | 4 ++--
fcd20d
 3 files changed, 6 insertions(+), 6 deletions(-)
fcd20d
fcd20d
diff --git a/OvmfPkg/OvmfPkgIa32.dsc b/OvmfPkg/OvmfPkgIa32.dsc
fcd20d
index bbf5e38..cf5f2ea 100644
fcd20d
--- a/OvmfPkg/OvmfPkgIa32.dsc
fcd20d
+++ b/OvmfPkg/OvmfPkgIa32.dsc
fcd20d
@@ -497,8 +497,8 @@
fcd20d
   # the PCIEXBAR register.
fcd20d
   #
fcd20d
   # On Q35 machine types that QEMU intends to support in the long term, QEMU
fcd20d
-  # never lets the RAM below 4 GB exceed 2 GB.
fcd20d
-  gEfiMdePkgTokenSpaceGuid.PcdPciExpressBaseAddress|0x80000000
fcd20d
+  # never lets the RAM below 4 GB exceed 2816 MB.
fcd20d
+  gEfiMdePkgTokenSpaceGuid.PcdPciExpressBaseAddress|0xB0000000
fcd20d
 
fcd20d
 !ifdef $(SOURCE_DEBUG_ENABLE)
fcd20d
   gEfiSourceLevelDebugPkgTokenSpaceGuid.PcdDebugLoadImageMethod|0x2
fcd20d
diff --git a/OvmfPkg/OvmfPkgIa32X64.dsc b/OvmfPkg/OvmfPkgIa32X64.dsc
fcd20d
index 3ec1b91..5a24065 100644
fcd20d
--- a/OvmfPkg/OvmfPkgIa32X64.dsc
fcd20d
+++ b/OvmfPkg/OvmfPkgIa32X64.dsc
fcd20d
@@ -502,8 +502,8 @@
fcd20d
   # the PCIEXBAR register.
fcd20d
   #
fcd20d
   # On Q35 machine types that QEMU intends to support in the long term, QEMU
fcd20d
-  # never lets the RAM below 4 GB exceed 2 GB.
fcd20d
-  gEfiMdePkgTokenSpaceGuid.PcdPciExpressBaseAddress|0x80000000
fcd20d
+  # never lets the RAM below 4 GB exceed 2816 MB.
fcd20d
+  gEfiMdePkgTokenSpaceGuid.PcdPciExpressBaseAddress|0xB0000000
fcd20d
 
fcd20d
 !ifdef $(SOURCE_DEBUG_ENABLE)
fcd20d
   gEfiSourceLevelDebugPkgTokenSpaceGuid.PcdDebugLoadImageMethod|0x2
fcd20d
diff --git a/OvmfPkg/OvmfPkgX64.dsc b/OvmfPkg/OvmfPkgX64.dsc
fcd20d
index ea54b4b..6ab50c9 100644
fcd20d
--- a/OvmfPkg/OvmfPkgX64.dsc
fcd20d
+++ b/OvmfPkg/OvmfPkgX64.dsc
fcd20d
@@ -502,8 +502,8 @@
fcd20d
   # the PCIEXBAR register.
fcd20d
   #
fcd20d
   # On Q35 machine types that QEMU intends to support in the long term, QEMU
fcd20d
-  # never lets the RAM below 4 GB exceed 2 GB.
fcd20d
-  gEfiMdePkgTokenSpaceGuid.PcdPciExpressBaseAddress|0x80000000
fcd20d
+  # never lets the RAM below 4 GB exceed 2816 MB.
fcd20d
+  gEfiMdePkgTokenSpaceGuid.PcdPciExpressBaseAddress|0xB0000000
fcd20d
 
fcd20d
 !ifdef $(SOURCE_DEBUG_ENABLE)
fcd20d
   gEfiSourceLevelDebugPkgTokenSpaceGuid.PcdDebugLoadImageMethod|0x2
fcd20d
-- 
fcd20d
1.8.3.1
fcd20d