Kexec Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Daniel Kiper <daniel.kiper@oracle.com>
To: kexec@lists.infradead.org, linux-kernel@vger.kernel.org,
	xen-devel@lists.xenproject.org
Cc: andrew.cooper3@citrix.com, horms@verge.net.au, keir@xen.org,
	david.vrabel@citrix.com, konrad.wilk@oracle.com
Subject: [PATCH 14/14] kexec: Add option to get crash kernel region size
Date: Tue,  8 Dec 2015 22:57:47 +0100	[thread overview]
Message-ID: <1449611867-15672-15-git-send-email-daniel.kiper@oracle.com> (raw)
In-Reply-To: <1449611867-15672-1-git-send-email-daniel.kiper@oracle.com>

Here print_crashkernel_region_size() function is available on all archs (even
if the functionality is not implemented on some). So, we can safely use it in
arch independent code and export the functionality to the user space.

Signed-off-by: Daniel Kiper <daniel.kiper@oracle.com>
---
 kexec/kexec.8 |    3 +++
 kexec/kexec.c |    4 ++++
 kexec/kexec.h |    5 ++++-
 3 files changed, 11 insertions(+), 1 deletion(-)

diff --git a/kexec/kexec.8 b/kexec/kexec.8
index 4d0c1d1..e65345e 100644
--- a/kexec/kexec.8
+++ b/kexec/kexec.8
@@ -173,6 +173,9 @@ Load a helper image to jump back to original kernel.
 .TP
 .BI \-\-reuseinitrd
 Reuse initrd from first boot.
+.TP
+.BI \-\-print-ckr-size
+Print crash kernel region size. -1 means that this functionality is not implemented.
 
 
 .SH SUPPORTED KERNEL FILE TYPES AND OPTIONS
diff --git a/kexec/kexec.c b/kexec/kexec.c
index 20dd93d..a27f596 100644
--- a/kexec/kexec.c
+++ b/kexec/kexec.c
@@ -960,6 +960,7 @@ void usage(void)
 	       "     --mem-max=<addr> Specify the highest memory address to\n"
 	       "                      load code into.\n"
 	       "     --reuseinitrd    Reuse initrd from first boot.\n"
+	       "     --print-ckr-size Print crash kernel region size.\n"
 	       "     --load-preserve-context Load the new kernel and preserve\n"
 	       "                      context of current kernel during kexec.\n"
 	       "     --load-jump-back-helper Load a helper image to jump back\n"
@@ -1345,6 +1346,9 @@ int main(int argc, char *argv[])
 		case OPT_KEXEC_FILE_SYSCALL:
 			/* We already parsed it. Nothing to do. */
 			break;
+		case OPT_PRINT_CKR_SIZE:
+			print_crashkernel_region_size();
+			return 0;
 		default:
 			break;
 		}
diff --git a/kexec/kexec.h b/kexec/kexec.h
index c02ac8f..42a602d 100644
--- a/kexec/kexec.h
+++ b/kexec/kexec.h
@@ -224,7 +224,8 @@ extern int file_types;
 #define OPT_LOAD_PRESERVE_CONTEXT 259
 #define OPT_LOAD_JUMP_BACK_HELPER 260
 #define OPT_ENTRY		261
-#define OPT_MAX			262
+#define OPT_PRINT_CKR_SIZE	262
+#define OPT_MAX			263
 #define KEXEC_OPTIONS \
 	{ "help",		0, 0, OPT_HELP }, \
 	{ "version",		0, 0, OPT_VERSION }, \
@@ -244,6 +245,7 @@ extern int file_types;
 	{ "reuseinitrd",	0, 0, OPT_REUSE_INITRD }, \
 	{ "kexec-file-syscall",	0, 0, OPT_KEXEC_FILE_SYSCALL }, \
 	{ "debug",		0, 0, OPT_DEBUG }, \
+	{ "print-ckr-size",	0, 0, OPT_PRINT_CKR_SIZE }, \
 
 #define KEXEC_OPT_STR "h?vdfxyluet:ps"
 
@@ -290,6 +292,7 @@ int arch_compat_trampoline(struct kexec_info *info);
 void arch_update_purgatory(struct kexec_info *info);
 int is_crashkernel_mem_reserved(void);
 int get_crash_kernel_load_range(uint64_t *start, uint64_t *end);
+void print_crashkernel_region_size(void);
 char *get_command_line(void);
 
 int kexec_iomem_for_each_line(char *match,
-- 
1.7.10.4


_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec

      parent reply	other threads:[~2015-12-08 21:59 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-12-08 21:57 [PATCH 00/14] kexec: Add option to get crash kernel region size Daniel Kiper
2015-12-08 21:57 ` [PATCH 01/14] purgatory: Add purgatory.map and purgatory.ro.sym to clean recipe Daniel Kiper
2015-12-08 21:57 ` [PATCH 02/14] kexec: Remove redundant space from help message Daniel Kiper
2015-12-08 21:57 ` [PATCH 03/14] crashdump: Remove stray get_crashkernel_region() declaration Daniel Kiper
2015-12-08 21:57 ` [PATCH 04/14] crashdump/x86: Add print_crashkernel_region_size() function Daniel Kiper
2015-12-08 21:57 ` [PATCH 05/14] crashdump/arm: " Daniel Kiper
2015-12-08 21:57 ` [PATCH 06/14] crashdump/cris: " Daniel Kiper
2015-12-09  2:55   ` Dave Young
2015-12-08 21:57 ` [PATCH 07/14] crashdump/ia64: " Daniel Kiper
2015-12-08 21:57 ` [PATCH 08/14] crashdump/m68k: " Daniel Kiper
2015-12-08 21:57 ` [PATCH 09/14] crashdump/mips: " Daniel Kiper
2015-12-08 21:57 ` [PATCH 10/14] crashdump/ppc: " Daniel Kiper
2015-12-09  2:51   ` Dave Young
2015-12-08 21:57 ` [PATCH 11/14] crashdump/ppc64: " Daniel Kiper
2015-12-09  2:52   ` Dave Young
2015-12-08 21:57 ` [PATCH 12/14] crashdump/s390: " Daniel Kiper
2015-12-08 21:57 ` [PATCH 13/14] crashdump/sh: " Daniel Kiper
2015-12-08 21:57 ` Daniel Kiper [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1449611867-15672-15-git-send-email-daniel.kiper@oracle.com \
    --to=daniel.kiper@oracle.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=david.vrabel@citrix.com \
    --cc=horms@verge.net.au \
    --cc=keir@xen.org \
    --cc=kexec@lists.infradead.org \
    --cc=konrad.wilk@oracle.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=xen-devel@lists.xenproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox