代码拉取完成,页面将自动刷新
同步操作将从 ridedolphin/grub2 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
From 53b5629c9402e2d504866b6934303a8f8c2a5641 Mon Sep 17 00:00:00 2001
From: Qiumiao Zhang <zhangqiumiao1@huawei.com>
Date: Wed, 10 May 2023 19:11:17 +0800
Subject: [PATCH] Revert "EFI: allocate kernel in EFI_RUNTIME_SERVICES_CODE
instead of EFI_LOADER_DATA."
Allocates the kernel code as EFI_RUNTIME_SERVICES_CODE will cause the allocated
memory to be marked as "reserved" by BIOS, which will result in this memory being
always unavailable to the kernel.
Let's fix it by reverting backport-EFI-allocate-kernel-in-EFI_RUNTIME_SERVICES_CODE-ins.patch.
Signed-off-by: Qiumiao Zhang <zhangqiumiao1@huawei.com>
---
grub-core/loader/i386/efi/linux.c | 19 ++++++-------------
1 file changed, 6 insertions(+), 13 deletions(-)
diff --git a/grub-core/loader/i386/efi/linux.c b/grub-core/loader/i386/efi/linux.c
index 92b2fb5..9e5c11a 100644
--- a/grub-core/loader/i386/efi/linux.c
+++ b/grub-core/loader/i386/efi/linux.c
@@ -86,9 +86,7 @@ kernel_free(void *addr, grub_efi_uintn_t size)
}
static void *
-kernel_alloc(grub_efi_uintn_t size,
- grub_efi_memory_type_t memtype,
- const char * const errmsg)
+kernel_alloc(grub_efi_uintn_t size, const char * const errmsg)
{
void *addr = 0;
unsigned int i;
@@ -114,7 +112,7 @@ kernel_alloc(grub_efi_uintn_t size,
prev_max = max;
addr = grub_efi_allocate_pages_real (max, pages,
max_addresses[i].alloc_type,
- memtype);
+ GRUB_EFI_LOADER_DATA);
if (addr)
grub_dprintf ("linux", "Allocated at %p\n", addr);
}
@@ -244,8 +242,7 @@ grub_cmd_initrd (grub_command_t cmd, int argc, char *argv[])
}
}
- initrd_mem = kernel_alloc(size, GRUB_EFI_RUNTIME_SERVICES_DATA,
- N_("can't allocate initrd"));
+ initrd_mem = kernel_alloc(size, N_("can't allocate initrd"));
if (initrd_mem == NULL)
goto fail;
grub_dprintf ("linux", "initrd_mem = %p\n", initrd_mem);
@@ -396,8 +393,7 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)),
}
#endif
- params = kernel_alloc (sizeof(*params), GRUB_EFI_RUNTIME_SERVICES_DATA,
- "cannot allocate kernel parameters");
+ params = kernel_alloc (sizeof(*params), "cannot allocate kernel parameters");
if (!params)
goto fail;
grub_dprintf ("linux", "params = %p\n", params);
@@ -419,9 +415,7 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)),
grub_dprintf ("linux", "new lh is at %p\n", lh);
grub_dprintf ("linux", "setting up cmdline\n");
- cmdline = kernel_alloc (lh->cmdline_size + 1,
- GRUB_EFI_RUNTIME_SERVICES_DATA,
- N_("can't allocate cmdline"));
+ cmdline = kernel_alloc (lh->cmdline_size + 1, N_("can't allocate cmdline"));
if (!cmdline)
goto fail;
grub_dprintf ("linux", "cmdline = %p\n", cmdline);
@@ -467,8 +461,7 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)),
max_addresses[1].addr = GRUB_EFI_MAX_ALLOCATION_ADDRESS;
max_addresses[2].addr = GRUB_EFI_MAX_ALLOCATION_ADDRESS;
kernel_size = lh->init_size;
- kernel_mem = kernel_alloc (kernel_size, GRUB_EFI_RUNTIME_SERVICES_CODE,
- N_("can't allocate kernel"));
+ kernel_mem = kernel_alloc (kernel_size, N_("can't allocate kernel"));
restore_addresses();
if (!kernel_mem)
goto fail;
--
2.19.1
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。