From mboxrd@z Thu Jan 1 00:00:00 1970 From: Simon Crowe Subject: [PATCH] kexec: Provide user friendly option for memory limit Date: Fri, 28 Apr 2017 11:01:36 +0000 Message-ID: <1493377298491.38825@citrix.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============1919861041255223425==" Return-path: Received: from mail6.bemta6.messagelabs.com ([193.109.254.103]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1d43ec-0004Kz-Ow for xen-devel@lists.xenproject.org; Fri, 28 Apr 2017 11:01:38 +0000 Content-Language: en-US List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xen.org Sender: "Xen-devel" To: "xen-devel@lists.xenproject.org" , Andrew Cooper List-Id: xen-devel@lists.xenproject.org --===============1919861041255223425== Content-Language: en-US Content-Type: multipart/alternative; boundary="_000_149337729849138825citrixcom_" --_000_149337729849138825citrixcom_ Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable >>From 0f61898acaeb2b34ee8156ebd40bb82fef28ff5f Mon Sep 17 00:00:00 2001 From: Simon Crowe 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 --- 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 t= wo forms: e.g. crashkernel=3D128M@256M - Regardless of which of the two forms of the crashkernel command line yo= u + iii) crashkernel=3Dsize,below=3Doffset + + 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 l= arge. diff --git a/docs/misc/xen-command-line.markdown b/docs/misc/xen-command-li= ne.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 optio= n. ### crashkernel > `=3D :[,...][{@,<}]` > `=3D [{@,<}]` +> `=3D ,below=3Doffset` Specify sizes and optionally placement of the crash kernel reservation area. The `:` pairs indicate how much memory to @@ -485,6 +486,10 @@ A trailing `@` specifies the exact address thi= s 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 > `=3D ` 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 =3D NULL, *crash_heap_end= =3D NULL; /* * Parse command lines in the format * - * crashkernel=3D:[,...][{@,<}
] + * crashkernel=3D:[,...][{@,<,below=3D}
] * * with being of form * @@ -97,6 +97,10 @@ static void *crash_heap_current =3D NULL, *crash_heap_en= d =3D NULL; * as well as the legacy ones in the format * * crashkernel=3D[{@,<}
] + * crashkernel=3D,below=3Daddress + * + * < 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 =3D NULL; - str =3D strpbrk(str, "@<"); + str =3D strpbrk(str, "@,<"); break; } @@ -162,6 +166,8 @@ static void __init parse_crashkernel(const char *str) kexec_crash_area.start =3D parse_size_and_unit(cur =3D str + 1= , &str); else if ( *str =3D=3D '<' ) kexec_crash_area_limit =3D parse_size_and_unit(cur =3D str + 1= , &str); + else if ( !strncmp(str, ",below=3D", 7) ) + kexec_crash_area_limit =3D parse_size_and_unit(cur =3D str + 7= , &str); else printk(XENLOG_WARNING "crashkernel: '%s' ignored\n", str); } -- 2.7.4 ? --_000_149337729849138825citrixcom_ Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable

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<= /div>

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 = 3;++++++-
 docs/misc/xen-command-line.markdown |  5 +++= 3;+
 xen/common/kexec.c             &nb= sp;    | 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=3D128M@256M
 
-   Regardless of which of the two forms of the crashkernel comma= nd line you
+  iii) crashkernel=3Dsize,below=3Doffset
+
+      This allows us to place the crash kernel wit= hin the usuable address
+      space without having to worry about a specif= ic phyiscal address.
+      The '<' and 'below' options are  syn= onymous
+
+   Regardless of which of the forms of the crashkernel comma= nd line you
    use, the crash kernel region should appear in /proc/iome= m 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 beca= use it is too large.
diff --git a/docs/misc/xen-command-line.markdown b/docs/misc/xen-comma= nd-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 l= ine option.
 ### crashkernel
 > `=3D <ramsize-range>:<size>[,...][{@,<}<o= ffset>]`
 > `=3D <size>[{@,<}<offset>]`
+> `=3D <size>,below=3Doffset`
 
 Specify sizes and optionally placement of the crash kernel reser= vation
 area.  The `<ramsize-range>:<size>` pairs indic= ate how much memory to
@@ -485,6 +486,10 @@ A trailing `@<offset>` specifies the ex= act address this area should be
 placed at, whereas `<` in place of `@` just specifies an uppe= r 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
 > `=3D <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 =3D NULL, *crash= _heap_end =3D NULL;
 /*
  * Parse command lines in the format
  *
- *   crashkernel=3D<ramsize-range>:<size>[,...][{@,&= lt;}<address>]
+ *   crashkernel=3D<ramsize-range>:<size>[,...][= {@,<,below=3D}<address>]
  *
  * with <ramsize-range> being of form
  *
@@ -97,6 +97,10 @@ static void *crash_heap_current =3D NULL, *cras= h_heap_end =3D NULL;
  * as well as the legacy ones in the format
  *
  *   crashkernel=3D<size>[{@,<}<address>]
+ *   crashkernel=3D<size>,below=3Daddress
+ *
+ * < and below are synonyomous, the latter being useful for gr= ub2 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 cha= r *str)
             {
                 printk(X= ENLOG_WARNING "crashkernel: too many ranges\n");
                 cur =3D = NULL;
-                str =3D strpb= rk(str, "@<");
+                str =3D s= trpbrk(str, "@,<");
                 break;
             }
 
@@ -162,6 +166,8 @@ static void __init parse_crashkernel(const cha= r *str)
             kexec_crash_area.start= =3D parse_size_and_unit(cur =3D str + 1, &str);
         else if ( *str =3D=3D '<' )
             kexec_crash_area_limit= =3D parse_size_and_unit(cur =3D str + 1, &str);
+        else if ( !strncmp(str, ",below= =3D", 7) )
+            kexec_crash_area_limit = =3D parse_size_and_unit(cur =3D str + 7, &str);
         else
             printk(XENLOG_WARNING = "crashkernel: '%s' ignored\n", str);
     }
-- 
2.7.4



--_000_149337729849138825citrixcom_-- --===============1919861041255223425== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: inline X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18KWGVuLWRldmVs IG1haWxpbmcgbGlzdApYZW4tZGV2ZWxAbGlzdHMueGVuLm9yZwpodHRwczovL2xpc3RzLnhlbi5v cmcveGVuLWRldmVsCg== --===============1919861041255223425==--