lkml.org 
[lkml]   [2013]   [Jan]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 03/35] x86, mm: Introduce memmap=reserveram
Date
kdump voided the whole original e820 map with exactmap 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=reserveram gets introduced.
kdump passes this one and only the usable e820 ranges are updated to
reserved at first by kernel, then when kdump passes the usable ranges
to use via memmap=x@y parameter(s), kernel will remove reserved range
and add usable range accordingly.

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.

Changelog is from Thomas Renninger, and updated to reserveram

-v2: According to HPA, use reserveram instead of resetusablemap.

Signed-off-by: Yinghai Lu <yinghai@kernel.org>
---
arch/x86/kernel/e820.c | 19 +++++++++++++++++--
1 file changed, 17 insertions(+), 2 deletions(-)

diff --git a/arch/x86/kernel/e820.c b/arch/x86/kernel/e820.c
index dc0b9f0..503859c 100644
--- a/arch/x86/kernel/e820.c
+++ b/arch/x86/kernel/e820.c
@@ -836,6 +836,7 @@ static int __init parse_memopt(char *p)
early_param("mem", parse_memopt);

static bool __initdata exactmap_parsed;
+static bool __initdata reserveram_parsed;

static int __init parse_memmap_one(char *p)
{
@@ -845,7 +846,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, "reserveram", 10)) {
if (exactmap_parsed)
return 0;

@@ -858,7 +859,12 @@ static int __init parse_memmap_one(char *p)
*/
saved_max_pfn = e820_end_of_ram_pfn();
#endif
- e820.nr_map = 0;
+ if (!strncmp(p, "reserveram", 10)) {
+ e820_update_range(0, ULLONG_MAX, E820_RAM,
+ E820_RESERVED);
+ reserveram_parsed = true;
+ } else
+ e820.nr_map = 0;
userdef = 1;
return 0;
}
@@ -871,6 +877,10 @@ static int __init parse_memmap_one(char *p)
userdef = 1;
if (*p == '@') {
start_at = memparse(p+1, &p);
+ if (reserveram_parsed) {
+ /* Remove old reserved so new ram could take over. */
+ e820_remove_range(start_at, mem_size, E820_RESERVED, 0);
+ }
e820_add_region(start_at, mem_size, E820_RAM);
} else if (*p == '#') {
start_at = memparse(p+1, &p);
@@ -890,6 +900,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, "reserveram");
+ if (p)
+ parse_memmap_one("reserveram");
+ }

while (str) {
char *k = strchr(str, ',');
--
1.7.10.4


\
 
 \ /
  Last update: 2013-01-24 22:43    [W:0.333 / U:0.020 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site