代码拉取完成,页面将自动刷新
同步操作将从 src-openEuler/grub2 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
From 6d56530bd04534f038f775624e1c4942a8bf95de Mon Sep 17 00:00:00 2001
From: fengtao <fengtao40@huawei.com>
Date: Mon, 14 Feb 2022 16:17:15 +0800
Subject: [PATCH] double grub x86_64-efi mm pool
grub2 will construct mm pool by uefi memory function
for grub memory manger, grub_malloc, grub_free, etc.
but we have limit memory address under x86_64 platform in
commit:456eb8632e7(Try to pick better locations for kernel and initrd)
so, x86_64 can only address available ram under 4GB.
there comes a problem, when available memory under 4GB is not enough,
and initrd is large, like 200MB~300MB. we got out of memory when
verifiers use grub_malloc.
Finally, we descide to double grub mm pool when we init it. And what
the point is, we cannot init all of the available memory under 4GB.
you can read commit:5ff84fb244b
(x86-efi: Allow initrd+params+cmdline allocations above 4GB.)
---
grub-core/kern/efi/mm.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/grub-core/kern/efi/mm.c b/grub-core/kern/efi/mm.c
index f64f79e..50116a6 100644
--- a/grub-core/kern/efi/mm.c
+++ b/grub-core/kern/efi/mm.c
@@ -658,7 +658,11 @@ grub_efi_mm_init (void)
/* By default, request a quarter of the available memory. */
total_pages = get_total_pages (filtered_memory_map, desc_size,
filtered_memory_map_end);
+#if defined(__x86_64__)
+ required_pages = (total_pages >> 1);
+#else
required_pages = (total_pages >> 2);
+#endif
if (required_pages < BYTES_TO_PAGES (MIN_HEAP_SIZE))
required_pages = BYTES_TO_PAGES (MIN_HEAP_SIZE);
else if (required_pages > BYTES_TO_PAGES (MAX_HEAP_SIZE))
--
2.27.0
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。