vm load: add SOS cmdline option for hugetlb

adding "hugepagesz=1G" and "hugepages=X" into SOS cmdline, for X, current
strategy is making it equal
	e820_mem.total_mem_size -CONFIG_REMAIN_1G_PAGES
if CONFIG_REMAIN_1G_PAGES is not set, it will use 3 by default.

CONFIG_CMA is added to indicate using cma cmdline option for SOS kernel,
by default system will use hugetlb cmdline option if no CONFIG_CMA defined.

Signed-off-by: Jason Chen CJ <jason.cj.chen@intel.com>
Acked-by: Xu, Anthony <anthony.xu@intel.com>
This commit is contained in:
Jason Chen CJ
2018-04-13 09:54:06 +08:00
committed by Jack Ren
parent 71ee5ef6c8
commit a1c6c24248
4 changed files with 39 additions and 5 deletions

View File

@@ -196,6 +196,7 @@ void obtain_e820_mem_info(void)
e820_mem.mem_bottom = UINT64_MAX;
e820_mem.mem_top = 0x00;
e820_mem.total_mem_size = 0;
e820_mem.max_ram_blk_base = 0;
e820_mem.max_ram_blk_size = 0;
@@ -210,11 +211,13 @@ void obtain_e820_mem_info(void)
+ entry->length;
}
if (entry->baseaddr == UOS_DEFAULT_START_ADDR
&& entry->type == E820_TYPE_RAM) {
e820_mem.max_ram_blk_base =
entry->baseaddr;
e820_mem.max_ram_blk_size = entry->length;
if (entry->type == E820_TYPE_RAM) {
e820_mem.total_mem_size += entry->length;
if (entry->baseaddr == UOS_DEFAULT_START_ADDR) {
e820_mem.max_ram_blk_base =
entry->baseaddr;
e820_mem.max_ram_blk_size = entry->length;
}
}
}
}
@@ -282,7 +285,9 @@ static void rebuild_vm0_e820(void)
entry->type = new_entry.type;
}
e820_mem.total_mem_size -= CONFIG_RAM_SIZE;
}
int prepare_vm0_memmap_and_e820(struct vm *vm)
{
unsigned int i;