aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndy Lutomirski <luto@kernel.org>2023-03-02 14:19:14 -0800
committerAndy Lutomirski <luto@kernel.org>2023-03-06 12:22:59 -0800
commit6e8c8e08256361708e095293b75ccc319184afd0 (patch)
tree87dcbdf1e03d3b0ab2e09aef68ba30b19793b9b2
parent34b1261d2f0d1cb15a211bf890ad8542bfb35ac2 (diff)
downloadlinux-x86/fixes.tar.gz
x86/efi: Remove the real mode trampoline in boot services quirkx86/fixes
The only machine known to have required the quirk that allocated the real mode trampoline in boot services memory is my laptop, and my laptop is also able to boot with the real mode trampline below 64kB. The quirk bitrotted (the code involved no longer runs unconditionally), so just remove it. Good riddance. Signed-off-by: Andy Lutomirski <luto@kernel.org>
-rw-r--r--arch/x86/platform/efi/quirks.c22
-rw-r--r--arch/x86/realmode/init.c2
2 files changed, 1 insertions, 23 deletions
diff --git a/arch/x86/platform/efi/quirks.c b/arch/x86/platform/efi/quirks.c
index 526d023dfe51b2..45e3f9b1594531 100644
--- a/arch/x86/platform/efi/quirks.c
+++ b/arch/x86/platform/efi/quirks.c
@@ -16,7 +16,6 @@
#include <asm/efi.h>
#include <asm/uv/uv.h>
#include <asm/cpu_device_id.h>
-#include <asm/realmode.h>
#include <asm/reboot.h>
#define EFI_MIN_RESERVE 5120
@@ -410,7 +409,6 @@ void __init efi_free_boot_services(void)
for_each_efi_memory_desc(md) {
unsigned long long start = md->phys_addr;
unsigned long long size = md->num_pages << EFI_PAGE_SHIFT;
- size_t rm_size;
if (md->type != EFI_BOOT_SERVICES_CODE &&
md->type != EFI_BOOT_SERVICES_DATA) {
@@ -432,26 +430,6 @@ void __init efi_free_boot_services(void)
efi_unmap_pages(md);
/*
- * Nasty quirk: if all sub-1MB memory is used for boot
- * services, we can get here without having allocated the
- * real mode trampoline. It's too late to hand boot services
- * memory back to the memblock allocator, so instead
- * try to manually allocate the trampoline if needed.
- *
- * I've seen this on a Dell XPS 13 9350 with firmware
- * 1.4.4 with SGX enabled booting Linux via Fedora 24's
- * grub2-efi on a hard disk. (And no, I don't know why
- * this happened, but Linux should still try to boot rather
- * panicking early.)
- */
- rm_size = real_mode_size_needed();
- if (rm_size && (start + rm_size) < (1<<20) && size >= rm_size) {
- set_real_mode_mem(start);
- start += rm_size;
- size -= rm_size;
- }
-
- /*
* Don't free memory under 1M -- see comments in
* arch/x86/kernel/setup.c and the code that reserves the
* entire first megabyte.
diff --git a/arch/x86/realmode/init.c b/arch/x86/realmode/init.c
index 288c4315a4be36..2c45092c0a309e 100644
--- a/arch/x86/realmode/init.c
+++ b/arch/x86/realmode/init.c
@@ -61,7 +61,7 @@ void __init reserve_real_mode(void)
*/
mem = memblock_phys_alloc_range(size, PAGE_SIZE, 0, 1<<20);
if (!mem) {
- pr_info("No sub-1M memory is available for the trampoline\n");
+ pr_emerg("No sub-1M memory is available for the trampoline\n");
} else {
set_real_mode_mem(mem);
pr_info("real mode trampoline is 0x%lx bytes at 0x%lx\n",