[SRU][P][PATCH 1/1] UBUNTU: SAUCE: hack: efi/libstub: enable t14s boot failure hack only on arm64
Juerg Haefliger
juerg.haefliger at canonical.com
Thu May 8 07:19:24 UTC 2025
BugLink: https://bugs.launchpad.net/bugs/2105402
The EFI hack for the Lenovo ThinkPad T14s is causing issues for old x86
Macs. It's only required for (some) ARM laptops so gate it by CONFIG_ARM64.
Fixes: 524da2cfa3da ("UBUNTU: SAUCE: hack: efi/libstub: mitigate t14s exit_boot_services() failure")
Signed-off-by: Juerg Haefliger <juerg.haefliger at canonical.com>
---
drivers/firmware/efi/libstub/efi-stub-helper.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/drivers/firmware/efi/libstub/efi-stub-helper.c b/drivers/firmware/efi/libstub/efi-stub-helper.c
index c30dd2016826..ce5b3b26522c 100644
--- a/drivers/firmware/efi/libstub/efi-stub-helper.c
+++ b/drivers/firmware/efi/libstub/efi-stub-helper.c
@@ -407,12 +407,14 @@ char *efi_convert_cmdline(efi_loaded_image_t *image)
return (char *)cmdline_addr;
}
+#ifdef CONFIG_ARM64
#define EFI_EVENT_GROUP_BEFORE_EXIT_BOOT_SERVICES \
EFI_GUID(0x8be0e274, 0x3970, 0x4b44, 0x80, 0xc5, 0x1a, 0xb9, 0x50, 0x2f, 0x3b, 0xfc)
static void efi_before_ebs_notify(efi_event_t event, void *context)
{
}
+#endif
/**
* efi_exit_boot_services() - Exit boot services
@@ -434,12 +436,15 @@ efi_status_t efi_exit_boot_services(void *handle, void *priv,
{
struct efi_boot_memmap *map;
efi_status_t status;
+#ifdef CONFIG_ARM64
efi_guid_t guid = EFI_EVENT_GROUP_BEFORE_EXIT_BOOT_SERVICES;
efi_event_t event;
+#endif
if (efi_disable_pci_dma)
efi_pci_disable_bridge_busmaster();
+#ifdef CONFIG_ARM64
status = efi_bs_call(create_event_ex, EFI_EVT_NOTIFY_SIGNAL,
EFI_TPL_CALLBACK, efi_before_ebs_notify, NULL,
&guid, &event);
@@ -454,6 +459,7 @@ efi_status_t efi_exit_boot_services(void *handle, void *priv,
} else {
efi_err("%s - create event ex failed: %02lx\n", __func__, status);
}
+#endif
status = efi_get_memory_map(&map, true);
if (status != EFI_SUCCESS)
--
2.43.0
More information about the kernel-team
mailing list