Skip to contentSkip to conversation

support Linux' advanced crashkernel= syntax (v2)

PATCH New Jan Beulich 1 participant 1 message Apr 26, 2010

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 support Linux' advanced crashkernel= syntax (v2)

Quoting the original Linux patch's description:

"This patch adds a extended crashkernel syntax that makes the value of
reserved system RAM dependent on the system RAM itself:

    crashkernel=<range1>:<size1>[,<range2>:<size2>,...][@offset]
    range=start-[end]

For example:

    crashkernel=512M-2G:64M,2G-:128M

The motivation comes from distributors that configure their crashkernel command line automatically with some configuration tool (YaST, you know ;)). Of course that tool knows the value of System RAM, but if the user removes RAM, then the system becomes unbootable or at least unusable and error handling is very difficult."

For x86, other than Linux we pass the actual amount of RAM rather than the highest page's address (to cope with sparse physical address maps).

This still needs to be hooked up for ia64.

xen/arch/x86/setup.c +5 -0
@@ -643,6 +643,11 @@ void __init __start_xen(unsigned long mb
     memcpy(&boot_e820, &e820, sizeof(e820));
 
     /* Early kexec reservation (explicit static start address). */
+    nr_pages = 0;
+    for ( i = 0; i < e820.nr_map; i++ )
+        if ( e820.map[i].type == E820_RAM )
+            nr_pages += e820.map[i].size >> PAGE_SHIFT;
+    set_kexec_crash_area_size((u64)nr_pages << PAGE_SHIFT);
     kexec_reserve_area(&boot_e820);
 
     /*
xen/common/kexec.c +97 -3

112 lines not on this page · raw message

xen/include/xen/kexec.h +2 -0
@@ -12,6 +12,8 @@ typedef struct xen_kexec_reserve {
 
 extern xen_kexec_reserve_t kexec_crash_area;
 
+void set_kexec_crash_area_size(u64 system_ram);
+
 /* We have space for 4 images to support atomic update
  * of images. This is important for CRASH images since
  * a panic can happen at any time...

Quoting the original Linux patch's description:

"This patch adds a extended crashkernel syntax that makes the value of
reserved system RAM dependent on the system RAM itself:

    crashkernel=<range1>:<size1>[,<range2>:<size2>,...][@offset]
    range=start-[end]

For example:

    crashkernel=512M-2G:64M,2G-:128M

The motivation comes from distributors that configure their crashkernel command line automatically with some configuration tool (YaST, you know ;)). Of course that tool knows the value of System RAM, but if the user removes RAM, then the system becomes unbootable or at least unusable and error handling is very difficult."

For x86, other than Linux we pass the actual amount of RAM rather than the highest page's address (to cope with sparse physical address maps).

This still needs to be hooked up for ia64.

xen/arch/x86/setup.c +5 -0
@@ -643,6 +643,11 @@ void __init __start_xen(unsigned long mb
     memcpy(&boot_e820, &e820, sizeof(e820));
 
     /* Early kexec reservation (explicit static start address). */
+    nr_pages = 0;
+    for ( i = 0; i < e820.nr_map; i++ )
+        if ( e820.map[i].type == E820_RAM )
+            nr_pages += e820.map[i].size >> PAGE_SHIFT;
+    set_kexec_crash_area_size((u64)nr_pages << PAGE_SHIFT);
     kexec_reserve_area(&boot_e820);
 
     /*
xen/common/kexec.c +97 -3

112 lines not on this page · raw message

xen/include/xen/kexec.h +2 -0
@@ -12,6 +12,8 @@ typedef struct xen_kexec_reserve {
 
 extern xen_kexec_reserve_t kexec_crash_area;
 
+void set_kexec_crash_area_size(u64 system_ram);
+
 /* We have space for 4 images to support atomic update
  * of images. This is important for CRASH images since
  * a panic can happen at any time...

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel