From: Thomas Renninger <trenn@suse.de>
To: "H. Peter Anvin" <hpa@zytor.com>
Cc: yinghai@kernel.org, Simon Horman <horms@verge.net.au>,
kexec@lists.infradead.org, x86@kernel.org, vgoyal@redhat.com
Subject: [PATCH 3/3] x86 e820: Introduce memmap=kdump_reserve_usable for kdump usage
Date: Wed, 30 Jan 2013 17:10:27 +0100 [thread overview]
Message-ID: <201301301710.27822.trenn@suse.de> (raw)
In-Reply-To: <201301301703.42601.trenn@suse.de>
kdump voided the whole original e820 map and half way made
it up via memmap= options passed via kdump boot params again.
But this is conceptionally wrong. The whole original memory ranges
which are declared reserved, ACPI data/nvs or however are not usable
must stay the same and get honored by the kdump kernel.
Therefore memmap=kdump_reserve_usable gets introduced.
kdump passes this one and originally usable memory gets converted
by the kernel to the Linux kernel specific kdump reserved e820 type.
kdump passes the usable memory ranges where the kdump kernel resides
in via memmap=x@y parameter(s).
This preserves all e820 information and the kdump kernel can look
it up and be sure it is valid.
It also cleans up unnecessary memmap= boot parameter passing of
reserved memory areas via kexec-tools. This information is already
passed via boot structures.
This also fixes mmconf (extended PCI config access) and
possibly other kernel parts which rely on remapped memory to be
in reserved or ACPI (data/nvs) declared e820 memory areas.
Signed-off-by: Thomas Renninger <trenn@suse.de>
---
Documentation/kernel-parameters.txt | 9 +++++++++
arch/x86/kernel/e820.c | 22 ++++++++++++++++++++--
2 files changed, 29 insertions(+), 2 deletions(-)
diff --git a/Documentation/kernel-parameters.txt b/Documentation/kernel-parameters.txt
index da0e077..f38375a 100644
--- a/Documentation/kernel-parameters.txt
+++ b/Documentation/kernel-parameters.txt
@@ -1518,6 +1518,15 @@ bytes respectively. Such letter suffixes can also be entirely omitted.
BIOS output or other requirements. See the memmap=nn@ss
option description.
+ memmap=kdump_reserve_usable
+ [KNL,X86] Convert usable memory areas into a special
+ Linux kernel specific kdump reserved type.
+ Usable memory areas the kdump kernel resides in have
+ to be passed via memmap=X@Y parameters which overrides
+ these areas again to be usable.
+ This boot parameter is intended for kdump usage.
+ Passing exactmap overrules kdump_reserve_usable.
+
memmap=nn[KMG]@ss[KMG]
[KNL] Force usage of a specific region of memory
Region of memory to be used, from ss to ss+nn.
diff --git a/arch/x86/kernel/e820.c b/arch/x86/kernel/e820.c
index 7c6a72e..9c00bfa 100644
--- a/arch/x86/kernel/e820.c
+++ b/arch/x86/kernel/e820.c
@@ -839,6 +839,7 @@ static int __init parse_memopt(char *p)
early_param("mem", parse_memopt);
static bool __initdata exactmap_parsed;
+static bool __initdata kdump_res_parsed;
static int __init parse_memmap_one(char *p)
{
@@ -848,7 +849,8 @@ static int __init parse_memmap_one(char *p)
if (!p)
return -EINVAL;
- if (!strncmp(p, "exactmap", 8)) {
+ if (!strncmp(p, "exactmap", 8) ||
+ !strncmp(p, "kdump_reserve_usable", 20)) {
if (exactmap_parsed)
return 0;
@@ -861,7 +863,13 @@ static int __init parse_memmap_one(char *p)
*/
saved_max_pfn = e820_end_of_ram_pfn();
#endif
- e820.nr_map = 0;
+ if (!strncmp(p, "kdump_reserve_usable", 20)) {
+ /* remove all old E820_RAM ranges */
+ e820_update_range(0, ULLONG_MAX, E820_RAM,
+ E820_RESERVED_KDUMP);
+ kdump_res_parsed = true;
+ } else
+ e820.nr_map = 0;
userdef = 1;
return 0;
}
@@ -874,6 +882,11 @@ static int __init parse_memmap_one(char *p)
userdef = 1;
if (*p == '@') {
start_at = memparse(p+1, &p);
+ if (kdump_res_parsed) {
+ /* Remove old reserved so new ram could take over. */
+ e820_remove_range(start_at, mem_size,
+ E820_RESERVED_KDUMP, 0);
+ }
e820_add_region(start_at, mem_size, E820_RAM);
} else if (*p == '#') {
start_at = memparse(p+1, &p);
@@ -893,6 +906,11 @@ static int __init parse_memmap_opt(char *str)
p = strstr(p, "exactmap");
if (p)
parse_memmap_one("exactmap");
+ else {
+ p = strstr(boot_command_line, "kdump_reserve_usable");
+ if (p)
+ parse_memmap_one("kdump_reserve_usable");
+ }
while (str) {
char *k = strchr(str, ',');
_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec
next prev parent reply other threads:[~2013-01-30 16:10 UTC|newest]
Thread overview: 35+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-01-22 15:02 [PATCH 0/3] Make use of new memmap= kernel parameter syntax Thomas Renninger
2013-01-22 15:02 ` [PATCH 1/3] kexec: Split kernel_version() to also be able to pass a release string Thomas Renninger
2013-01-22 15:02 ` [PATCH 2/3] kexec x86: Extract kernel version and convert it to KERNEL_VERSION() style Thomas Renninger
2013-01-22 15:02 ` [PATCH 3/3] kexec x86: Make kexec aware of new memmap= kernel parameter possibilities Thomas Renninger
2013-01-30 4:31 ` [PATCH 0/3] Make use of new memmap= kernel parameter syntax Simon Horman
2013-01-30 5:40 ` H. Peter Anvin
2013-01-30 5:52 ` Simon Horman
2013-01-30 16:03 ` Thomas Renninger
2013-01-30 16:06 ` [PATCH 1/3] x86 e820: Check for exactmap appearance when parsing first memmap option Thomas Renninger
2013-01-30 16:09 ` H. Peter Anvin
2013-01-30 16:08 ` [PATCH 2/3] x86: Introduce Linux kernel specific E820_RESERVED_KDUMP e820 memory range type Thomas Renninger
2013-01-30 16:10 ` Thomas Renninger [this message]
2013-01-30 16:10 ` [PATCH 0/3] Make use of new memmap= kernel parameter syntax H. Peter Anvin
2013-01-30 16:13 ` [PATCH 0/3] Cleanup kdump memmap= passing and e820 usage Thomas Renninger
2013-01-30 16:16 ` H. Peter Anvin
2013-01-30 16:39 ` Thomas Renninger
2013-01-30 16:52 ` H. Peter Anvin
2013-01-30 17:41 ` Yinghai Lu
2013-01-30 18:52 ` Eric W. Biederman
2013-01-30 21:38 ` H. Peter Anvin
2013-01-30 21:57 ` Eric W. Biederman
2013-01-30 22:10 ` H. Peter Anvin
2013-01-30 22:29 ` Eric W. Biederman
2013-01-30 22:41 ` H. Peter Anvin
2013-01-30 22:49 ` Yinghai Lu
2013-01-31 0:15 ` Thomas Renninger
2013-01-31 0:18 ` H. Peter Anvin
2013-01-31 9:11 ` Thomas Renninger
2013-02-06 15:23 ` Thomas Renninger
2013-02-06 23:04 ` Eric W. Biederman
2013-02-06 23:11 ` H. Peter Anvin
2013-02-06 23:39 ` Eric W. Biederman
2013-02-08 20:08 ` Thomas Renninger
2013-02-08 20:25 ` Eric W. Biederman
2013-02-08 20:56 ` Thomas Renninger
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=201301301710.27822.trenn@suse.de \
--to=trenn@suse.de \
--cc=horms@verge.net.au \
--cc=hpa@zytor.com \
--cc=kexec@lists.infradead.org \
--cc=vgoyal@redhat.com \
--cc=x86@kernel.org \
--cc=yinghai@kernel.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