From 6b9ba912c616c2bf949cc80697bf431c67722f9f Mon Sep 17 00:00:00 2001 From: mintsuki Date: Fri, 23 Sep 2022 01:00:44 +0200 Subject: [PATCH] Revert "linux/efi: Perform efi_memmap_size=0 workaround for 32 on 64 as well" This reverts commit b9f41799b42bc017c34ea2f49aabf4592f951c5a. --- common/protos/linux.c | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) diff --git a/common/protos/linux.c b/common/protos/linux.c index 0fb37232..5671a395 100644 --- a/common/protos/linux.c +++ b/common/protos/linux.c @@ -30,8 +30,6 @@ noreturn void linux_spinup(void *entry, void *boot_params); #define E820_MAX_ENTRIES_ZEROPAGE 128 #define EDDMAXNR 6 -#define XLF_KERNEL_64 (1 << 0) - struct setup_header { uint8_t setup_sects; uint16_t root_flags; @@ -593,18 +591,13 @@ set_textmode:; boot_params->efi_info.efi_memmap = (uint32_t)(uint64_t)(uintptr_t)efi_mmap; boot_params->efi_info.efi_memmap_hi = (uint32_t)((uint64_t)(uintptr_t)efi_mmap >> 32); #if defined (__x86_64__) - if ((setup_header->xloadflags & XLF_KERNEL_64) == 0) { + boot_params->efi_info.efi_memmap_size = efi_mmap_size; #elif defined (__i386__) - if ((setup_header->xloadflags & XLF_KERNEL_64) != 0) { + // A memmap size of 0 will cause Linux to force bail out of trying to use + // 32-bit EFI runtime services without ignoring other EFI info. + // XXX: Figure out why 64-bit Linux hangs if trying to use 32-bit boot services. + boot_params->efi_info.efi_memmap_size = 0; #endif - // A memmap size of 0 will cause Linux to force bail out of trying to use - // mismatched bitness EFI runtime services without ignoring other EFI info. - // XXX: Figure out why 64-bit Linux hangs if trying to use 32-bit boot services, - // and vice versa. - boot_params->efi_info.efi_memmap_size = 0; - } else { - boot_params->efi_info.efi_memmap_size = efi_mmap_size; - } boot_params->efi_info.efi_memdesc_size = efi_desc_size; boot_params->efi_info.efi_memdesc_version = efi_desc_ver; #endif