Skip to contentSkip to conversation

kexec/x86: fix crashkernel reserved mem detection

PATCH In review Yuri Volchkov 3 participants 5 messages Dec 25, 2014 – Jan 14, 2015

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 kexec/x86: fix crashkernel reserved mem detection

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..."
---
 kexec/arch/i386/crashdump-x86.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
kexec/arch/i386/crashdump-x86.c +2 -2
index 77bdad5..82bf239 100644
@@ -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;
Signature · 7 lines
2.2.1


_______________________________________________
kexec mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/kexec
#1 lore raw
Quoted 7 lines · Yuri Volchkov

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..."

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

Quoted 10 lines
---
 kexec/arch/i386/crashdump-x86.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
kexec/arch/i386/crashdump-x86.c +0 -0
index 77bdad5..82bf239 100644

kexec/arch/i386/crashdump-x86.c int get_max_crash_kernel_limit(uint64_t *start, uint64_t *end) · line 1048

Quoted 10 lines
kexec/arch/i386/crashdump-x86.c +2 -2
@@ -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
[email protected]
http://lists.infradead.org/mailman/listinfo/kexec

#2 lore raw
Quoted 7 lines · Tony Jones
Quoted 6 lines · Yuri Volchkov

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..."
Quoted 6 lines
Quoted 1 line

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

Quoted 13 lines

tony

Quoted 10 lines
---
 kexec/arch/i386/crashdump-x86.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
kexec/arch/i386/crashdump-x86.c +0 -0
index 77bdad5..82bf239 100644
@@ -1041,8 +1041,8 @@ int get_max_crash_kernel_limit(uint64_t *start, uint64_t *end)
 
Quoted 16 lines

kexec/arch/i386/crashdump-x86.c int get_max_crash_kernel_limit(uint64_t *start, uint64_t *end) · line 1048

Quoted 10 lines
kexec/arch/i386/crashdump-x86.c +2 -2
 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
[email protected]
http://lists.infradead.org/mailman/listinfo/kexec

_______________________________________________
kexec mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/kexec

#3 lore raw
Quoted 15 lines · Baoquan He
Quoted 7 lines · Tony Jones
Quoted 6 lines · Yuri Volchkov

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..."
Quoted 6 lines
Quoted 1 line

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

Quoted 7 lines

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
[email protected]
http://lists.infradead.org/mailman/listinfo/kexec

#4 lore raw
In reply to Yuri Volchkov
Quoted 16 lines · Yuri Volchkov

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..."
---
 kexec/arch/i386/crashdump-x86.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
kexec/arch/i386/crashdump-x86.c +0 -0
index 77bdad5..82bf239 100644

kexec/arch/i386/crashdump-x86.c int get_max_crash_kernel_limit(uint64_t *start, uint64_t *end) · line 1041

Quoted 1 line
kexec/arch/i386/crashdump-x86.c +0 -0
@@ -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.

Quoted 17 lines
kexec/arch/i386/crashdump-x86.c +2 -2
 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;
Signature · 7 lines
2.2.1


_______________________________________________
kexec mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/kexec

_______________________________________________
kexec mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/kexec