Skip to contentSkip to conversation

ppc64/kdump: Limit kdump base to 512MB

PATCH Superseded Hari Bathini 2 participants 3 messages Sep 9, 2022 – Sep 12, 2022 PowerPC

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ppc64/kdump: Limit kdump base to 512MB

Since commit e641eb03ab2b0 ("powerpc: Fix up the kdump base cap to 128M") memory for kdump kernel has been reserved at an offset of 128MB. This held up well for a long time before running into boot failure on LPARs having a lot of cores. Commit 7c5ed82b800d8 ("powerpc: Set crashkernel offset to mid of RMA region") fixed this boot failure by moving the offset to mid of RMA region. Limit this offset to 512MB to avoid running into boot failures, during kdump kernel boot, due RTAS or other allocation restrictions.

---
 arch/powerpc/kexec/core.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
arch/powerpc/kexec/core.c +2 -2
index cf84bfe9e27e..c2cbfcf81cea 100644
@@ -136,7 +136,7 @@ void __init reserve_crashkernel(void)
 #ifdef CONFIG_PPC64
 		/*
 		 * On the LPAR platform place the crash kernel to mid of
-		 * RMA size (512MB or more) to ensure the crash kernel
+		 * RMA size (max. of 512MB) to ensure the crash kernel
 		 * gets enough space to place itself and some stack to be
 		 * in the first segment. At the same time normal kernel
 		 * also get enough space to allocate memory for essential
@@ -144,7 +144,7 @@ void __init reserve_crashkernel(void)
 		 * kernel starts at 128MB offset on other platforms.
 		 */
 		if (firmware_has_feature(FW_FEATURE_LPAR))
-			crashk_res.start = ppc64_rma_size / 2;
+			crashk_res.start = min(0x20000000ULL, (ppc64_rma_size / 2));
 		else
 			crashk_res.start = min(0x8000000ULL, (ppc64_rma_size / 2));
 #else
Signature · 1 line
2.37.3
#1 lore raw

Le 09/09/2022 à 19:40, Hari Bathini a écrit :

Quoted 28 lines

Since commit e641eb03ab2b0 ("powerpc: Fix up the kdump base cap to 128M") memory for kdump kernel has been reserved at an offset of 128MB. This held up well for a long time before running into boot failure on LPARs having a lot of cores. Commit 7c5ed82b800d8 ("powerpc: Set crashkernel offset to mid of RMA region") fixed this boot failure by moving the offset to mid of RMA region. Limit this offset to 512MB to avoid running into boot failures, during kdump kernel boot, due RTAS or other allocation restrictions.

---
  arch/powerpc/kexec/core.c | 4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)
arch/powerpc/kexec/core.c +1 -1
index cf84bfe9e27e..c2cbfcf81cea 100644
@@ -136,7 +136,7 @@ void __init reserve_crashkernel(void)
  #ifdef CONFIG_PPC64
  		/*
  		 * On the LPAR platform place the crash kernel to mid of
-		 * RMA size (512MB or more) to ensure the crash kernel
+		 * RMA size (max. of 512MB) to ensure the crash kernel
  		 * gets enough space to place itself and some stack to be
  		 * in the first segment. At the same time normal kernel
  		 * also get enough space to allocate memory for essential

arch/powerpc/kexec/core.c void __init reserve_crashkernel(void) · line 147

Quoted 5 lines
arch/powerpc/kexec/core.c +1 -1
@@ -144,7 +144,7 @@ void __init reserve_crashkernel(void)
  		 * kernel starts at 128MB offset on other platforms.
  		 */
  		if (firmware_has_feature(FW_FEATURE_LPAR))
-			crashk_res.start = ppc64_rma_size / 2;
+			crashk_res.start = min(0x20000000ULL, (ppc64_rma_size / 2));

Use SZ_512M instead of open coding.

Remove the ( ) around ppc64_rma_size / 2

arch/powerpc/kexec/core.c void __init reserve_crashkernel(void) · line 150

Quoted 3 lines
arch/powerpc/kexec/core.c +0 -0
  		else
  			crashk_res.start = min(0x8000000ULL, (ppc64_rma_size / 2));
  #else

Christophe

#2 lore raw
Quoted 39 lines · Christophe Leroy

Le 09/09/2022 à 19:40, Hari Bathini a écrit :

Quoted 28 lines

Since commit e641eb03ab2b0 ("powerpc: Fix up the kdump base cap to 128M") memory for kdump kernel has been reserved at an offset of 128MB. This held up well for a long time before running into boot failure on LPARs having a lot of cores. Commit 7c5ed82b800d8 ("powerpc: Set crashkernel offset to mid of RMA region") fixed this boot failure by moving the offset to mid of RMA region. Limit this offset to 512MB to avoid running into boot failures, during kdump kernel boot, due RTAS or other allocation restrictions.

---
   arch/powerpc/kexec/core.c | 4 ++--
   1 file changed, 2 insertions(+), 2 deletions(-)
arch/powerpc/kexec/core.c +1 -1
index cf84bfe9e27e..c2cbfcf81cea 100644
@@ -136,7 +136,7 @@ void __init reserve_crashkernel(void)
   #ifdef CONFIG_PPC64
   		/*
   		 * On the LPAR platform place the crash kernel to mid of
-		 * RMA size (512MB or more) to ensure the crash kernel
+		 * RMA size (max. of 512MB) to ensure the crash kernel
   		 * gets enough space to place itself and some stack to be
   		 * in the first segment. At the same time normal kernel
   		 * also get enough space to allocate memory for essential

arch/powerpc/kexec/core.c void __init reserve_crashkernel(void) · line 147

Quoted 5 lines
arch/powerpc/kexec/core.c +1 -1
@@ -144,7 +144,7 @@ void __init reserve_crashkernel(void)
   		 * kernel starts at 128MB offset on other platforms.
   		 */
   		if (firmware_has_feature(FW_FEATURE_LPAR))
-			crashk_res.start = ppc64_rma_size / 2;
+			crashk_res.start = min(0x20000000ULL, (ppc64_rma_size / 2));

Use SZ_512M instead of open coding.

Quoted 1 line

Remove the ( ) around ppc64_rma_size / 2

Thanks for the review. Posted v2 with updated changelog and the above addressed..

- Hari