mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2025-09-10 21:29:20 +00:00
ACRN: misc: Unify terminology for service vm/user vm
Rename SOS_VM type to SERVICE_VM rename UOS to User VM in XML description rename uos_thread_pid to user_vm_thread_pid rename devname_uos to devname_user_vm rename uosid to user_vmid rename UOS_ACK to USER_VM_ACK rename SOS_VM_CONFIG_CPU_AFFINITY to SERVICE_VM_CONFIG_CPU_AFFINITY rename SOS_COM to SERVICE_VM_COM rename SOS_UART1_VALID_NUM" to SERVICE_VM_UART1_VALID_NUM rename SOS_BOOTARGS_DIFF to SERVICE_VM_BOOTARGS_DIFF rename uos to user_vm in launch script and xml Tracked-On: #6744 Signed-off-by: Liu Long <long.liu@linux.intel.com> Reviewed-by: Geoffroy Van Cutsem <geoffroy.vancutsem@intel.com>
This commit is contained in:
@@ -167,10 +167,10 @@ def generate_file(vm_info, config):
|
||||
|
||||
# Skip this vm if there is no any pci device and virtual device
|
||||
if not scenario_cfg_lib.get_pci_dev_num_per_vm()[vm_i] and \
|
||||
scenario_cfg_lib.VM_DB[vm_type]['load_type'] != "SOS_VM":
|
||||
scenario_cfg_lib.VM_DB[vm_type]['load_type'] != "SERVICE_VM":
|
||||
continue
|
||||
if not scenario_cfg_lib.get_pci_dev_num_per_vm()[vm_i] and \
|
||||
scenario_cfg_lib.VM_DB[vm_type]['load_type'] == "SOS_VM":
|
||||
scenario_cfg_lib.VM_DB[vm_type]['load_type'] == "SERVICE_VM":
|
||||
print("", file=config)
|
||||
print("struct acrn_vm_pci_dev_config " +
|
||||
"sos_pci_devs[CONFIG_MAX_PCI_DEV_NUM];", file=config)
|
||||
@@ -179,7 +179,7 @@ def generate_file(vm_info, config):
|
||||
pci_cnt = 1
|
||||
# Insert device structure and bracket
|
||||
print("", file=config)
|
||||
if scenario_cfg_lib.VM_DB[vm_type]['load_type'] == "SOS_VM":
|
||||
if scenario_cfg_lib.VM_DB[vm_type]['load_type'] == "SERVICE_VM":
|
||||
print("struct acrn_vm_pci_dev_config " +
|
||||
"sos_pci_devs[CONFIG_MAX_PCI_DEV_NUM] = {", file=config)
|
||||
else:
|
||||
@@ -242,7 +242,7 @@ def generate_file(vm_info, config):
|
||||
print("\t{", file=config)
|
||||
print("\t\t.emu_type = {},".format(PCI_DEV_TYPE[0]), file=config)
|
||||
|
||||
if scenario_cfg_lib.VM_DB[vm_type]['load_type'] == "SOS_VM":
|
||||
if scenario_cfg_lib.VM_DB[vm_type]['load_type'] == "SERVICE_VM":
|
||||
free_bdf = find_unused_bdf(sos_used_bdf, "ivshmem", last_bdf)
|
||||
last_bdf = free_bdf
|
||||
print("\t\t.vbdf.bits = {{.b = 0x00U, .d = 0x{:02x}U, .f = 0x{:02x}U}}," \
|
||||
@@ -263,7 +263,7 @@ def generate_file(vm_info, config):
|
||||
if scenario_cfg_lib.VM_DB[vm_type]['load_type'] == "PRE_LAUNCHED_VM":
|
||||
print("\t\t.shm_region_name = IVSHMEM_SHM_REGION_{},".format(region), file=config)
|
||||
print("\t\tIVSHMEM_DEVICE_{}_VBAR,".format(index), file=config)
|
||||
elif scenario_cfg_lib.VM_DB[vm_type]['load_type'] == "SOS_VM":
|
||||
elif scenario_cfg_lib.VM_DB[vm_type]['load_type'] == "SERVICE_VM":
|
||||
print("\t\t.shm_region_name = IVSHMEM_SHM_REGION_{},".format(region), file=config)
|
||||
print("\t\tSOS_IVSHMEM_DEVICE_{}_VBAR,".format(index), file=config)
|
||||
else:
|
||||
@@ -305,7 +305,7 @@ def generate_file(vm_info, config):
|
||||
if scenario_cfg_lib.VM_DB[vm_type]['load_type'] == "PRE_LAUNCHED_VM":
|
||||
free_bdf = find_unused_bdf(vm_used_bdf, "vuart", last_bdf)
|
||||
vm_used_bdf.append(free_bdf)
|
||||
elif scenario_cfg_lib.VM_DB[vm_type]['load_type'] == "SOS_VM":
|
||||
elif scenario_cfg_lib.VM_DB[vm_type]['load_type'] == "SERVICE_VM":
|
||||
free_bdf = find_unused_bdf(sos_used_bdf, "vuart", last_bdf)
|
||||
sos_used_bdf.append(free_bdf)
|
||||
print("\t\t.vbdf.bits = {{.b = 0x00U, .d = 0x{:02x}U, .f = 0x00U}},".format(free_bdf.dev,free_bdf.func), file=config)
|
||||
|
@@ -271,7 +271,7 @@ class LoadOrderNum:
|
||||
|
||||
def get_info(self, load_vm):
|
||||
self.pre_vm = scenario_cfg_lib.get_load_vm_cnt(load_vm, "PRE_LAUNCHED_VM")
|
||||
self.sos_vm = scenario_cfg_lib.get_load_vm_cnt(load_vm, "SOS_VM")
|
||||
self.sos_vm = scenario_cfg_lib.get_load_vm_cnt(load_vm, "SERVICE_VM")
|
||||
self.post_vm = scenario_cfg_lib.get_load_vm_cnt(load_vm, "POST_LAUNCHED_VM")
|
||||
|
||||
|
||||
|
@@ -53,22 +53,22 @@ def vuart0_output(i, vm_type, vm_info, config):
|
||||
:param config: it is the pointer which file write to
|
||||
:return: None
|
||||
"""
|
||||
# SOS_VM vuart[0]
|
||||
# Servce VM vuart[0]
|
||||
print("\t\t.vuart[0] = {", file=config)
|
||||
print("\t\t\t.type = {0},".format(vm_info.vuart.v0_vuart[i]['type']), file=config)
|
||||
if vm_info.vuart.v0_vuart[i]['base'] == "INVALID_COM_BASE":
|
||||
print("\t\t\t.addr.port_base = INVALID_COM_BASE,", file=config)
|
||||
if "SOS_" in vm_type:
|
||||
print("\t\t\t.irq = SOS_COM1_IRQ,", file=config)
|
||||
if "SERVICE_" in vm_type:
|
||||
print("\t\t\t.irq = SERVICE_VM_COM1_IRQ,", file=config)
|
||||
elif "PRE_LAUNCHED_VM" == scenario_cfg_lib.VM_DB[vm_type]['load_type']:
|
||||
print("\t\t\t.irq = COM1_IRQ,", file=config)
|
||||
elif "POST_LAUNCHED_VM" in scenario_cfg_lib.VM_DB[vm_type]['load_type']:
|
||||
print("\t\t\t.irq = {0},".format(
|
||||
vm_info.vuart.v0_vuart[i]['irq']), file=config)
|
||||
else:
|
||||
if "SOS_" in vm_type:
|
||||
print("\t\t\t.addr.port_base = SOS_COM1_BASE,", file=config)
|
||||
print("\t\t\t.irq = SOS_COM1_IRQ,", file=config)
|
||||
if "SERVICE_" in vm_type:
|
||||
print("\t\t\t.addr.port_base = SERVICE_VM_COM1_BASE,", file=config)
|
||||
print("\t\t\t.irq = SERVICE_VM_COM1_IRQ,", file=config)
|
||||
elif "PRE_LAUNCHED_VM" == scenario_cfg_lib.VM_DB[vm_type]['load_type']:
|
||||
print("\t\t\t.addr.port_base = COM1_BASE,", file=config)
|
||||
print("\t\t\t.irq = COM1_IRQ,", file=config)
|
||||
@@ -119,9 +119,9 @@ def vuart1_output(i, vm_type, vuart1_vmid_dic, vm_info, config):
|
||||
print("\t\t\t.addr.port_base = INVALID_COM_BASE,", file=config)
|
||||
|
||||
if vuart1_vmid_dic and i in vuart1_vmid_dic.keys():
|
||||
if "SOS_VM" == scenario_cfg_lib.VM_DB[vm_type]['load_type']:
|
||||
if "SERVICE_VM" == scenario_cfg_lib.VM_DB[vm_type]['load_type']:
|
||||
if vm_info.vuart.v1_vuart[i]['base'] != "INVALID_COM_BASE" and vuart_enable[i]:
|
||||
print("\t\t\t.irq = SOS_COM2_IRQ,", file=config)
|
||||
print("\t\t\t.irq = SERVICE_VM_COM2_IRQ,", file=config)
|
||||
else:
|
||||
if vm_info.vuart.v1_vuart[i]['base'] != "INVALID_COM_BASE" and vuart_enable[i]:
|
||||
print("\t\t\t.irq = COM2_IRQ,", file=config)
|
||||
@@ -156,11 +156,11 @@ def is_need_epc(epc_section, i, config):
|
||||
:param config: it is file pointer to store the information
|
||||
:return: None
|
||||
"""
|
||||
# SOS_VM have not set epc section
|
||||
# Service_VM have not set epc section
|
||||
if i not in common.VM_TYPES.keys():
|
||||
return
|
||||
vm_type = list(common.VM_TYPES.values())[i]
|
||||
if "SOS_VM" == scenario_cfg_lib.VM_DB[vm_type]['load_type']:
|
||||
if "SERVICE_VM" == scenario_cfg_lib.VM_DB[vm_type]['load_type']:
|
||||
return
|
||||
|
||||
if epc_section.base[i] == '0' and epc_section.size[i] == '0':
|
||||
@@ -180,8 +180,8 @@ def cpu_affinity_output(vm_info, i, config):
|
||||
:param config: file pointor to store the information
|
||||
"""
|
||||
|
||||
if "SOS_VM" == common.VM_TYPES[i]:
|
||||
print("\t\t.cpu_affinity = SOS_VM_CONFIG_CPU_AFFINITY,", file=config)
|
||||
if "SERVICE_VM" == common.VM_TYPES[i]:
|
||||
print("\t\t.cpu_affinity = SERVICE_VM_CONFIG_CPU_AFFINITY,", file=config)
|
||||
else:
|
||||
print("\t\t.cpu_affinity = VM{}_CONFIG_CPU_AFFINITY,".format(i), file=config)
|
||||
|
||||
@@ -249,10 +249,10 @@ def gen_sos_vm(vm_type, vm_i, scenario_items, config):
|
||||
return err_dic
|
||||
|
||||
print("\t{{\t/* VM{} */".format(vm_i), file=config)
|
||||
print("\t\tCONFIG_SOS_VM,", file=config)
|
||||
print("\t\tCONFIG_SERVICE_VM,", file=config)
|
||||
print('\t\t.name = "{0}",'.format(vm_info.name[vm_i]), file=config)
|
||||
print("", file=config)
|
||||
print("\t\t/* Allow SOS to reboot the host since " +
|
||||
print("\t\t/* Allow Service VM to reboot the host since " +
|
||||
"there is supposed to be the highest severity guest */", file=config)
|
||||
if sos_guest_flags:
|
||||
print("\t\t.guest_flags = {0},".format(sos_guest_flags), file=config)
|
||||
@@ -386,7 +386,7 @@ def gen_post_launch_vm(vm_type, vm_i, scenario_items, config):
|
||||
def declare_pci_devs(vm_info, config):
|
||||
|
||||
for vm_i,vm_type in common.VM_TYPES.items():
|
||||
if vm_type == "SOS_VM":
|
||||
if vm_type == "SERVICE_VM":
|
||||
print("extern struct acrn_vm_pci_dev_config " +
|
||||
"sos_pci_devs[CONFIG_MAX_PCI_DEV_NUM];", file=config)
|
||||
continue
|
||||
@@ -418,7 +418,7 @@ def generate_file(scenario_items, config):
|
||||
print("struct acrn_vm_config vm_configs[CONFIG_MAX_VM_NUM] = {", file=config)
|
||||
for vm_i, vm_type in common.VM_TYPES.items():
|
||||
|
||||
if "SOS_VM" == scenario_cfg_lib.VM_DB[vm_type]['load_type']:
|
||||
if "SERVICE_VM" == scenario_cfg_lib.VM_DB[vm_type]['load_type']:
|
||||
gen_sos_vm(vm_type, vm_i, scenario_items, config)
|
||||
elif "PRE_LAUNCHED_VM" == scenario_cfg_lib.VM_DB[vm_type]['load_type']:
|
||||
gen_pre_launch_vm(vm_type, vm_i, scenario_items, config)
|
||||
|
@@ -63,17 +63,17 @@ def gen_pre_launch_vm(scenario_items, config):
|
||||
|
||||
def gen_sos_header(scenario_items, config):
|
||||
|
||||
if 'SOS_VM' not in common.VM_TYPES.values():
|
||||
if 'SERVICE_VM' not in common.VM_TYPES.values():
|
||||
return
|
||||
|
||||
for vm_i,vm_type in common.VM_TYPES.items():
|
||||
if vm_type == 'SOS_VM':
|
||||
print("/* SOS_VM == VM{0} */".format(vm_i), file=config)
|
||||
if vm_type == 'SERVICE_VM':
|
||||
print("/* SERVICE_VM == VM{0} */".format(vm_i), file=config)
|
||||
|
||||
print("#define SERVICE_VM_OS_BOOTARGS\t\t\tSERVICE_VM_ROOTFS\t\\", file=config)
|
||||
print("\t\t\t\t\tSERVICE_VM_OS_CONSOLE\t\\", file=config)
|
||||
print("\t\t\t\t\tSERVICE_VM_IDLE\t\\", file=config)
|
||||
print("\t\t\t\t\tSOS_BOOTARGS_DIFF", file=config)
|
||||
print("\t\t\t\t\tSERVICE_VM_BOOTARGS_DIFF", file=config)
|
||||
|
||||
print("", file=config)
|
||||
|
||||
@@ -87,7 +87,7 @@ def gen_header_file(scenario_items, config):
|
||||
def get_dm_owned_guest_flag_mask(vm_info, config):
|
||||
|
||||
print("", file=config)
|
||||
if "SOS_VM" not in common.VM_TYPES.values():
|
||||
if "SERVICE_VM" not in common.VM_TYPES.values():
|
||||
print("#define DM_OWNED_GUEST_FLAG_MASK 0UL", file=config)
|
||||
else:
|
||||
print("/* Bits mask of guest flags that can be programmed by device model." +
|
||||
|
Reference in New Issue
Block a user