The patch titled Subject: mm/mm_init: ignore kernelcore=mirror boot option when no mirror memory presents. has been added to the -mm mm-unstable branch. Its filename is mm-mm_init-ignore-kernelcore=mirror-boot-option-when-no-mirror-memory-presents.patch This patch will shortly appear at https://git.kernel.org/pub/scm/linux/kernel/git/akpm/25-new.git/tree/patches/mm-mm_init-ignore-kernelcore=mirror-boot-option-when-no-mirror-memory-presents.patch This patch will later appear in the mm-unstable branch at git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm Before you just go and hit "reply", please: a) Consider who else should be cc'ed b) Prefer to cc a suitable mailing list as well c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's *** Remember to use Documentation/process/submit-checklist.rst when testing your code *** The -mm tree is included into linux-next via the mm-everything branch at git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm and is updated there every 2-3 working days ------------------------------------------------------ From: Levi Yun <ppbuk5246@xxxxxxxxx> Subject: mm/mm_init: ignore kernelcore=mirror boot option when no mirror memory presents. Date: Wed, 2 Aug 2023 19:36:14 +0100 In a machine where no mirror memory is set, All memory region in ZONE_NORMAL is used as ZONE_MOVABLE when kernelcore=mirror boot option is used. So, ZONE_NORMAL couldn't be populated properly because all of ZONE_NORMAL pages is absent. To avoid this abnormal situation, ignore disable kernelcore=mirror option when no mirror memory is found. Link: https://lkml.kernel.org/r/20230802183614.15520-1-ppbuk5246@xxxxxxxxx Signed-off-by: Levi Yun <ppbuk5246@xxxxxxxxx> Cc: Mike Rapoport (IBM) <rppt@xxxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- mm/mm_init.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) --- a/mm/mm_init.c~mm-mm_init-ignore-kernelcore=mirror-boot-option-when-no-mirror-memory-presents +++ a/mm/mm_init.c @@ -376,10 +376,13 @@ static void __init find_zone_movable_pfn */ if (mirrored_kernelcore) { bool mem_below_4gb_not_mirrored = false; + bool no_mirror_mem = true; for_each_mem_region(r) { - if (memblock_is_mirror(r)) + if (memblock_is_mirror(r)) { + no_mirror_mem = false; continue; + } nid = memblock_get_region_node(r); @@ -398,6 +401,12 @@ static void __init find_zone_movable_pfn if (mem_below_4gb_not_mirrored) pr_warn("This configuration results in unmirrored kernel memory.\n"); + if (no_mirror_mem) { + pr_warn("There is no mirrored memory. Ignore kernelcore=mirror.\n"); + mirrored_kernelcore = false; + memset(zone_movable_pfn, 0x00, sizeof(zone_movable_pfn)); + } + goto out2; } _ Patches currently in -mm which might be from ppbuk5246@xxxxxxxxx are damon-use-pmdp_get-instead-of-drectly-dereferencing-pmd.patch mm-mm_init-ignore-kernelcore=mirror-boot-option-when-no-mirror-memory-presents.patch