Commit 6087cfe0 authored by Ma Wupeng's avatar Ma Wupeng Committed by Wupeng Ma
Browse files

mm: disable kernelcore=mirror when no mirror memory

maillist inclusion
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/I7QV2C
CVE: NA

Reference: https://lkml.kernel.org/r/20230802072328.2107981-1-mawupeng1@huawei.com

--------------------------------

For system with kernelcore=mirror enabled while no mirrored memory is
reported by efi.  This could lead to kernel OOM during startup since all
memory beside zone DMA are in the movable zone and this prevents the
kernel to use it.

Zone DMA/DMA32 initialization is independent of mirrored memory and their
max pfn is set in zone_sizes_init().  Since kernel can fallback to zone
DMA/DMA32 if there is no memory in zone Normal, these zones are seen as
mirrored memory no mather their memory attributes are.

To solve this problem, disable kernelcore=mirror when there is no real
mirrored memory exists.

Link: https://lkml.kernel.org/r/20230802072328.2107981-1-mawupeng1@huawei.com


Signed-off-by: default avatarMa Wupeng <mawupeng1@huawei.com>
Suggested-by: default avatarKefeng Wang <wangkefeng.wang@huawei.com>
Suggested-by: default avatarMike Rapoport <rppt@kernel.org>
Reviewed-by: default avatarMike Rapoport (IBM) <rppt@kernel.org>
Reviewed-by: default avatarKefeng Wang <wangkefeng.wang@huawei.com>
Cc: Levi Yun <ppbuk5246@gmail.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarMa Wupeng <mawupeng1@huawei.com>
parent a1c988d0
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment