]> git.proxmox.com Git - pve-edk2-firmware.git/commitdiff
add patch to work around older guest kernel bug
authorFiona Ebner <f.ebner@proxmox.com>
Mon, 5 Jun 2023 07:43:50 +0000 (09:43 +0200)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Tue, 6 Jun 2023 14:05:21 +0000 (16:05 +0200)
by limiting the phys-bits to 46 instead of 47. On Ubuntu 18.04 with
kernel 4.15, using 47 leads to a strange issue where initialization of
VirtIO devices would fail.

Reported in the community forum:
https://forum.proxmox.com/threads/127410/

Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
debian/patches/0001-OvmfPkg-PlatformInitLib-limit-phys-bits-to-46.patch [new file with mode: 0644]
debian/patches/series

diff --git a/debian/patches/0001-OvmfPkg-PlatformInitLib-limit-phys-bits-to-46.patch b/debian/patches/0001-OvmfPkg-PlatformInitLib-limit-phys-bits-to-46.patch
new file mode 100644 (file)
index 0000000..93f46ad
--- /dev/null
@@ -0,0 +1,46 @@
+From 89a12f2a42b989e7925b4a71e503209971eaa271 Mon Sep 17 00:00:00 2001
+From: Gerd Hoffmann <kraxel@redhat.com>
+Date: Thu, 1 Jun 2023 09:57:31 +0200
+Subject: [PATCH] OvmfPkg/PlatformInitLib: limit phys-bits to 46.
+
+Older linux kernels have problems with phys-bits larger than 46,
+ubuntu 18.04 (kernel 4.15) has been reported to be affected.
+
+Reduce phys-bits limit from 47 to 46.
+
+Reported-by: Fiona Ebner <f.ebner@proxmox.com>
+Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
+---
+ OvmfPkg/Library/PlatformInitLib/MemDetect.c | 9 ++++++---
+ 1 file changed, 6 insertions(+), 3 deletions(-)
+
+diff --git a/OvmfPkg/Library/PlatformInitLib/MemDetect.c b/OvmfPkg/Library/PlatformInitLib/MemDetect.c
+index 38cece9173..4d0522ce22 100644
+--- a/OvmfPkg/Library/PlatformInitLib/MemDetect.c
++++ b/OvmfPkg/Library/PlatformInitLib/MemDetect.c
+@@ -657,16 +657,19 @@ PlatformAddressWidthFromCpuid (
+     ));
+   if (Valid) {
+-    if (PhysBits > 47) {
++    if (PhysBits > 46) {
+       /*
+        * Avoid 5-level paging altogether for now, which limits
+        * PhysBits to 48.  Also avoid using address bit 48, due to sign
+        * extension we can't identity-map these addresses (and lots of
+        * places in edk2 assume we have everything identity-mapped).
+        * So the actual limit is 47.
++       *
++       * Also some older linux kernels apparently have problems handling
++       * phys-bits > 46 correctly, so use that as limit.
+        */
+-      DEBUG ((DEBUG_INFO, "%a: limit PhysBits to 47 (avoid 5-level paging)\n", __func__));
+-      PhysBits = 47;
++      DEBUG ((DEBUG_INFO, "%a: limit PhysBits to 46 (avoid 5-level paging)\n", __func__));
++      PhysBits = 46;
+     }
+     if (!Page1GSupport && (PhysBits > 40)) {
+-- 
+2.39.2
+
index f1ec614a7f39544c049569fa006318f6211a9bcf..a9ee2be187afcce8c4a65800581de81dbb87a614 100644 (file)
@@ -2,3 +2,4 @@ no-stack-protector-all-archs.diff
 brotlicompress-disable.diff
 x64-baseline-abi.patch
 Revert-ArmVirtPkg-make-EFI_LOADER_DATA-non-executabl.patch
+0001-OvmfPkg-PlatformInitLib-limit-phys-bits-to-46.patch