From: Yinghai Lu <yinghai@kernel.org>
To: Simon Horman <horms@verge.net.au>,
"H. Peter Anvin" <hpa@zytor.com>, Vivek Goyal <vgoyal@redhat.com>,
Haren Myneni <hbabu@us.ibm.com>,
"Eric W. Biederman" <ebiederm@xmission.com>
Cc: Yinghai Lu <yinghai@kernel.org>, kexec@lists.infradead.org
Subject: [PATCH 3/8] add mem64_min/max control
Date: Fri, 16 Nov 2012 15:04:22 -0800 [thread overview]
Message-ID: <1353107067-14564-4-git-send-email-yinghai@kernel.org> (raw)
In-Reply-To: <1353107067-14564-1-git-send-email-yinghai@kernel.org>
So could limit range for 4g above buffers.
Signed-off-by: Yinghai Lu <yinghai@kernel.org>
---
kexec/kexec.c | 26 ++++++++++++++++++++++++++
kexec/kexec.h | 9 ++++++++-
2 files changed, 34 insertions(+), 1 deletions(-)
diff --git a/kexec/kexec.c b/kexec/kexec.c
index 8928be0..00f90f5 100644
--- a/kexec/kexec.c
+++ b/kexec/kexec.c
@@ -50,6 +50,8 @@
unsigned long long mem_min = 0;
unsigned long long mem_max = ULONG_MAX;
+unsigned long long mem64_min = 1ULL<32;
+unsigned long long mem64_max = ULLONG_MAX;
static unsigned long kexec_flags = 0;
int kexec_debug = 0;
@@ -900,6 +902,10 @@ void usage(void)
" load code into.\n"
" --mem-max=<addr> Specify the highest memory address to\n"
" load code into.\n"
+ " --mem64-min=<addr> Specify the lowest memory address \n"
+ " above 4G to load code into.\n"
+ " --mem64-max=<addr> Specify the highest memory address \n"
+ " above 4G to load code into.\n"
" --reuseinitrd Reuse initrd from first boot.\n"
" --load-preserve-context Load the new kernel and preserve\n"
" context of current kernel during kexec.\n"
@@ -1165,6 +1171,26 @@ int main(int argc, char *argv[])
return 1;
}
break;
+ case OPT_MEM64_MIN:
+ mem64_min = strtoul(optarg, &endptr, 0);
+ if (*endptr) {
+ fprintf(stderr,
+ "Bad option value in --mem64-min=%s\n",
+ optarg);
+ usage();
+ return 1;
+ }
+ break;
+ case OPT_MEM64_MAX:
+ mem64_max = strtoul(optarg, &endptr, 0);
+ if (*endptr) {
+ fprintf(stderr,
+ "Bad option value in --mem64-max=%s\n",
+ optarg);
+ usage();
+ return 1;
+ }
+ break;
case OPT_REUSE_INITRD:
do_reuse_initrd = 1;
break;
diff --git a/kexec/kexec.h b/kexec/kexec.h
index 35b0b10..2e0e5f2 100644
--- a/kexec/kexec.h
+++ b/kexec/kexec.h
@@ -113,6 +113,7 @@ do { \
_x > _y ? _x : _y; })
extern unsigned long long mem_min, mem_max;
+extern unsigned long long mem64_min, mem64_max;
extern int kexec_debug;
#define dbgprintf(...) \
@@ -211,7 +212,11 @@ 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_MEM64_MIN 262
+#define OPT_MEM64_MAX 263
+
+#define OPT_MAX 264
+
#define KEXEC_OPTIONS \
{ "help", 0, 0, OPT_HELP }, \
{ "version", 0, 0, OPT_VERSION }, \
@@ -227,6 +232,8 @@ extern int file_types;
{ "load-panic", 0, 0, OPT_PANIC }, \
{ "mem-min", 1, 0, OPT_MEM_MIN }, \
{ "mem-max", 1, 0, OPT_MEM_MAX }, \
+ { "mem64-min", 1, 0, OPT_MEM64_MIN }, \
+ { "mem64-max", 1, 0, OPT_MEM64_MAX }, \
{ "reuseinitrd", 0, 0, OPT_REUSE_INITRD }, \
{ "debug", 0, 0, OPT_DEBUG }, \
--
1.7.7
_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec
next prev parent reply other threads:[~2012-11-16 23:04 UTC|newest]
Thread overview: 60+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-11-16 23:04 [PATCH 0/8] kexec: put bzImage and ramdisk above 4G for x86 64bit Yinghai Lu
2012-11-16 23:04 ` [PATCH 1/8] Add min/max macro Yinghai Lu
2012-11-16 23:04 ` [PATCH 2/8] x86: add boot header member for version 2.12 Yinghai Lu
2012-11-16 23:04 ` Yinghai Lu [this message]
2012-11-17 6:18 ` [PATCH 3/8] add mem64_min/max control Eric W. Biederman
2012-11-17 7:06 ` Yinghai Lu
2012-11-17 8:25 ` Eric W. Biederman
2012-11-17 20:04 ` Yinghai Lu
2012-11-17 20:41 ` H. Peter Anvin
2012-11-17 20:51 ` Yinghai Lu
2012-11-17 20:54 ` H. Peter Anvin
2012-11-18 0:44 ` Yinghai Lu
2012-11-18 4:34 ` H. Peter Anvin
2012-11-18 4:47 ` Eric W. Biederman
2012-11-18 4:55 ` H. Peter Anvin
2012-11-18 5:00 ` Eric W. Biederman
2012-11-18 5:14 ` H. Peter Anvin
2012-11-18 4:56 ` Yinghai Lu
2012-11-18 5:20 ` Eric W. Biederman
2012-11-18 5:35 ` Yinghai Lu
2012-11-18 5:39 ` Yinghai Lu
2012-11-18 5:58 ` Yinghai Lu
2012-11-18 6:11 ` Eric W. Biederman
2012-11-18 6:32 ` Yinghai Lu
2012-11-18 6:38 ` Yinghai Lu
2012-11-18 6:50 ` Eric W. Biederman
2012-11-18 6:53 ` Yinghai Lu
2012-11-18 7:18 ` Yinghai Lu
2012-11-18 10:38 ` Eric W. Biederman
2012-11-19 3:02 ` [PATCH 0/6] kexec: put bzImage and ramdisk above 4G for x86 64bit Yinghai Lu
2012-11-19 3:02 ` [PATCH 1/6] kexec, x86: add boot header member for version 2.12 Yinghai Lu
2012-11-19 3:02 ` [PATCH 2/6] kexec: don't die during buffer finding Yinghai Lu
2012-11-19 3:02 ` [PATCH 3/6] kexec, x86: put ramdisk high for 64bit bzImage Yinghai Lu
2012-11-19 3:02 ` [PATCH 4/6] kexec, x86: set ext_cmd_line_ptr when boot_param is put high Yinghai Lu
2012-11-19 3:02 ` [PATCH 5/6] kexec, x86: Make x64_64 purgatory relocatable above 4G Yinghai Lu
2012-11-19 3:02 ` [PATCH 6/6] kexec, x86_64: put 64bit bzImage high Yinghai Lu
2012-11-19 3:04 ` [PATCH v2 0/6] kexec: put bzImage and ramdisk above 4G for x86 64bit Yinghai Lu
2012-11-19 3:04 ` [PATCH v2 1/6] kexec, x86: add boot header member for version 2.12 Yinghai Lu
2012-11-19 3:04 ` [PATCH v2 2/6] kexec: don't die during buffer finding Yinghai Lu
2012-11-19 17:05 ` Eric W. Biederman
2012-11-19 3:04 ` [PATCH v2 3/6] kexec, x86: put ramdisk high for 64bit bzImage Yinghai Lu
2012-11-19 17:20 ` Eric W. Biederman
2012-11-19 3:04 ` [PATCH v2 4/6] kexec, x86: set ext_cmd_line_ptr when boot_param is put high Yinghai Lu
2012-11-19 17:22 ` Eric W. Biederman
2012-11-19 3:04 ` [PATCH v2 5/6] kexec, x86: Make x64_64 purgatory relocatable above 4G Yinghai Lu
2012-11-19 3:04 ` [PATCH v2 6/6] kexec, x86_64: put 64bit bzImage high Yinghai Lu
2012-11-19 17:28 ` Eric W. Biederman
2012-11-19 17:04 ` [PATCH v2 0/6] kexec: put bzImage and ramdisk above 4G for x86 64bit Eric W. Biederman
2012-11-18 6:24 ` [PATCH 3/8] add mem64_min/max control H. Peter Anvin
2012-11-18 6:23 ` H. Peter Anvin
2012-11-18 6:44 ` Eric W. Biederman
2012-11-16 23:04 ` [PATCH 4/8] Move out mem_min/max checking in locate_hole Yinghai Lu
2012-11-16 23:04 ` [PATCH 5/8] seperate checking 64bit mem range Yinghai Lu
2012-11-16 23:04 ` [PATCH 6/8] debug print out for add_buf Yinghai Lu
2012-11-16 23:04 ` [PATCH 7/8] x86: put ramdisk high for 64bit bzImage Yinghai Lu
2012-11-16 23:04 ` [PATCH 8/8] x86: put 64bit bzImage high Yinghai Lu
2012-11-17 6:33 ` Eric W. Biederman
[not found] ` <CAE9FiQWJaT9yfdV0rgV-5rM=BR4eX8sr+a99g8Ggf-+YkD8qgQ@mail.gmail.com>
2012-11-17 8:43 ` Eric W. Biederman
2012-11-19 21:00 ` [PATCH 0/8] kexec: put bzImage and ramdisk above 4G for x86 64bit Vivek Goyal
2012-11-19 22:34 ` Yinghai Lu
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=1353107067-14564-4-git-send-email-yinghai@kernel.org \
--to=yinghai@kernel.org \
--cc=ebiederm@xmission.com \
--cc=hbabu@us.ibm.com \
--cc=horms@verge.net.au \
--cc=hpa@zytor.com \
--cc=kexec@lists.infradead.org \
--cc=vgoyal@redhat.com \
/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