X1E: fails to boot on Lenovo T14s with 64gb RAM
Linux fails to boot on Lenovo ThinkPad T14s Gen6 (X1E) with 64GB RAM.
This can be worked around with GRUB patch & cutmem config as suggested at: https://github.com/jhovold/linux/wiki/T14s#uefi-firmware
I think this has been fixed in newer Qualcomm firmware but hasn't yet been released to the latest available Lenovo firmware (TODO: can you check my reasoning here please @stephan-gh)
Patch to workaround issue I carry in my personal tree:
From 37197f77236d5e2b20111a4910b4af78a2d6e79a Mon Sep 17 00:00:00 2001
From: Stephan Gerhold <stephan.gerhold@linaro.org>
Date: Thu, 6 Mar 2025 17:41:15 +0000
Subject: [PATCH] HACK: efi-stub: Exclude 40-bit memory
---
drivers/firmware/efi/libstub/efi-stub.c | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/drivers/firmware/efi/libstub/efi-stub.c b/drivers/firmware/efi/libstub/efi-stub.c
index 874f63b4a3830..355a9b2c08187 100644
--- a/drivers/firmware/efi/libstub/efi-stub.c
+++ b/drivers/firmware/efi/libstub/efi-stub.c
@@ -106,6 +106,17 @@ efi_status_t efi_handle_cmdline(efi_loaded_image_t *image, char **cmdline_ptr)
{
char *cmdline __free(efi_pool) = NULL;
efi_status_t status;
+ efi_physical_addr_t addr;
+ unsigned long pages;
+
+ addr = 0x0000008800000000;
+ pages = 0x800000000 / EFI_PAGE_SIZE;
+ status = efi_bs_call(allocate_pages, EFI_ALLOCATE_ADDRESS,
+ EFI_RESERVED_TYPE, pages, &addr);
+ if (status != EFI_SUCCESS) {
+ efi_err("failed to reserve upper 32 GiB (40-bit memory)\n");
+ return EFI_OUT_OF_RESOURCES;
+ }
/*
* Get the command line from EFI, using the LOADED_IMAGE
Edited by Christopher Obbard