* [PATCH v2] ppc64/kdump: Limit kdump base to 512MB
@ 2022-09-12 6:50 Hari Bathini
2022-09-13 10:15 ` Sachin Sant
2022-10-04 13:25 ` Michael Ellerman
0 siblings, 2 replies; 3+ messages in thread
From: Hari Bathini @ 2022-09-12 6:50 UTC (permalink / raw)
To: Michael Ellerman; +Cc: linuxppc-dev, Mahesh J Salgaonkar, Sourabh Jain
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. This change
meant the offset is either 256MB or 512MB on LPARs as ppc64_rma_size
was 512MB or 1024MB owing to commit 103a8542cb35b ("powerpc/book3s64/
radix: Fix boot failure with large amount of guest memory")
But ppc64_rma_size can be larger as well with newer f/w. So, limit
crashkernel reservation offset to 512MB to avoid running into boot
failures during kdump kernel boot, due to RTAS or other allocation
restrictions.
Also, while here, use SZ_128M instead of opening coding it.
Signed-off-by: Hari Bathini <hbathini@linux.ibm.com>
---
Changes in V2:
* Updated the changelog for clarity.
* Used SZ_512M instead of open coding as suggested by Christophe.
* Used SZ_128M instead of open coding 128MB.
arch/powerpc/kexec/core.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/arch/powerpc/kexec/core.c b/arch/powerpc/kexec/core.c
index cf84bfe9e27e..de64c7962991 100644
--- a/arch/powerpc/kexec/core.c
+++ b/arch/powerpc/kexec/core.c
@@ -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,9 +144,9 @@ 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_t(u64, ppc64_rma_size / 2, SZ_512M);
else
- crashk_res.start = min(0x8000000ULL, (ppc64_rma_size / 2));
+ crashk_res.start = min_t(u64, ppc64_rma_size / 2, SZ_128M);
#else
crashk_res.start = KDUMP_KERNELBASE;
#endif
--
2.37.3
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH v2] ppc64/kdump: Limit kdump base to 512MB
2022-09-12 6:50 [PATCH v2] ppc64/kdump: Limit kdump base to 512MB Hari Bathini
@ 2022-09-13 10:15 ` Sachin Sant
2022-10-04 13:25 ` Michael Ellerman
1 sibling, 0 replies; 3+ messages in thread
From: Sachin Sant @ 2022-09-13 10:15 UTC (permalink / raw)
To: Hari Bathini; +Cc: linuxppc-dev, Mahesh J Salgaonkar, Sourabh Jain
> On 12-Sep-2022, at 12:20 PM, Hari Bathini <hbathini@linux.ibm.com> wrote:
>
> 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. This change
> meant the offset is either 256MB or 512MB on LPARs as ppc64_rma_size
> was 512MB or 1024MB owing to commit 103a8542cb35b ("powerpc/book3s64/
> radix: Fix boot failure with large amount of guest memory")
>
> But ppc64_rma_size can be larger as well with newer f/w. So, limit
> crashkernel reservation offset to 512MB to avoid running into boot
> failures during kdump kernel boot, due to RTAS or other allocation
> restrictions.
>
> Also, while here, use SZ_128M instead of opening coding it.
>
> Signed-off-by: Hari Bathini <hbathini@linux.ibm.com>
> ---
Tested on a Power10 and Power9 LPAR. Kdump works as expected.
Tested-by: Sachin Sant <sachinp@linux.ibm.com>
>
> Changes in V2:
> * Updated the changelog for clarity.
> * Used SZ_512M instead of open coding as suggested by Christophe.
> * Used SZ_128M instead of open coding 128MB.
>
> arch/powerpc/kexec/core.c | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/arch/powerpc/kexec/core.c b/arch/powerpc/kexec/core.c
> index cf84bfe9e27e..de64c7962991 100644
> --- a/arch/powerpc/kexec/core.c
> +++ b/arch/powerpc/kexec/core.c
> @@ -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,9 +144,9 @@ 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_t(u64, ppc64_rma_size / 2, SZ_512M);
> else
> - crashk_res.start = min(0x8000000ULL, (ppc64_rma_size / 2));
> + crashk_res.start = min_t(u64, ppc64_rma_size / 2, SZ_128M);
> #else
> crashk_res.start = KDUMP_KERNELBASE;
> #endif
> --
> 2.37.3
>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH v2] ppc64/kdump: Limit kdump base to 512MB
2022-09-12 6:50 [PATCH v2] ppc64/kdump: Limit kdump base to 512MB Hari Bathini
2022-09-13 10:15 ` Sachin Sant
@ 2022-10-04 13:25 ` Michael Ellerman
1 sibling, 0 replies; 3+ messages in thread
From: Michael Ellerman @ 2022-10-04 13:25 UTC (permalink / raw)
To: Hari Bathini, Michael Ellerman
Cc: linuxppc-dev, Mahesh J Salgaonkar, Sourabh Jain
On Mon, 12 Sep 2022 12:20:31 +0530, Hari Bathini wrote:
> 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. This change
> meant the offset is either 256MB or 512MB on LPARs as ppc64_rma_size
> was 512MB or 1024MB owing to commit 103a8542cb35b ("powerpc/book3s64/
> radix: Fix boot failure with large amount of guest memory")
>
> [...]
Applied to powerpc/next.
[1/1] ppc64/kdump: Limit kdump base to 512MB
https://git.kernel.org/powerpc/c/bd7dc90e52e8db7ee0f38c51bc9047bafb54fe43
cheers
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2022-10-04 13:47 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-09-12 6:50 [PATCH v2] ppc64/kdump: Limit kdump base to 512MB Hari Bathini
2022-09-13 10:15 ` Sachin Sant
2022-10-04 13:25 ` Michael Ellerman
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).