Commit 2bbd51a7 authored by Ma Wupeng's avatar Ma Wupeng Committed by Wupeng Ma
Browse files

efi: Disable mirror feature during crashkernel

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: default avatarMa Wupeng <mawupeng1@huawei.com>
Reviewed-by: default avatarKefeng Wang <wangkefeng.wang@huawei.com>
parent a687d7a0
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -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;