xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] kexec: Provide user friendly option for memory limit
@ 2017-04-27 12:22 Simon Crowe
  2017-04-28 10:37 ` Jan Beulich
  0 siblings, 1 reply; 5+ messages in thread
From: Simon Crowe @ 2017-04-27 12:22 UTC (permalink / raw)
  To: xen-devel@lists.xenproject.org


[-- Attachment #1.1: Type: text/plain, Size: 4035 bytes --]


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>
---
 docs/misc/kexec_and_kdump.txt       |  8 +++++++-
 docs/misc/xen-command-line.markdown |  5 +++++
 xen/common/kexec.c                  | 12 ++++++++++--
 3 files changed, 22 insertions(+), 3 deletions(-)

diff --git a/docs/misc/kexec_and_kdump.txt b/docs/misc/kexec_and_kdump.txt
index 2f93771..0842b3d 100644
--- a/docs/misc/kexec_and_kdump.txt
+++ b/docs/misc/kexec_and_kdump.txt
@@ -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.
diff --git a/docs/misc/xen-command-line.markdown b/docs/misc/xen-command-line.markdown
index 450b222..59e51dc 100644
--- a/docs/misc/xen-command-line.markdown
+++ b/docs/misc/xen-command-line.markdown
@@ -474,6 +474,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
@@ -485,6 +486,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>`

diff --git a/xen/common/kexec.c b/xen/common/kexec.c
index fbca8a6..3381070 100644
--- a/xen/common/kexec.c
+++ b/xen/common/kexec.c
@@ -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,10 @@ 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);
     }
--
2.7.4

?


[-- Attachment #1.2: Type: text/html, Size: 6954 bytes --]

[-- Attachment #2: Type: text/plain, Size: 127 bytes --]

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

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

* Re: [PATCH] kexec: Provide user friendly option for memory limit
  2017-04-27 12:22 [PATCH] kexec: Provide user friendly option for memory limit Simon Crowe
@ 2017-04-28 10:37 ` Jan Beulich
  2017-04-28 10:39   ` Simon Crowe
  0 siblings, 1 reply; 5+ messages in thread
From: Jan Beulich @ 2017-04-28 10:37 UTC (permalink / raw)
  To: Simon Crowe; +Cc: Andrew Cooper, xen-devel@lists.xenproject.org

>>> On 27.04.17 at 14:22, <simon.crowe@citrix.com> wrote:
> @@ -162,6 +166,10 @@ 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);

The braces you add are inconsistent with surrounding code. With
them dropped
Reviewed-by: Jan Beulich <jbeulich@suse.com>

You should also have Cc-ed the maintainer of the code.

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

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

* Re: [PATCH] kexec: Provide user friendly option for memory limit
  2017-04-28 10:37 ` Jan Beulich
@ 2017-04-28 10:39   ` Simon Crowe
  0 siblings, 0 replies; 5+ messages in thread
From: Simon Crowe @ 2017-04-28 10:39 UTC (permalink / raw)
  To: Jan Beulich; +Cc: Andrew Cooper, xen-devel@lists.xenproject.org


[-- Attachment #1.1: Type: text/plain, Size: 938 bytes --]

Jan

Ok i will make the change and resubmit

Thanks again

Regards



On Fri, Apr 28, 2017 at 11:37 AM +0100, "Jan Beulich" <JBeulich@suse.com<mailto:JBeulich@suse.com>> wrote:


>>> On 27.04.17 at 14:22,  wrote:
> @@ -162,6 +166,10 @@ 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);

The braces you add are inconsistent with surrounding code. With
them dropped
Reviewed-by: Jan Beulich

You should also have Cc-ed the maintainer of the code.

Jan



[-- Attachment #1.2: Type: text/html, Size: 2215 bytes --]

[-- Attachment #2: Type: text/plain, Size: 127 bytes --]

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

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

* [PATCH] kexec: Provide user friendly option for memory limit
@ 2017-04-28 11:01 Simon Crowe
  2017-04-28 12:25 ` Jan Beulich
  0 siblings, 1 reply; 5+ messages in thread
From: Simon Crowe @ 2017-04-28 11:01 UTC (permalink / raw)
  To: xen-devel@lists.xenproject.org, Andrew Cooper


[-- Attachment #1.1: Type: text/plain, Size: 4235 bytes --]

>From 0f61898acaeb2b34ee8156ebd40bb82fef28ff5f Mon Sep 17 00:00:00 2001
From: Simon Crowe <Simon.Crowe@citrix.com>
Date: Fri, 28 Apr 2017 10:46:43 +0000
Subject: [PATCH] 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>
---
 docs/misc/kexec_and_kdump.txt       |  8 +++++++-
 docs/misc/xen-command-line.markdown |  5 +++++
 xen/common/kexec.c                  | 10 ++++++++--
 3 files changed, 20 insertions(+), 3 deletions(-)

diff --git a/docs/misc/kexec_and_kdump.txt b/docs/misc/kexec_and_kdump.txt
index 2f93771..0842b3d 100644
--- a/docs/misc/kexec_and_kdump.txt
+++ b/docs/misc/kexec_and_kdump.txt
@@ -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.
diff --git a/docs/misc/xen-command-line.markdown b/docs/misc/xen-command-line.markdown
index 450b222..9473245 100644
--- a/docs/misc/xen-command-line.markdown
+++ b/docs/misc/xen-command-line.markdown
@@ -474,6 +474,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
@@ -485,6 +486,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>`

diff --git a/xen/common/kexec.c b/xen/common/kexec.c
index fbca8a6..a52c30b 100644
--- a/xen/common/kexec.c
+++ b/xen/common/kexec.c
@@ -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);
     }
--
2.7.4

?


[-- Attachment #1.2: Type: text/html, Size: 7138 bytes --]

[-- Attachment #2: Type: text/plain, Size: 127 bytes --]

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

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

* Re: [PATCH] kexec: Provide user friendly option for memory limit
  2017-04-28 11:01 Simon Crowe
@ 2017-04-28 12:25 ` Jan Beulich
  0 siblings, 0 replies; 5+ messages in thread
From: Jan Beulich @ 2017-04-28 12:25 UTC (permalink / raw)
  To: Simon Crowe; +Cc: AndrewCooper, xen-devel@lists.xenproject.org

>>> On 28.04.17 at 13:01, <simon.crowe@citrix.com> wrote:
> From 0f61898acaeb2b34ee8156ebd40bb82fef28ff5f Mon Sep 17 00:00:00 2001
> From: Simon Crowe <Simon.Crowe@citrix.com>
> Date: Fri, 28 Apr 2017 10:46:43 +0000
> Subject: [PATCH] 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>



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

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

end of thread, other threads:[~2017-04-28 12:25 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-04-27 12:22 [PATCH] kexec: Provide user friendly option for memory limit Simon Crowe
2017-04-28 10:37 ` Jan Beulich
2017-04-28 10:39   ` Simon Crowe
  -- strict thread matches above, loose matches on Subject: below --
2017-04-28 11:01 Simon Crowe
2017-04-28 12:25 ` Jan Beulich

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).