Skip to contentSkip to conversation

crash_core-fix-the-check-for-whether-crashkernel-is-from-high-memory.patch removed from -mm tree

merged mm-hotfixes-stable Andrew Morton 1 participant 1 message Dec 13, 2023

lore
Share & tools
lore

Andrew Morton

author tree notice Applied
#0 lore raw

The quilt patch titled
Subject: crash_core: fix the check for whether crashkernel is from high memory
has been removed from the -mm tree. Its filename was
crash_core-fix-the-check-for-whether-crashkernel-is-from-high-memory.patch

This patch was dropped because it was merged into the mm-hotfixes-stable branch of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm

------------------------------------------------------
From: Yuntao Wang <[email protected]>
Subject: crash_core: fix the check for whether crashkernel is from high memory
Date: Sat, 9 Dec 2023 22:14:38 +0800

If crash_base is equal to CRASH_ADDR_LOW_MAX, it also indicates that the crashkernel memory is allocated from high memory. However, the current check only considers the case where crash_base is greater than CRASH_ADDR_LOW_MAX. Fix it.

The runtime effects is that crashkernel high memory is successfully reserved, whereas the crashkernel low memory is bypassed in this case, then kdump kernel bootup will fail because of no low memory under 4G.

This patch also includes some minor cleanups.

Fixes 0ab97169aa05 ("crash_core: add generic function to do reservation")
Cc Baoquan He <[email protected]>
Cc Dave Young <[email protected]>
Cc Vivek Goyal <[email protected]>
Cc Zhen Lei <[email protected]>
Cc "Eric W. Biederman" <[email protected]>

---

 kernel/crash_core.c |   10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
kernel/crash_core.c renamed from kernel/crash_core.c~crash_core-fix-the-check-for-whether-crashkernel-is-from-high-memory +5 -5
@@ -199,7 +199,7 @@ static __initdata char *suffix_tbl[] = {
  * It returns 0 on success and -EINVAL on failure.
  */
 static int __init parse_crashkernel_suffix(char *cmdline,
-					   unsigned long long	*crash_size,
+					   unsigned long long *crash_size,
 					   const char *suffix)
 {
 	char *cur = cmdline;
@@ -268,9 +268,9 @@ static int __init __parse_crashkernel(ch
 			     unsigned long long *crash_base,
 			     const char *suffix)
 {
-	char	*first_colon, *first_space;
-	char	*ck_cmdline;
-	char	*name = "crashkernel=";
+	char *first_colon, *first_space;
+	char *ck_cmdline;
+	char *name = "crashkernel=";
 
 	BUG_ON(!crash_size || !crash_base);
 	*crash_size = 0;
@@ -440,7 +440,7 @@ retry:
 		return;
 	}
 
-	if ((crash_base > CRASH_ADDR_LOW_MAX) &&
+	if ((crash_base >= CRASH_ADDR_LOW_MAX) &&
 	     crash_low_size && reserve_crashkernel_low(crash_low_size)) {
 		memblock_phys_free(crash_base, crash_size);
 		return;

_

Patches currently in -mm which might be from [email protected] are

kexec-use-align-macro-instead-of-open-coding-it.patch x86-kexec-simplify-the-logic-of-mem_region_callback.patch