mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2025-09-22 01:07:57 +00:00
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:
@@ -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;
|
||||
|
Reference in New Issue
Block a user