All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] riscv: kdump: return early for invalid 'crashkernel=0' input
@ 2026-02-06  4:35 Austin Kim
  2026-02-13  0:47   ` Paul Walmsley
  0 siblings, 1 reply; 5+ messages in thread
From: Austin Kim @ 2026-02-06  4:35 UTC (permalink / raw)
  To: Paul Walmsley, Palmer Dabbelt, Alexandre Ghiti
  Cc: linux-kernel, linux-riscv, austindh.kim

From: Austin Kim <austin.kim@lge.com>

An invalid 'crashkernel=0' can be specified when running kdump.
By adding a check for 'crashkernel=0', it can return early when detecting
this invalid input.

Signed-off-by: Austin Kim <austin.kim@lge.com>
---
 arch/riscv/mm/init.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/arch/riscv/mm/init.c b/arch/riscv/mm/init.c
index 811e03786..e61fec445 100644
--- a/arch/riscv/mm/init.c
+++ b/arch/riscv/mm/init.c
@@ -1409,7 +1409,8 @@ static void __init arch_reserve_crashkernel(void)
 	ret = parse_crashkernel(boot_command_line, memblock_phys_mem_size(),
 				&crash_size, &crash_base,
 				&low_size, NULL, &high);
-	if (ret)
+	/* invalid value specified or 'crashkernel=0' */
+	if (ret || !crash_size)
 		return;
 
 	reserve_crashkernel_generic(crash_size, crash_base, low_size, high);
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] riscv: kdump: return early for invalid 'crashkernel=0' input
  2026-02-06  4:35 [PATCH] riscv: kdump: return early for invalid 'crashkernel=0' input Austin Kim
@ 2026-02-13  0:47   ` Paul Walmsley
  0 siblings, 0 replies; 5+ messages in thread
From: Paul Walmsley @ 2026-02-13  0:47 UTC (permalink / raw)
  To: Austin Kim
  Cc: Paul Walmsley, Palmer Dabbelt, Alexandre Ghiti, linux-kernel,
	linux-riscv

Hi,

On Fri, 6 Feb 2026, Austin Kim wrote:

> From: Austin Kim <austin.kim@lge.com>
> 
> An invalid 'crashkernel=0' can be specified when running kdump.
> By adding a check for 'crashkernel=0', it can return early when detecting
> this invalid input.
> 
> Signed-off-by: Austin Kim <austin.kim@lge.com>
> ---
>  arch/riscv/mm/init.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/arch/riscv/mm/init.c b/arch/riscv/mm/init.c
> index 811e03786..e61fec445 100644
> --- a/arch/riscv/mm/init.c
> +++ b/arch/riscv/mm/init.c
> @@ -1409,7 +1409,8 @@ static void __init arch_reserve_crashkernel(void)
>  	ret = parse_crashkernel(boot_command_line, memblock_phys_mem_size(),
>  				&crash_size, &crash_base,
>  				&low_size, NULL, &high);
> -	if (ret)
> +	/* invalid value specified or 'crashkernel=0' */
> +	if (ret || !crash_size)
>  		return;
>  
>  	reserve_crashkernel_generic(crash_size, crash_base, low_size, high);

Should this fix the common code in kernel/crash_reserve.c to return an 
error code when crashkernel=0 so it benefits other architectures?


- Paul

_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] riscv: kdump: return early for invalid 'crashkernel=0' input
@ 2026-02-13  0:47   ` Paul Walmsley
  0 siblings, 0 replies; 5+ messages in thread
From: Paul Walmsley @ 2026-02-13  0:47 UTC (permalink / raw)
  To: Austin Kim
  Cc: Paul Walmsley, Palmer Dabbelt, Alexandre Ghiti, linux-kernel,
	linux-riscv

Hi,

On Fri, 6 Feb 2026, Austin Kim wrote:

> From: Austin Kim <austin.kim@lge.com>
> 
> An invalid 'crashkernel=0' can be specified when running kdump.
> By adding a check for 'crashkernel=0', it can return early when detecting
> this invalid input.
> 
> Signed-off-by: Austin Kim <austin.kim@lge.com>
> ---
>  arch/riscv/mm/init.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/arch/riscv/mm/init.c b/arch/riscv/mm/init.c
> index 811e03786..e61fec445 100644
> --- a/arch/riscv/mm/init.c
> +++ b/arch/riscv/mm/init.c
> @@ -1409,7 +1409,8 @@ static void __init arch_reserve_crashkernel(void)
>  	ret = parse_crashkernel(boot_command_line, memblock_phys_mem_size(),
>  				&crash_size, &crash_base,
>  				&low_size, NULL, &high);
> -	if (ret)
> +	/* invalid value specified or 'crashkernel=0' */
> +	if (ret || !crash_size)
>  		return;
>  
>  	reserve_crashkernel_generic(crash_size, crash_base, low_size, high);

Should this fix the common code in kernel/crash_reserve.c to return an 
error code when crashkernel=0 so it benefits other architectures?


- Paul

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] riscv: kdump: return early for invalid 'crashkernel=0' input
  2026-02-13  0:47   ` Paul Walmsley
@ 2026-02-13  1:16     ` Austin Kim
  -1 siblings, 0 replies; 5+ messages in thread
From: Austin Kim @ 2026-02-13  1:16 UTC (permalink / raw)
  To: Paul Walmsley; +Cc: Palmer Dabbelt, Alexandre Ghiti, linux-kernel, linux-riscv

Hello Paul,

2026년 2월 13일 (금) AM 9:47, Paul Walmsley <pjw@kernel.org>님이 작성:
>
> Hi,
>
> On Fri, 6 Feb 2026, Austin Kim wrote:
>
> > From: Austin Kim <austin.kim@lge.com>
> >
> > An invalid 'crashkernel=0' can be specified when running kdump.
> > By adding a check for 'crashkernel=0', it can return early when detecting
> > this invalid input.
> >
> > Signed-off-by: Austin Kim <austin.kim@lge.com>
> > ---
> >  arch/riscv/mm/init.c | 3 ++-
> >  1 file changed, 2 insertions(+), 1 deletion(-)
> >
> > diff --git a/arch/riscv/mm/init.c b/arch/riscv/mm/init.c
> > index 811e03786..e61fec445 100644
> > --- a/arch/riscv/mm/init.c
> > +++ b/arch/riscv/mm/init.c
> > @@ -1409,7 +1409,8 @@ static void __init arch_reserve_crashkernel(void)
> >       ret = parse_crashkernel(boot_command_line, memblock_phys_mem_size(),
> >                               &crash_size, &crash_base,
> >                               &low_size, NULL, &high);
> > -     if (ret)
> > +     /* invalid value specified or 'crashkernel=0' */
> > +     if (ret || !crash_size)
> >               return;
> >
> >       reserve_crashkernel_generic(crash_size, crash_base, low_size, high);
>
> Should this fix the common code in kernel/crash_reserve.c to return an
> error code when crashkernel=0 so it benefits other architectures?

Thanks for another better idea.

I will find out the way to add exception handling for the "crashkernel=0" case
in the generic APIs below.

kernel/crash_reserve.c
static int __init __parse_crashkernel(...)
static __init char *get_last_crashkernel(...)

As you said, it would be better if other architectures will benefit
from this change.

BR,
Austin Kim

>
>
> - Paul

_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] riscv: kdump: return early for invalid 'crashkernel=0' input
@ 2026-02-13  1:16     ` Austin Kim
  0 siblings, 0 replies; 5+ messages in thread
From: Austin Kim @ 2026-02-13  1:16 UTC (permalink / raw)
  To: Paul Walmsley; +Cc: Palmer Dabbelt, Alexandre Ghiti, linux-kernel, linux-riscv

Hello Paul,

2026년 2월 13일 (금) AM 9:47, Paul Walmsley <pjw@kernel.org>님이 작성:
>
> Hi,
>
> On Fri, 6 Feb 2026, Austin Kim wrote:
>
> > From: Austin Kim <austin.kim@lge.com>
> >
> > An invalid 'crashkernel=0' can be specified when running kdump.
> > By adding a check for 'crashkernel=0', it can return early when detecting
> > this invalid input.
> >
> > Signed-off-by: Austin Kim <austin.kim@lge.com>
> > ---
> >  arch/riscv/mm/init.c | 3 ++-
> >  1 file changed, 2 insertions(+), 1 deletion(-)
> >
> > diff --git a/arch/riscv/mm/init.c b/arch/riscv/mm/init.c
> > index 811e03786..e61fec445 100644
> > --- a/arch/riscv/mm/init.c
> > +++ b/arch/riscv/mm/init.c
> > @@ -1409,7 +1409,8 @@ static void __init arch_reserve_crashkernel(void)
> >       ret = parse_crashkernel(boot_command_line, memblock_phys_mem_size(),
> >                               &crash_size, &crash_base,
> >                               &low_size, NULL, &high);
> > -     if (ret)
> > +     /* invalid value specified or 'crashkernel=0' */
> > +     if (ret || !crash_size)
> >               return;
> >
> >       reserve_crashkernel_generic(crash_size, crash_base, low_size, high);
>
> Should this fix the common code in kernel/crash_reserve.c to return an
> error code when crashkernel=0 so it benefits other architectures?

Thanks for another better idea.

I will find out the way to add exception handling for the "crashkernel=0" case
in the generic APIs below.

kernel/crash_reserve.c
static int __init __parse_crashkernel(...)
static __init char *get_last_crashkernel(...)

As you said, it would be better if other architectures will benefit
from this change.

BR,
Austin Kim

>
>
> - Paul

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2026-02-13  1:16 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-02-06  4:35 [PATCH] riscv: kdump: return early for invalid 'crashkernel=0' input Austin Kim
2026-02-13  0:47 ` Paul Walmsley
2026-02-13  0:47   ` Paul Walmsley
2026-02-13  1:16   ` Austin Kim
2026-02-13  1:16     ` Austin Kim

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.