From: Thomas Renninger <trenn@suse.de>
To: hpa@zytor.com
Cc: yinghai@kernel.org, x86@kernel.org, linux-kernel@vger.kernel.org,
kexec@lists.infradead.org, vgoyal@redhat.com, horms@verge.net.au,
Thomas Renninger <trenn@suse.de>
Subject: [PATCH 2/2] x86 e820: Introduce memmap=resetusablemap for kdump usage
Date: Tue, 22 Jan 2013 16:20:49 +0100 [thread overview]
Message-ID: <1358868049-19884-3-git-send-email-trenn@suse.de> (raw)
In-Reply-To: <1358868049-19884-1-git-send-email-trenn@suse.de>
From: Yinghai Lu <yinghai@kernel.org>
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=resetusablemap gets introduced.
kdump passes this one and only the usable e820 ranges are removed.
kdump passes the usable ranges to use via memmap=x@y parameter(s).
The not usable e820 ranges are preserved.
This for example 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.
Tested-by: Thomas Renninger <trenn@suse.de>
Reviewed-by: Thomas Renninger <trenn@suse.de>
Signed-off-by: Thomas Renninger <trenn@suse.de>
---
Documentation/kernel-parameters.txt | 9 +++++++++
arch/x86/kernel/e820.c | 13 +++++++++++--
2 files changed, 20 insertions(+), 2 deletions(-)
diff --git a/Documentation/kernel-parameters.txt b/Documentation/kernel-parameters.txt
index 9776f06..fe2f677 100644
--- a/Documentation/kernel-parameters.txt
+++ b/Documentation/kernel-parameters.txt
@@ -1498,6 +1498,15 @@ bytes respectively. Such letter suffixes can also be entirely omitted.
BIOS output or other requirements. See the memmap=nn@ss
option description.
+ memmap=resetusablemap
+ [KNL,X86] Similar to exactmap, but instead of discarding
+ the whole original e820 map, only the usable memory
+ areas are ignored.
+ Those must be passed via memmap=X@Y parameters,
+ reserved, ACPI and ACPI NVS areas are preserved.
+ This boot parameter is intended for kdump usage.
+ Also passing exactmap overrules resetusablemap.
+
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 dc0b9f0..4e0ef9d 100644
--- a/arch/x86/kernel/e820.c
+++ b/arch/x86/kernel/e820.c
@@ -845,7 +845,7 @@ static int __init parse_memmap_one(char *p)
if (!p)
return -EINVAL;
- if (!strncmp(p, "exactmap", 8)) {
+ if (!strncmp(p, "exactmap", 8) || !strncmp(p, "resetusablemap", 14)) {
if (exactmap_parsed)
return 0;
@@ -858,7 +858,11 @@ static int __init parse_memmap_one(char *p)
*/
saved_max_pfn = e820_end_of_ram_pfn();
#endif
- e820.nr_map = 0;
+ if (!strncmp(p, "resetusablemap", 14)) {
+ /* remove all old E820_RAM ranges */
+ e820_remove_range(0, ULLONG_MAX, E820_RAM, 1);
+ } else
+ e820.nr_map = 0;
userdef = 1;
return 0;
}
@@ -890,6 +894,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, "resetusablemap");
+ if (p)
+ parse_memmap_one("resetusablemap");
+ }
while (str) {
char *k = strchr(str, ',');
--
1.7.6.1
next prev parent reply other threads:[~2013-01-22 15:21 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-01-22 15:20 [PATCH 0/2] Only parse exactmap once, introduce memmap=resetusablemap Thomas Renninger
2013-01-22 15:20 ` [PATCH 1/2] x86 e820: Check for exactmap appearance when parsing first memmap option Thomas Renninger
2013-01-22 19:33 ` Yinghai Lu
2013-01-29 1:09 ` H. Peter Anvin
2013-01-29 2:01 ` Yinghai Lu
2013-01-22 15:20 ` Thomas Renninger [this message]
2013-01-22 15:54 ` [PATCH 2/2] x86 e820: Introduce memmap=resetusablemap for kdump usage H. Peter Anvin
2013-01-22 16:23 ` Thomas Renninger
2013-01-22 16:32 ` H. Peter Anvin
2013-01-22 20:06 ` Yinghai Lu
2013-01-24 4:07 ` Yinghai Lu
2013-01-29 1:05 ` Thomas Renninger
2013-01-29 1:11 ` H. Peter Anvin
2013-01-29 2:10 ` Yinghai Lu
2013-01-29 2:11 ` H. Peter Anvin
2013-01-29 2:19 ` Yinghai Lu
2013-01-29 2:20 ` H. Peter Anvin
2013-01-29 2:27 ` H. Peter Anvin
2013-01-29 2:31 ` Yinghai Lu
2013-01-29 3:33 ` H. Peter Anvin
2013-01-29 9:47 ` 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=1358868049-19884-3-git-send-email-trenn@suse.de \
--to=trenn@suse.de \
--cc=horms@verge.net.au \
--cc=hpa@zytor.com \
--cc=kexec@lists.infradead.org \
--cc=linux-kernel@vger.kernel.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
all inboxes | Powered by JetHome®