public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
From: Dennis Gilmore <dennis@ausil.us>
To: git-commits@fedoraproject.org
Subject: [rpms/grub2] rawhide: Fix booting on 64GiB lenovo t14s
Date: Wed, 14 Oct 2026 16:09:01 GMT	[thread overview]
Message-ID: <179199414161.1.13959282674644014595.rpms-grub2-2d7b4f4679f1@fedoraproject.org> (raw)

            A new commit has been pushed.

            Repo   : rpms/grub2
            Branch : rawhide
            Commit : 2d7b4f4679f1be0c5ff4f6db687e523696b3ef49
            Author : Dennis Gilmore <dennis@ausil.us>
            Date   : 2026-10-13T15:02:22-05:00
            Stats  : +56/-2 in 3 file(s)
            URL    : https://src.fedoraproject.org/rpms/grub2/c/2d7b4f4679f1be0c5ff4f6db687e523696b3ef49?branch=rawhide

            Log:
            Fix booting on 64GiB lenovo t14s

Add patch to try try allocating in the lower 4GB first
Resolves: #2459477

Signed-off-by: Dennis Gilmore <dennis@ausil.us>

---
diff --git a/0454-kern-efi-mm-try-allocating-in-the-lower-4GB-first.patch b/0454-kern-efi-mm-try-allocating-in-the-lower-4GB-first.patch
new file mode 100644
index 0000000..83cd612
--- /dev/null
+++ b/0454-kern-efi-mm-try-allocating-in-the-lower-4GB-first.patch
@@ -0,0 +1,49 @@
+From 27c88ce2b99a6337f8312c4dd30519850fe5e5fd Mon Sep 17 00:00:00 2001
+From: Tobias Heider <tobias.heider@canonical.com>
+Date: Fri, 11 Apr 2025 12:34:52 +0200
+Subject: [PATCH] kern/efi/mm: try allocating in the lower 4GB first
+
+On arm64 we can't restrict memory usage below 0xffffffff as we do
+on x86 because there is no guarantee memory in that range exists
+at all (an example is Apple Silicon).
+Instead, try to allocate in the lower 4GB range first and fall
+back to the entire available address space if that did not work.
+
+This fixes a bug on Snapdragon X Elite devices such as the Lenovo
+Thinkpad T14s which crashes when accessing memory above 0xffffffff.
+
+Signed-off-by: Tobias Heider <tobias.heider@canonical.com>
+---
+ grub-core/kern/efi/mm.c | 16 +++++++++++++---
+ 1 file changed, 13 insertions(+), 3 deletions(-)
+
+diff --git a/grub-core/kern/efi/mm.c b/grub-core/kern/efi/mm.c
+index 22a936a6e..417fa3cb4 100644
+--- a/grub-core/kern/efi/mm.c
++++ b/grub-core/kern/efi/mm.c
+@@ -202,9 +202,19 @@ grub_efi_allocate_pages_real (grub_efi_physical_address_t address,
+ void *
+ grub_efi_allocate_any_pages (grub_efi_uintn_t pages)
+ {
+-  return grub_efi_allocate_pages_real (GRUB_EFI_MAX_USABLE_ADDRESS,
+-				       pages, GRUB_EFI_ALLOCATE_MAX_ADDRESS,
+-				       GRUB_EFI_LOADER_DATA);
++  void *ret;
++
++  ret = grub_efi_allocate_pages_real (0xffffffff,
++				      pages, GRUB_EFI_ALLOCATE_MAX_ADDRESS,
++				      GRUB_EFI_LOADER_DATA);
++  if (ret == NULL)
++    {
++      grub_errno = GRUB_ERR_NONE;
++      ret = grub_efi_allocate_pages_real (GRUB_EFI_MAX_USABLE_ADDRESS,
++					  pages, GRUB_EFI_ALLOCATE_MAX_ADDRESS,
++					  GRUB_EFI_LOADER_DATA);
++    }
++  return ret;
+ }
+ 
+ void *
+-- 
+2.56.0
+

diff --git a/grub.patches b/grub.patches
index e1bfc7a..e92115e 100644
--- a/grub.patches
+++ b/grub.patches
@@ -444,4 +444,5 @@ Patch0449: 0449-Revert-Use-medany-instead-of-large-model-for-RISCV.patch
 Patch0450: 0450-configure-Add-mno-relax-on-riscv.patch
 Patch0451: 0451-configure-Defer-check-for-mcmodel-large-until-PIC-PI.patch
 Patch0452: 0452-platform-Return-i386-pc-when-proc-device-tree-is-pre.patch
-Patch0453: 0453-term-serial-Reject-caller-supplied-port-addresses-un.patch
\ No newline at end of file
+Patch0453: 0453-term-serial-Reject-caller-supplied-port-addresses-un.patch
+Patch0454: 0454-kern-efi-mm-try-allocating-in-the-lower-4GB-first.patch

diff --git a/grub2.spec b/grub2.spec
index bdd2e50..404edaf 100644
--- a/grub2.spec
+++ b/grub2.spec
@@ -17,7 +17,7 @@
 Name:		grub2
 Epoch:		1
 Version:	2.12
-Release:	85%{?dist}
+Release:	86%{?dist}
 Summary:	Bootloader with support for Linux, Multiboot and more
 License:	GPL-3.0-or-later
 URL:		http://www.gnu.org/software/grub/
@@ -686,6 +686,10 @@ fi
 %endif
 
 %changelog
+* Tue Oct 13 2026 Dennis Gilmore <dennis@ausil.us> - 2.12-86
+- Add patch to try try allocating in the lower 4GB first
+- Resolves: #2459477
+
 * Fri Oct 02 2026 Leo Sandoval <lsandova@redhat.com> - 2.12-85
 - Remove grub-cc sub-package
 

                 reply	other threads:[~2026-10-14 16:09 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=179199414161.1.13959282674644014595.rpms-grub2-2d7b4f4679f1@fedoraproject.org \
    --to=dennis@ausil.us \
    --cc=git-commits@fedoraproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox