Kexec Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] kexec/x86: fix crashkernel reserved mem detection
@ 2014-12-25 13:38 Yuri Volchkov
  2015-01-09  6:27 ` Tony Jones
  2015-01-14  6:24 ` Baoquan He
  0 siblings, 2 replies; 5+ messages in thread
From: Yuri Volchkov @ 2014-12-25 13:38 UTC (permalink / raw)
  To: horms, kexec; +Cc: wolchkov.yuri

Function crashkernel_mem_callback had wrong parameters type
So crash_reserved_mem got completely insane values
As a result kexec was unable to allocate segments for crashkernel
For instance, I got this message:
	"Could not find a free area of memory of 0x9f000 bytes..."

Signed-off-by: Yuri Volchkov <wolchkov.yuri@gmail.com>
---
 kexec/arch/i386/crashdump-x86.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/kexec/arch/i386/crashdump-x86.c b/kexec/arch/i386/crashdump-x86.c
index 77bdad5..82bf239 100644
--- a/kexec/arch/i386/crashdump-x86.c
+++ b/kexec/arch/i386/crashdump-x86.c
@@ -1041,8 +1041,8 @@ int get_max_crash_kernel_limit(uint64_t *start, uint64_t *end)
 
 static int crashkernel_mem_callback(void *UNUSED(data), int nr,
                                           char *UNUSED(str),
-                                          unsigned long base,
-                                          unsigned long length)
+                                          unsigned long long base,
+                                          unsigned long long length)
 {
 	if (nr >= CRASH_RESERVED_MEM_NR)
 		return 1;
-- 
2.2.1


_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec

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

* Re: [PATCH] kexec/x86: fix crashkernel reserved mem detection
  2014-12-25 13:38 [PATCH] kexec/x86: fix crashkernel reserved mem detection Yuri Volchkov
@ 2015-01-09  6:27 ` Tony Jones
  2015-01-09  8:59   ` Baoquan He
  2015-01-14  6:24 ` Baoquan He
  1 sibling, 1 reply; 5+ messages in thread
From: Tony Jones @ 2015-01-09  6:27 UTC (permalink / raw)
  To: kexec; +Cc: horms, wolchkov.yuri

On 12/25/2014 05:38 AM, Yuri Volchkov wrote:
> Function crashkernel_mem_callback had wrong parameters type
> So crash_reserved_mem got completely insane values
> As a result kexec was unable to allocate segments for crashkernel
> For instance, I got this message:
> 	"Could not find a free area of memory of 0x9f000 bytes..."
> 
> Signed-off-by: Yuri Volchkov <wolchkov.yuri@gmail.com>

See the patch attached to https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=771671
which also fixes kexec/arch/sh/crashdump-sh.c and kexec/arch/sh/kexec-sh.c

Definitely a problem.  Without the x86 fix we seem same failure on i586

tony

> ---
>  kexec/arch/i386/crashdump-x86.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/kexec/arch/i386/crashdump-x86.c b/kexec/arch/i386/crashdump-x86.c
> index 77bdad5..82bf239 100644
> --- a/kexec/arch/i386/crashdump-x86.c
> +++ b/kexec/arch/i386/crashdump-x86.c
> @@ -1041,8 +1041,8 @@ int get_max_crash_kernel_limit(uint64_t *start, uint64_t *end)
>  
>  static int crashkernel_mem_callback(void *UNUSED(data), int nr,
>                                            char *UNUSED(str),
> -                                          unsigned long base,
> -                                          unsigned long length)
> +                                          unsigned long long base,
> +                                          unsigned long long length)
>  {
>  	if (nr >= CRASH_RESERVED_MEM_NR)
>  		return 1;
> 


_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec

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

* Re: [PATCH] kexec/x86: fix crashkernel reserved mem detection
  2015-01-09  6:27 ` Tony Jones
@ 2015-01-09  8:59   ` Baoquan He
  2015-01-14  5:31     ` Baoquan He
  0 siblings, 1 reply; 5+ messages in thread
From: Baoquan He @ 2015-01-09  8:59 UTC (permalink / raw)
  To: Tony Jones; +Cc: wolchkov.yuri, horms, kexec

On 01/08/15 at 10:27pm, Tony Jones wrote:
> On 12/25/2014 05:38 AM, Yuri Volchkov wrote:
> > Function crashkernel_mem_callback had wrong parameters type
> > So crash_reserved_mem got completely insane values
> > As a result kexec was unable to allocate segments for crashkernel
> > For instance, I got this message:
> > 	"Could not find a free area of memory of 0x9f000 bytes..."
> > 
> > Signed-off-by: Yuri Volchkov <wolchkov.yuri@gmail.com>
> 
> See the patch attached to https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=771671
> which also fixes kexec/arch/sh/crashdump-sh.c and kexec/arch/sh/kexec-sh.c
> 
> Definitely a problem.  Without the x86 fix we seem same failure on i586

Hi Tony,

commit 4362bfa make that change, but skip the crashkernel_mem_callback.
It need be fixed.

I am wondering how the insane values happened on i386, and it didn't
happen on x86_64.

Thanks
Baoquan

> 
> tony
> 
> > ---
> >  kexec/arch/i386/crashdump-x86.c | 4 ++--
> >  1 file changed, 2 insertions(+), 2 deletions(-)
> > 
> > diff --git a/kexec/arch/i386/crashdump-x86.c b/kexec/arch/i386/crashdump-x86.c
> > index 77bdad5..82bf239 100644
> > --- a/kexec/arch/i386/crashdump-x86.c
> > +++ b/kexec/arch/i386/crashdump-x86.c
> > @@ -1041,8 +1041,8 @@ int get_max_crash_kernel_limit(uint64_t *start, uint64_t *end)
> >  
> >  static int crashkernel_mem_callback(void *UNUSED(data), int nr,
> >                                            char *UNUSED(str),
> > -                                          unsigned long base,
> > -                                          unsigned long length)
> > +                                          unsigned long long base,
> > +                                          unsigned long long length)
> >  {
> >  	if (nr >= CRASH_RESERVED_MEM_NR)
> >  		return 1;
> > 
> 
> 
> _______________________________________________
> kexec mailing list
> kexec@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/kexec

_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec

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

* Re: [PATCH] kexec/x86: fix crashkernel reserved mem detection
  2015-01-09  8:59   ` Baoquan He
@ 2015-01-14  5:31     ` Baoquan He
  0 siblings, 0 replies; 5+ messages in thread
From: Baoquan He @ 2015-01-14  5:31 UTC (permalink / raw)
  To: Tony Jones; +Cc: kexec, horms, wolchkov.yuri

On 01/09/15 at 04:59pm, Baoquan He wrote:
> On 01/08/15 at 10:27pm, Tony Jones wrote:
> > On 12/25/2014 05:38 AM, Yuri Volchkov wrote:
> > > Function crashkernel_mem_callback had wrong parameters type
> > > So crash_reserved_mem got completely insane values
> > > As a result kexec was unable to allocate segments for crashkernel
> > > For instance, I got this message:
> > > 	"Could not find a free area of memory of 0x9f000 bytes..."
> > > 
> > > Signed-off-by: Yuri Volchkov <wolchkov.yuri@gmail.com>
> > 
> > See the patch attached to https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=771671
> > which also fixes kexec/arch/sh/crashdump-sh.c and kexec/arch/sh/kexec-sh.c
> > 
> > Definitely a problem.  Without the x86 fix we seem same failure on i586
> 
> Hi Tony,
> 
> commit 4362bfa make that change, but skip the crashkernel_mem_callback.
> It need be fixed.
> 
> I am wondering how the insane values happened on i386, and it didn't
> happen on x86_64.

Never mind, have got it.


_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec

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

* Re: [PATCH] kexec/x86: fix crashkernel reserved mem detection
  2014-12-25 13:38 [PATCH] kexec/x86: fix crashkernel reserved mem detection Yuri Volchkov
  2015-01-09  6:27 ` Tony Jones
@ 2015-01-14  6:24 ` Baoquan He
  1 sibling, 0 replies; 5+ messages in thread
From: Baoquan He @ 2015-01-14  6:24 UTC (permalink / raw)
  To: Yuri Volchkov; +Cc: horms, kexec

On 12/25/14 at 10:38pm, Yuri Volchkov wrote:
> Function crashkernel_mem_callback had wrong parameters type
> So crash_reserved_mem got completely insane values
> As a result kexec was unable to allocate segments for crashkernel
> For instance, I got this message:
> 	"Could not find a free area of memory of 0x9f000 bytes..."
> 
> Signed-off-by: Yuri Volchkov <wolchkov.yuri@gmail.com>
> ---
>  kexec/arch/i386/crashdump-x86.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/kexec/arch/i386/crashdump-x86.c b/kexec/arch/i386/crashdump-x86.c
> index 77bdad5..82bf239 100644
> --- a/kexec/arch/i386/crashdump-x86.c
> +++ b/kexec/arch/i386/crashdump-x86.c
> @@ -1041,8 +1041,8 @@ int get_max_crash_kernel_limit(uint64_t *start, uint64_t *end)
>  

crash_sh_memory_range_callback in kexec/arch/sh/crashdump-sh.c also has
this problem, please consider it.

>  static int crashkernel_mem_callback(void *UNUSED(data), int nr,
>                                            char *UNUSED(str),
> -                                          unsigned long base,
> -                                          unsigned long length)
> +                                          unsigned long long base,
> +                                          unsigned long long length)
>  {
>  	if (nr >= CRASH_RESERVED_MEM_NR)
>  		return 1;
> -- 
> 2.2.1
> 
> 
> _______________________________________________
> kexec mailing list
> kexec@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/kexec

_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec

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

end of thread, other threads:[~2015-01-14  6:26 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-12-25 13:38 [PATCH] kexec/x86: fix crashkernel reserved mem detection Yuri Volchkov
2015-01-09  6:27 ` Tony Jones
2015-01-09  8:59   ` Baoquan He
2015-01-14  5:31     ` Baoquan He
2015-01-14  6:24 ` Baoquan He

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox