From: Ma Wupeng mawupeng1@huawei.com
hulk inclusion category: cleanup bugzilla: https://gitee.com/openeuler/kernel/issues/I6WKXZ CVE: NA
--------------------------------
If system have no mirrored memory or use crashkernel.high while kernelcore=mirror is enabled in cmdline, during crashkernel, there will be limited mirrored memory and this usually lead to OOM.
To solve this problem, disable mirror feature during crashkernel.
Signed-off-by: Ma Wupeng mawupeng1@huawei.com Reviewed-by: Kefeng Wang wangkefeng.wang@huawei.com --- drivers/firmware/efi/efi.c | 6 ++++++ 1 file changed, 6 insertions(+)
diff --git a/drivers/firmware/efi/efi.c b/drivers/firmware/efi/efi.c index c406de00883a..97a0916d6502 100644 --- a/drivers/firmware/efi/efi.c +++ b/drivers/firmware/efi/efi.c @@ -31,6 +31,7 @@ #include <linux/ucs2_string.h> #include <linux/memblock.h> #include <linux/security.h> +#include <linux/crash_dump.h>
#include <asm/early_ioremap.h>
@@ -446,6 +447,11 @@ void __init efi_find_mirror(void) if (!mirrored_kernelcore) return;
+ if (is_kdump_kernel()) { + mirrored_kernelcore = false; + return; + } + for_each_efi_memory_desc(md) { unsigned long long start = md->phys_addr; unsigned long long size = md->num_pages << EFI_PAGE_SHIFT;