]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
powerpc/crash: preserve user-specified memory limit
authorSourabh Jain <sourabhjain@linux.ibm.com>
Fri, 31 Jan 2025 11:38:28 +0000 (17:08 +0530)
committerAndrew Morton <akpm@linux-foundation.org>
Mon, 17 Mar 2025 05:30:48 +0000 (22:30 -0700)
Commit 59d58189f3d9 ("crash: fix crash memory reserve exceed system memory
bug") fails crashkernel parsing if the crash size is found to be higher
than system RAM, which makes the memory_limit adjustment code ineffective
due to an early exit from reserve_crashkernel().

Regardless lets not violate the user-specified memory limit by adjusting
it.  Remove this adjustment to ensure all reservations stay within the
limit.  Commit f94f5ac07983 ("powerpc/fadump: Don't update the
user-specified memory limit") did the same for fadump.

Link: https://lkml.kernel.org/r/20250131113830.925179-6-sourabhjain@linux.ibm.com
Signed-off-by: Sourabh Jain <sourabhjain@linux.ibm.com>
Reviewed-by: Mahesh Salgaonkar <mahesh@linux.ibm.com>
Acked-by: Hari Bathini <hbathini@linux.ibm.com>
Cc: Baoquan he <bhe@redhat.com>
Cc: Madhavan Srinivasan <maddy@linux.ibm.com>
Cc: Michael Ellerman <mpe@ellerman.id.au>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
arch/powerpc/kexec/core.c

index 58a930a47422b65e21c7e22f48d7d6fde0f2166c..f9be7bb5aa08529f393e049a320f37e7d01977a7 100644 (file)
@@ -128,14 +128,6 @@ void __init reserve_crashkernel(void)
                return;
        }
 
-       /* Crash kernel trumps memory limit */
-       if (memory_limit && memory_limit <= crashk_res.end) {
-               memory_limit = crashk_res.end + 1;
-               total_mem_sz = memory_limit;
-               printk("Adjusted memory limit for crashkernel, now 0x%llx\n",
-                      memory_limit);
-       }
-
        printk(KERN_INFO "Reserving %ldMB of memory at %ldMB "
                        "for crashkernel (System RAM: %ldMB)\n",
                        (unsigned long)(crash_size >> 20),