]> xenbits.xensource.com Git - people/royger/xen.git/commitdiff
kexec: provide user friendly option for memory limit
authorSimon Crowe <Simon.Crowe@citrix.com>
Fri, 9 Jun 2017 12:11:37 +0000 (14:11 +0200)
committerJan Beulich <jbeulich@suse.com>
Fri, 9 Jun 2017 12:11:37 +0000 (14:11 +0200)
kexec: Provide user friendly option for memory limit

grub2 requires that the '<' character be escaped which is
inconvienet for users, provide a more natural specifier.

Signed-off-by: Simon Crowe <Simon.Crowe@citrix.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
docs/misc/kexec_and_kdump.txt
docs/misc/xen-command-line.markdown
xen/common/kexec.c

index 2f937718a3d49d68703303c76caeb345268851ff..0842b3d58fa2cb7bde760cc227056043396e2889 100644 (file)
@@ -136,7 +136,13 @@ command line parameter to the Xen hypervisor. It has two forms:
 
       e.g. crashkernel=128M@256M
 
-   Regardless of which of the two forms of the crashkernel command line you
+  iii) crashkernel=size,below=offset
+
+      This allows us to place the crash kernel within the usuable address
+      space without having to worry about a specific phyiscal address.
+      The '<' and 'below' options are  synonymous
+
+   Regardless of which of the forms of the crashkernel command line you
    use, the crash kernel region should appear in /proc/iomem on x86. If it
    doesn't then either the crashkernel parameter is missing, or for some
    reason the region couldn't be placed - for instance because it is too large.
index 8c939c4e366c3dc08da034397db324c74828a4ef..6eb5cfc2c04c0104e15678756a3ab8e0c38bc1e2 100644 (file)
@@ -512,6 +512,7 @@ combination with the `low_crashinfo` command line option.
 ### crashkernel
 > `= <ramsize-range>:<size>[,...][{@,<}<offset>]`
 > `= <size>[{@,<}<offset>]`
+> `= <size>,below=offset`
 
 Specify sizes and optionally placement of the crash kernel reservation
 area.  The `<ramsize-range>:<size>` pairs indicate how much memory to
@@ -523,6 +524,10 @@ A trailing `@<offset>` specifies the exact address this area should be
 placed at, whereas `<` in place of `@` just specifies an upper bound of
 the address range the area should fall into.
 
+< and below are synonyomous, the latter being useful for grub2 systems
+which would otherwise require escaping of the < option
+
+
 ### credit2\_balance\_over
 > `= <integer>`
 
index fbca8a6499a7944f22ed093cba6e8f66001248d9..a52c30ba1e3faf1e32dbe6395cb55bea56fc0aaf 100644 (file)
@@ -88,7 +88,7 @@ static void *crash_heap_current = NULL, *crash_heap_end = NULL;
 /*
  * Parse command lines in the format
  *
- *   crashkernel=<ramsize-range>:<size>[,...][{@,<}<address>]
+ *   crashkernel=<ramsize-range>:<size>[,...][{@,<,below=}<address>]
  *
  * with <ramsize-range> being of form
  *
@@ -97,6 +97,10 @@ static void *crash_heap_current = NULL, *crash_heap_end = NULL;
  * as well as the legacy ones in the format
  *
  *   crashkernel=<size>[{@,<}<address>]
+ *   crashkernel=<size>,below=address
+ *
+ * < and below are synonyomous, the latter being useful for grub2 systems
+ * which would otherwise require escaping of the < option
  */
 static void __init parse_crashkernel(const char *str)
 {
@@ -111,7 +115,7 @@ static void __init parse_crashkernel(const char *str)
             {
                 printk(XENLOG_WARNING "crashkernel: too many ranges\n");
                 cur = NULL;
-                str = strpbrk(str, "@<");
+                str = strpbrk(str, "@,<");
                 break;
             }
 
@@ -162,6 +166,8 @@ static void __init parse_crashkernel(const char *str)
             kexec_crash_area.start = parse_size_and_unit(cur = str + 1, &str);
         else if ( *str == '<' )
             kexec_crash_area_limit = parse_size_and_unit(cur = str + 1, &str);
+        else if ( !strncmp(str, ",below=", 7) )
+            kexec_crash_area_limit = parse_size_and_unit(cur = str + 7, &str);
         else
             printk(XENLOG_WARNING "crashkernel: '%s' ignored\n", str);
     }