summaryrefslogtreecommitdiffstats
path: root/OvmfPkg/PlatformPei/Platform.h
diff options
context:
space:
mode:
authorLaszlo Ersek <lersek@redhat.com>2019-05-29 14:49:55 +0200
committerLaszlo Ersek <lersek@redhat.com>2019-06-03 19:54:34 +0200
commit49edde15230a5bfd6746225eb95535eaa2ec1ba4 (patch)
tree9a5f95d60d2f48bd8572fb0fbbecfa814738a2ab /OvmfPkg/PlatformPei/Platform.h
parentb07de0974b65a6a393c2d477427d1d6c7acce002 (diff)
downloadedk2-49edde15230a5bfd6746225eb95535eaa2ec1ba4.tar.gz
edk2-49edde15230a5bfd6746225eb95535eaa2ec1ba4.tar.bz2
edk2-49edde15230a5bfd6746225eb95535eaa2ec1ba4.zip
OvmfPkg/PlatformPei: set 32-bit UC area at PciBase / PciExBarBase (pc/q35)
(This is a replacement for commit 39b9a5ffe661 ("OvmfPkg/PlatformPei: fix MTRR for low-RAM sizes that have many bits clear", 2019-05-16).) Reintroduce the same logic as seen in commit 39b9a5ffe661 for the pc (i440fx) board type. For q35, the same approach doesn't work any longer, given that (a) we'd like to keep the PCIEXBAR in the platform DSC a fixed-at-build PCD, and (b) QEMU expects the PCIEXBAR to reside at a lower address than the 32-bit PCI MMIO aperture. Therefore, introduce a helper function for determining the 32-bit "uncacheable" (MMIO) area base address: - On q35, this function behaves statically. Furthermore, the MTRR setup exploits that the range [0xB000_0000, 0xFFFF_FFFF] can be marked UC with just two variable MTRRs (one at 0xB000_0000 (size 256MB), another at 0xC000_0000 (size 1GB)). - On pc (i440fx), the function behaves dynamically, implementing the same logic as commit 39b9a5ffe661 did. The PciBase value is adjusted to the value calculated, similarly to commit 39b9a5ffe661. A further simplification is that we show that the UC32 area size truncation to a whole power of two automatically guarantees a >=2GB base address. Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org> Cc: Gerd Hoffmann <kraxel@redhat.com> Cc: Jordan Justen <jordan.l.justen@intel.com> Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=1859 Signed-off-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Philippe Mathieu-Daude <philmd@redhat.com> Acked-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Diffstat (limited to 'OvmfPkg/PlatformPei/Platform.h')
-rw-r--r--OvmfPkg/PlatformPei/Platform.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/OvmfPkg/PlatformPei/Platform.h b/OvmfPkg/PlatformPei/Platform.h
index 81af8b7148..2f3cebcd3a 100644
--- a/OvmfPkg/PlatformPei/Platform.h
+++ b/OvmfPkg/PlatformPei/Platform.h
@@ -63,6 +63,11 @@ GetSystemMemorySizeBelow4gb (
);
VOID
+QemuUc32BaseInitialization (
+ VOID
+ );
+
+VOID
InitializeRamRegions (
VOID
);
@@ -114,4 +119,6 @@ extern UINT32 mMaxCpuCount;
extern UINT16 mHostBridgeDevId;
+extern UINT32 mQemuUc32Base;
+
#endif // _PLATFORM_PEI_H_INCLUDED_