HV: replace memory config with acrn_vm_mem_config

The member of mem_size and start_hpa in acrn_vm_config struct will
be replaced with the acrn_vm_mem_config struct;

Tracked-On: #2291

Signed-off-by: Victor Sun <victor.sun@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
This commit is contained in:
Victor Sun 2019-01-21 02:47:05 +08:00 committed by Eddie Dong
parent 253b25937b
commit 23f8e5e598
5 changed files with 10 additions and 12 deletions

View File

@ -174,7 +174,7 @@ int32_t create_vm(uint16_t vm_id, struct acrn_vm_config *vm_config, struct acrn_
&vm_config->GUID[0], sizeof(vm_config->GUID)); &vm_config->GUID[0], sizeof(vm_config->GUID));
#ifdef CONFIG_PARTITION_MODE #ifdef CONFIG_PARTITION_MODE
ept_mr_add(vm, (uint64_t *)vm->arch_vm.nworld_eptp, ept_mr_add(vm, (uint64_t *)vm->arch_vm.nworld_eptp,
vm_config->start_hpa, 0UL, vm_config->mem_size, vm_config->memory.start_hpa, 0UL, vm_config->memory.size,
EPT_RWX|EPT_WB); EPT_RWX|EPT_WB);
init_vm_boot_info(vm); init_vm_boot_info(vm);
#endif #endif

View File

@ -51,7 +51,7 @@ int32_t init_vm_boot_info(struct acrn_vm *vm)
vm->sw.kernel_info.kernel_load_addr = (void *)(16 * 1024 * 1024UL); vm->sw.kernel_info.kernel_load_addr = (void *)(16 * 1024 * 1024UL);
vm->sw.linux_info.bootargs_src_addr = (void *)vm_config->bootargs; vm->sw.linux_info.bootargs_src_addr = (void *)vm_config->bootargs;
vm->sw.linux_info.bootargs_size = strnlen_s(vm_config->bootargs, MEM_2K); vm->sw.linux_info.bootargs_size = strnlen_s(vm_config->bootargs, MEM_2K);
vm->sw.linux_info.bootargs_load_addr = (void *)(vm_config->mem_size - 8*1024UL); vm->sw.linux_info.bootargs_load_addr = (void *)(vm_config->memory.size - 8*1024UL);
clac(); clac();
ret = 0; ret = 0;
} }

View File

@ -216,8 +216,6 @@ struct acrn_vm_config {
struct acrn_vm_os_config os_config; /* OS information the VM */ struct acrn_vm_os_config os_config; /* OS information the VM */
#ifdef CONFIG_PARTITION_MODE #ifdef CONFIG_PARTITION_MODE
uint64_t start_hpa;
uint64_t mem_size; /* UOS memory size in hex */
bool vm_vuart; bool vm_vuart;
const char *bootargs; const char *bootargs;
struct vpci_vdev_array *vpci_vdev_array; struct vpci_vdev_array *vpci_vdev_array;

View File

@ -143,8 +143,8 @@ struct vm_config_arraies vm_config_partition = {
{ {
.type = PRE_LAUNCHED_VM, .type = PRE_LAUNCHED_VM,
.pcpu_bitmap = (PLUG_CPU(0) | PLUG_CPU(2)), .pcpu_bitmap = (PLUG_CPU(0) | PLUG_CPU(2)),
.start_hpa = 0x100000000UL, .memory.start_hpa = 0x100000000UL,
.mem_size = 0x20000000UL, /* uses contiguous memory from host */ .memory.size = 0x20000000UL, /* uses contiguous memory from host */
.vm_vuart = true, .vm_vuart = true,
.bootargs = "root=/dev/sda3 rw rootwait noxsave maxcpus=2 nohpet console=hvc0 \ .bootargs = "root=/dev/sda3 rw rootwait noxsave maxcpus=2 nohpet console=hvc0 \
console=ttyS2 no_timer_check ignore_loglevel log_buf_len=16M \ console=ttyS2 no_timer_check ignore_loglevel log_buf_len=16M \
@ -155,8 +155,8 @@ struct vm_config_arraies vm_config_partition = {
{ {
.type = PRE_LAUNCHED_VM, .type = PRE_LAUNCHED_VM,
.pcpu_bitmap = (PLUG_CPU(1) | PLUG_CPU(3)), .pcpu_bitmap = (PLUG_CPU(1) | PLUG_CPU(3)),
.start_hpa = 0x120000000UL, .memory.start_hpa = 0x120000000UL,
.mem_size = 0x20000000UL, /* uses contiguous memory from host */ .memory.size = 0x20000000UL, /* uses contiguous memory from host */
.vm_vuart = true, .vm_vuart = true,
.bootargs = "root=/dev/sda3 rw rootwait noxsave maxcpus=2 nohpet console=hvc0 \ .bootargs = "root=/dev/sda3 rw rootwait noxsave maxcpus=2 nohpet console=hvc0 \
console=ttyS2 no_timer_check ignore_loglevel log_buf_len=16M \ console=ttyS2 no_timer_check ignore_loglevel log_buf_len=16M \

View File

@ -177,8 +177,8 @@ struct vm_config_arraies vm_config_partition = {
{ {
.type = PRE_LAUNCHED_VM, .type = PRE_LAUNCHED_VM,
.pcpu_bitmap = (PLUG_CPU(0) | PLUG_CPU(2) | PLUG_CPU(4) | PLUG_CPU(6)), .pcpu_bitmap = (PLUG_CPU(0) | PLUG_CPU(2) | PLUG_CPU(4) | PLUG_CPU(6)),
.start_hpa = 0x100000000UL, .memory.start_hpa = 0x100000000UL,
.mem_size = 0x80000000UL, /* uses contiguous memory from host */ .memory.size = 0x80000000UL, /* uses contiguous memory from host */
.vm_vuart = true, .vm_vuart = true,
.bootargs = "root=/dev/sda rw rootwait noxsave maxcpus=4 nohpet console=hvc0 " \ .bootargs = "root=/dev/sda rw rootwait noxsave maxcpus=4 nohpet console=hvc0 " \
"console=ttyS0 no_timer_check ignore_loglevel log_buf_len=16M "\ "console=ttyS0 no_timer_check ignore_loglevel log_buf_len=16M "\
@ -190,8 +190,8 @@ struct vm_config_arraies vm_config_partition = {
{ {
.type = PRE_LAUNCHED_VM, .type = PRE_LAUNCHED_VM,
.pcpu_bitmap = (PLUG_CPU(1) | PLUG_CPU(3) | PLUG_CPU(5) | PLUG_CPU(7)), .pcpu_bitmap = (PLUG_CPU(1) | PLUG_CPU(3) | PLUG_CPU(5) | PLUG_CPU(7)),
.start_hpa = 0x180000000UL, .memory.start_hpa = 0x180000000UL,
.mem_size = 0x80000000UL, /* uses contiguous memory from host */ .memory.size = 0x80000000UL, /* uses contiguous memory from host */
.vm_vuart = true, .vm_vuart = true,
.bootargs = "root=/dev/sda2 rw rootwait noxsave maxcpus=4 nohpet console=hvc0 "\ .bootargs = "root=/dev/sda2 rw rootwait noxsave maxcpus=4 nohpet console=hvc0 "\
"console=ttyS0 no_timer_check ignore_loglevel log_buf_len=16M "\ "console=ttyS0 no_timer_check ignore_loglevel log_buf_len=16M "\