From patchwork Thu Jul 27 12:00:50 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Crowe X-Patchwork-Id: 9866677 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 1C34C60382 for ; Thu, 27 Jul 2017 12:03:36 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0E80B2837D for ; Thu, 27 Jul 2017 12:03:36 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 03160287FE; Thu, 27 Jul 2017 12:03:36 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 6100B2837D for ; Thu, 27 Jul 2017 12:03:35 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dahTf-00059u-R0; Thu, 27 Jul 2017 12:01:15 +0000 Received: from mail6.bemta6.messagelabs.com ([193.109.254.103]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dahTe-00059k-HE for xen-devel@lists.xenproject.org; Thu, 27 Jul 2017 12:01:14 +0000 Received: from [85.158.143.35] by server-6.bemta-6.messagelabs.com id 64/33-03937-906D9795; Thu, 27 Jul 2017 12:01:13 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFvrPLMWRWlGSWpSXmKPExsXitHSDvS7ntcp Ig1UvhSy+b5nM5MDocfjDFZYAxijWzLyk/IoE1ozpEy6wF8yRqbj4YRtjA+MKsS5GTg4JAX+J +Re3MoPYbAJaEg/7rrGC2CIC4RK9m2+wgNjMAhoSMw5OBasRBqo/eH0iG4jNIqAq8frVbTCbV 8BNonlaLxvETDmJm+c6weqFBJQltkz+wARRIyhxcuYTqJkSEgdfvGCewMg9C0lqFpLUAkamVY waxalFZalFuoZGeklFmekZJbmJmTm6hgZmermpxcWJ6ak5iUnFesn5uZsYgcHAAAQ7GC9vDDj EKMnBpCTKO8m0IlKILyk/pTIjsTgjvqg0J7X4EKMMB4eSBK/+1cpIIcGi1PTUirTMHGBYwqQl OHiURHiDQNK8xQWJucWZ6RCpU4zGHK8m/P/GxNH0/eN3JiGWvPy8VClx3h9XgEoFQEozSvPgB sHi5RKjrJQwLyPQaUI8BalFuZklqPKvGMU5GJWEeZ+DTOHJzCuB2/cK6BQmoFMmNoGdUpKIkJ JqYOQKly+4nRd4JMHMquZp7zSBExpNkffFds9z1iieUfHJTlmax2RSV/HZpTtUFjNk3FKx8pd TD/hTsieY+7y6p7B4G2tDSOK7w7KOMZ5ObfP31utsfPKx6ePpL1nWPE3MoXMjQ2s2qGtU+i0K SIuYMetLxaWqVQL/eypCF/dfOVHaWc3ruOGtEktxRqKhFnNRcSIASVLHX5ICAAA= X-Env-Sender: prvs=3742cbc3a=simon.crowe@citrix.com X-Msg-Ref: server-16.tower-21.messagelabs.com!1501156871!63255219!1 X-Originating-IP: [66.165.176.63] X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni42MyA9PiAzMDYwNDg=\n, received_headers: No Received headers X-StarScan-Received: X-StarScan-Version: 9.4.25; banners=-,-,- X-VirusChecked: Checked Received: (qmail 8310 invoked from network); 27 Jul 2017 12:01:13 -0000 Received: from smtp02.citrix.com (HELO SMTP02.CITRIX.COM) (66.165.176.63) by server-16.tower-21.messagelabs.com with RC4-SHA encrypted SMTP; 27 Jul 2017 12:01:13 -0000 X-IronPort-AV: E=Sophos;i="5.40,419,1496102400"; d="scan'208";a="441555360" From: Simon Crowe To: , , Date: Thu, 27 Jul 2017 12:00:50 +0000 Message-ID: <1501156850-14083-1-git-send-email-Simon.Crowe@citrix.com> X-Mailer: git-send-email 2.7.4 MIME-Version: 1.0 Cc: Simon Crowe Subject: [Xen-devel] [PATCH] kexec: Provide a user friendly option for memory address limit X-BeenThere: xen-devel@lists.xen.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xen.org Sender: "Xen-devel" X-Virus-Scanned: ClamAV using ClamSMTP grub2 requires that the '<' character be escaped which is inconvienet for users, provide a more natural specifier. An example crashkernel argument may be crashkernel=256M,below=4G Signed-off-by: Simon Crowe --- docs/misc/kexec_and_kdump.txt | 8 +++++++- docs/misc/xen-command-line.markdown | 1 + xen/common/kexec.c | 12 ++++++++++-- 3 files changed, 18 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 44d9985..d99cb63 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 > `= :[,...][{@,<}]` > `= [{@,<}]` +> `= ,below=offset>]` Specify sizes and optionally placement of the crash kernel reservation area. The `:` pairs indicate how much memory to diff --git a/xen/common/kexec.c b/xen/common/kexec.c index fbca8a6..b59f5e9 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=:[,...][{@,<}
] + * crashkernel=:[,...][{@,<,below=}
] * * with 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=[{@,<}
] + * crashkernel=,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); }