x86: e820: user-defined memory maps: remove the range instead of update it to reserved
also let mem= to print out modified e820 map too Signed-off-by: Yinghai Lu <yhlu.kernel@gmail.com> Cc: Bernhard Walle <bwalle@suse.de> Signed-off-by: Ingo Molnar <mingo@elte.hu>
This commit is contained in:
parent
27cb0a75ba
commit
69a7704d7a
1 changed files with 5 additions and 6 deletions
|
@ -1165,6 +1165,8 @@ static void early_panic(char *msg)
|
||||||
panic(msg);
|
panic(msg);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static int userdef __initdata;
|
||||||
|
|
||||||
/* "mem=nopentium" disables the 4MB page tables. */
|
/* "mem=nopentium" disables the 4MB page tables. */
|
||||||
static int __init parse_memopt(char *p)
|
static int __init parse_memopt(char *p)
|
||||||
{
|
{
|
||||||
|
@ -1180,17 +1182,15 @@ static int __init parse_memopt(char *p)
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
userdef = 1;
|
||||||
mem_size = memparse(p, &p);
|
mem_size = memparse(p, &p);
|
||||||
end_user_pfn = mem_size>>PAGE_SHIFT;
|
end_user_pfn = mem_size>>PAGE_SHIFT;
|
||||||
e820_update_range(mem_size, ULLONG_MAX - mem_size,
|
e820_remove_range(mem_size, ULLONG_MAX - mem_size, E820_RAM, 1);
|
||||||
E820_RAM, E820_RESERVED);
|
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
early_param("mem", parse_memopt);
|
early_param("mem", parse_memopt);
|
||||||
|
|
||||||
static int userdef __initdata;
|
|
||||||
|
|
||||||
static int __init parse_memmap_opt(char *p)
|
static int __init parse_memmap_opt(char *p)
|
||||||
{
|
{
|
||||||
char *oldp;
|
char *oldp;
|
||||||
|
@ -1230,8 +1230,7 @@ static int __init parse_memmap_opt(char *p)
|
||||||
e820_add_region(start_at, mem_size, E820_RESERVED);
|
e820_add_region(start_at, mem_size, E820_RESERVED);
|
||||||
} else {
|
} else {
|
||||||
end_user_pfn = (mem_size >> PAGE_SHIFT);
|
end_user_pfn = (mem_size >> PAGE_SHIFT);
|
||||||
e820_update_range(mem_size, ULLONG_MAX - mem_size,
|
e820_remove_range(mem_size, ULLONG_MAX - mem_size, E820_RAM, 1);
|
||||||
E820_RAM, E820_RESERVED);
|
|
||||||
}
|
}
|
||||||
return *p == '\0' ? 0 : -EINVAL;
|
return *p == '\0' ? 0 : -EINVAL;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue