memory/x86_64: fix linux safe_kernel_map

init_linux_kernel_mapping is called in setup_x86_phase1 way
before arguments are setup, but we can access kernel boot args
directly and use that, so ugly fix for now.

Change-Id: I285ecc31c6646d6d18566d411b09ae3190e8101e
Refs: #1228
This commit is contained in:
Dominique Martinet
2018-12-04 18:11:33 +09:00
committed by Masamichi Takagi
parent bbc39480d2
commit 52cd57fed2
2 changed files with 3 additions and 10 deletions

View File

@ -39,8 +39,6 @@ extern char _head[], _end[];
extern unsigned long x86_kernel_phys_base;
int safe_kernel_map = 0;
/* Arch specific early allocation routine */
void *early_alloc_pages(int nr_pages)
{
@ -2543,6 +2541,8 @@ static void init_normal_area(struct page_table *pt)
}
}
extern char *find_command_line(char *name);
static void init_linux_kernel_mapping(struct page_table *pt)
{
unsigned long map_start, map_end, phys;
@ -2552,7 +2552,7 @@ static void init_linux_kernel_mapping(struct page_table *pt)
/* In case of safe_kernel_map option (safe_kernel_map == 1),
* processing to prevent destruction of the memory area on Linux side
* is executed */
if (safe_kernel_map == 0) {
if (find_command_line("safe_kernel_map") == NULL) {
kprintf("Straight-map entire physical memory\n");
/* Map 2 TB for now */

View File

@ -130,8 +130,6 @@ char *find_command_line(char *name)
return strstr(cmdline, name);
}
extern int safe_kernel_map;
static void parse_kargs(void)
{
char *ptr;
@ -152,11 +150,6 @@ static void parse_kargs(void)
}
ihk_mc_set_dump_level(dump_level);
ptr = find_command_line("safe_kernel_map");
if (ptr) {
safe_kernel_map = 1;
}
/* idle_halt option */
ptr = find_command_line("idle_halt");
if (ptr) {