ACRN:MISC: Terminology for UOS/SOS in misc

Rename get_sos_wakeup_reason to get_service_vm_wakeup_reason in acrn manager.
rename set_sos_timer to set_service_vm_timer.
rename sos_pci_devs to service_vm_pci_devs.
rename gen_sos_vm to gen_service_vm.
rename sos_used_bdf to service_vm_used_bdf.
rename is-sos-vm to is-service-vm.
rename sos_mmio_range to service_vm_mmio_range.
rename sos_guest_flags to service_vm_guest_flags.
rename get_sos_vmid to get_service_vmid.
rename sos_cpu_affinity to service_vm_cpu_affinity.
rename allocation_sos_vm_node to allocation_service_vm_node.
rename cpus_for_sos to cpus_for_service_vm.
rename sos_vm_cpus to service_vm_cpus.
rename get_sos_vuart_settings to get_service_vm_vuart_settings.
rename sos_extend_all_cpus to service_vm_extend_all_cpus.
rename sos_vm_id to servier_vm_id.
rename sos_vm_index to service_vm_index.
rename sos_vm_num to service_vm_num.
re-generate the board and scenario code by the new python and xml.
delete tdf8532 kernel module in python and shell script.

Tracked-On: #6744
Signed-off-by: Liu Long <long.liu@linux.intel.com>
This commit is contained in:
Liu Long 2021-11-29 13:57:19 +08:00 committed by wenlingz
parent 7a0c7dcadf
commit 5c3a080c03
78 changed files with 914 additions and 1084 deletions

View File

@ -93,8 +93,8 @@ local_parse_madt(struct acpi_table_madt *madt)
} }
/* /*
* There has an assumption. The SOS owned pcpu starts from physical cpu 0, * There has an assumption. The Service VM owned pcpu starts from physical cpu 0,
* otherwise SOS doesn't know the mapping relationship between its vcpu0 * otherwise Service VM doesn't know the mapping relationship between its vcpu0
* and pcpu_id. * and pcpu_id.
*/ */
int parse_madt(void) int parse_madt(void)
@ -106,7 +106,7 @@ int parse_madt(void)
int fd = open("/sys/firmware/acpi/tables/APIC", O_RDONLY); int fd = open("/sys/firmware/acpi/tables/APIC", O_RDONLY);
if (fd < 0) { if (fd < 0) {
pr_err("Fail to open sos APIC file!\n"); pr_err("Fail to open Service VM APIC file!\n");
return -1; return -1;
} }
@ -126,7 +126,7 @@ int parse_madt(void)
if (size == file_state.st_size) { if (size == file_state.st_size) {
ret = local_parse_madt(madt); ret = local_parse_madt(madt);
} else { } else {
pr_err("Fail to read sos madt info!"); pr_err("Fail to read Service VM madt info!");
ret = -1; ret = -1;
} }

View File

@ -9,7 +9,7 @@
#include <asm/vm_config.h> #include <asm/vm_config.h>
extern struct acrn_vm_pci_dev_config sos_pci_devs[CONFIG_MAX_PCI_DEV_NUM]; extern struct acrn_vm_pci_dev_config service_vm_pci_devs[CONFIG_MAX_PCI_DEV_NUM];
struct pci_pdev; struct pci_pdev;
struct acrn_vm_pci_dev_config *init_one_dev_config(struct pci_pdev *pdev); struct acrn_vm_pci_dev_config *init_one_dev_config(struct pci_pdev *pdev);

View File

@ -74,7 +74,7 @@ def get_devs_per_vm_with_key(pci_devs, keywords):
def write_vbar(i_cnt, bdf, pci_bar_dic, bar_attr, \ def write_vbar(i_cnt, bdf, pci_bar_dic, bar_attr, \
pci_devs_per_vm, mmiolist_per_vm, sos_mmio_range,config): pci_devs_per_vm, mmiolist_per_vm, service_vm_mmio_range,config):
""" """
Parser and generate vbar Parser and generate vbar
:param i_cnt: the number of pci devices have the same PCI sub class name :param i_cnt: the number of pci devices have the same PCI sub class name
@ -152,7 +152,7 @@ def find_next_bar(bar_val, bar_list):
return idx return idx
def write_vuart_vbar(mmiolist_per_vm, sos_mmio_range, config): def write_vuart_vbar(mmiolist_per_vm, service_vm_mmio_range, config):
# get legacy vuart information # get legacy vuart information
vuart0_setting = common.get_vuart_info_id(common.SCENARIO_INFO_FILE, 0) vuart0_setting = common.get_vuart_info_id(common.SCENARIO_INFO_FILE, 0)
vuart1_setting = common.get_vuart_info_id(common.SCENARIO_INFO_FILE, 1) vuart1_setting = common.get_vuart_info_id(common.SCENARIO_INFO_FILE, 1)
@ -177,14 +177,14 @@ def write_vuart_vbar(mmiolist_per_vm, sos_mmio_range, config):
free_bar1 = [] free_bar1 = []
# vuart decice requires 2 bars # vuart decice requires 2 bars
if scenario_cfg_lib.VM_DB[vm_type]['load_type'] == "SERVICE_VM": if scenario_cfg_lib.VM_DB[vm_type]['load_type'] == "SERVICE_VM":
free_bar0 = get_free_mmio(sos_mmio_range, mmiolist_per_vm[vm_id], \ free_bar0 = get_free_mmio(service_vm_mmio_range, mmiolist_per_vm[vm_id], \
PCI_VUART_VBAR0_SIZE + PCI_VUART_VBAR0_ALIGNMENT) PCI_VUART_VBAR0_SIZE + PCI_VUART_VBAR0_ALIGNMENT)
free_bar0_start_addr = common.round_up(free_bar0.start, PCI_VUART_VBAR0_ALIGNMENT) free_bar0_start_addr = common.round_up(free_bar0.start, PCI_VUART_VBAR0_ALIGNMENT)
free_bar0_end_addr = free_bar0_start_addr + PCI_VUART_VBAR0_SIZE - 1 free_bar0_end_addr = free_bar0_start_addr + PCI_VUART_VBAR0_SIZE - 1
free_bar0 = MmioWindow(free_bar0_start_addr, free_bar0_end_addr) free_bar0 = MmioWindow(free_bar0_start_addr, free_bar0_end_addr)
mmiolist_per_vm[vm_id].append(free_bar0) mmiolist_per_vm[vm_id].append(free_bar0)
mmiolist_per_vm[vm_id].sort() mmiolist_per_vm[vm_id].sort()
free_bar1 = get_free_mmio(sos_mmio_range, mmiolist_per_vm[vm_id], \ free_bar1 = get_free_mmio(service_vm_mmio_range, mmiolist_per_vm[vm_id], \
PCI_VUART_VBAR1_SIZE + PCI_VUART_VBAR1_ALIGNMENT) PCI_VUART_VBAR1_SIZE + PCI_VUART_VBAR1_ALIGNMENT)
free_bar1_start_addr = common.round_up(free_bar1.start, PCI_VUART_VBAR1_ALIGNMENT) free_bar1_start_addr = common.round_up(free_bar1.start, PCI_VUART_VBAR1_ALIGNMENT)
free_bar1_end_addr = free_bar1_start_addr + PCI_VUART_VBAR1_SIZE - 1 free_bar1_end_addr = free_bar1_start_addr + PCI_VUART_VBAR1_SIZE - 1
@ -212,7 +212,7 @@ def write_vuart_vbar(mmiolist_per_vm, sos_mmio_range, config):
print("", file=config) print("", file=config)
def write_ivshmem_vbar(mmiolist_per_vm, sos_mmio_range, config): def write_ivshmem_vbar(mmiolist_per_vm, service_vm_mmio_range, config):
for vm_id,vm_type in common.VM_TYPES.items(): for vm_id,vm_type in common.VM_TYPES.items():
ivshmem_region = common.get_hv_item_tag(common.SCENARIO_INFO_FILE, ivshmem_region = common.get_hv_item_tag(common.SCENARIO_INFO_FILE,
"FEATURES", "IVSHMEM", "IVSHMEM_REGION") "FEATURES", "IVSHMEM", "IVSHMEM_REGION")
@ -234,27 +234,27 @@ def write_ivshmem_vbar(mmiolist_per_vm, sos_mmio_range, config):
int_size = 0 int_size = 0
if scenario_cfg_lib.VM_DB[vm_type]['load_type'] == "SERVICE_VM": if scenario_cfg_lib.VM_DB[vm_type]['load_type'] == "SERVICE_VM":
# vbar[0] for shared memory is 4k # vbar[0] for shared memory is 4k
free_bar0 = get_free_mmio(sos_mmio_range, mmiolist_per_vm[vm_id], BAR0_SHEMEM_ALIGNMENT + BAR0_SHEMEM_SIZE) free_bar0 = get_free_mmio(service_vm_mmio_range, mmiolist_per_vm[vm_id], BAR0_SHEMEM_ALIGNMENT + BAR0_SHEMEM_SIZE)
free_bar0_start_addr = common.round_up(free_bar0.start, BAR0_SHEMEM_ALIGNMENT) free_bar0_start_addr = common.round_up(free_bar0.start, BAR0_SHEMEM_ALIGNMENT)
free_bar0_end_addr = free_bar0_start_addr + BAR0_SHEMEM_SIZE - 1 free_bar0_end_addr = free_bar0_start_addr + BAR0_SHEMEM_SIZE - 1
free_bar0 = MmioWindow(free_bar0_start_addr, free_bar0_end_addr) free_bar0 = MmioWindow(free_bar0_start_addr, free_bar0_end_addr)
mmiolist_per_vm[vm_id].append(free_bar0) mmiolist_per_vm[vm_id].append(free_bar0)
mmiolist_per_vm[vm_id].sort() mmiolist_per_vm[vm_id].sort()
# vbar[1] for shared memory is 4K # vbar[1] for shared memory is 4K
free_bar1 = get_free_mmio(sos_mmio_range, mmiolist_per_vm[vm_id], BAR1_SHEMEM_ALIGNMENT + BAR1_SHEMEM_SIZE) free_bar1 = get_free_mmio(service_vm_mmio_range, mmiolist_per_vm[vm_id], BAR1_SHEMEM_ALIGNMENT + BAR1_SHEMEM_SIZE)
free_bar1_start_addr = common.round_up(free_bar1.start, BAR1_SHEMEM_ALIGNMENT) free_bar1_start_addr = common.round_up(free_bar1.start, BAR1_SHEMEM_ALIGNMENT)
free_bar1_end_addr = free_bar1_start_addr + BAR1_SHEMEM_SIZE - 1 free_bar1_end_addr = free_bar1_start_addr + BAR1_SHEMEM_SIZE - 1
free_bar1 = MmioWindow(free_bar1_start_addr, free_bar1_end_addr) free_bar1 = MmioWindow(free_bar1_start_addr, free_bar1_end_addr)
mmiolist_per_vm[vm_id].append(free_bar1) mmiolist_per_vm[vm_id].append(free_bar1)
mmiolist_per_vm[vm_id].sort() mmiolist_per_vm[vm_id].sort()
# vbar[2] for shared memory is specified size in MB # vbar[2] for shared memory is specified size in MB
free_bar2 = get_free_mmio(sos_mmio_range, mmiolist_per_vm[vm_id], BAR2_SHEMEM_ALIGNMENT + int_size) free_bar2 = get_free_mmio(service_vm_mmio_range, mmiolist_per_vm[vm_id], BAR2_SHEMEM_ALIGNMENT + int_size)
free_bar2_start_addr = common.round_up(free_bar2.start, BAR2_SHEMEM_ALIGNMENT) + 0xC free_bar2_start_addr = common.round_up(free_bar2.start, BAR2_SHEMEM_ALIGNMENT) + 0xC
free_bar2_end_addr = free_bar2_start_addr + int_size - 1 free_bar2_end_addr = free_bar2_start_addr + int_size - 1
free_bar2 = MmioWindow(free_bar2_start_addr, free_bar2_end_addr) free_bar2 = MmioWindow(free_bar2_start_addr, free_bar2_end_addr)
mmiolist_per_vm[vm_id].append(free_bar2) mmiolist_per_vm[vm_id].append(free_bar2)
mmiolist_per_vm[vm_id].sort() mmiolist_per_vm[vm_id].sort()
print("#define SOS_IVSHMEM_DEVICE_%-19s" % (str(idx) + "_VBAR"), print("#define SERVICE_VM_IVSHMEM_DEVICE_%-19s" % (str(idx) + "_VBAR"),
" .vbar_base[0] = {:#x}UL, \\".format(free_bar0.start), file=config) " .vbar_base[0] = {:#x}UL, \\".format(free_bar0.start), file=config)
print("{}.vbar_base[1] = {:#x}UL, \\".format(' ' * 54, free_bar1.start), file=config) print("{}.vbar_base[1] = {:#x}UL, \\".format(' ' * 54, free_bar1.start), file=config)
print("{}.vbar_base[2] = {:#x}UL".format(' ' * 54, free_bar2.start), file=config) print("{}.vbar_base[2] = {:#x}UL".format(' ' * 54, free_bar2.start), file=config)
@ -377,7 +377,7 @@ def generate_file(config):
pci_devs = scenario_cfg_lib.get_pt_pci_devs(pci_items) pci_devs = scenario_cfg_lib.get_pt_pci_devs(pci_items)
pci_devs_per_vm = get_devs_per_vm_with_key(pci_devs, bdf_list) pci_devs_per_vm = get_devs_per_vm_with_key(pci_devs, bdf_list)
# list Service VM vmsix supported devices without other PRE_LAUNCHED_VMs' in bdf format # list Service VM vmsix supported devices without other PRE_LAUNCHED_VMs' in bdf format
sos_bdf_list = [ service_vm_bdf_list = [
d for d in bdf_list d for d in bdf_list
if all((d not in pci_devs_per_vm[i] for i in pci_devs_per_vm)) if all((d not in pci_devs_per_vm[i] for i in pci_devs_per_vm))
] ]
@ -385,7 +385,7 @@ def generate_file(config):
for vm_i in pci_devs_per_vm: for vm_i in pci_devs_per_vm:
vm_type = common.VM_TYPES[vm_i] vm_type = common.VM_TYPES[vm_i]
if scenario_cfg_lib.VM_DB[vm_type]['load_type'] == "SERVICE_VM": if scenario_cfg_lib.VM_DB[vm_type]['load_type'] == "SERVICE_VM":
pci_devs_per_vm[vm_i] = sos_bdf_list pci_devs_per_vm[vm_i] = service_vm_bdf_list
mmiolist_per_vm = {} mmiolist_per_vm = {}
for vm_i,vm_type in common.VM_TYPES.items(): for vm_i,vm_type in common.VM_TYPES.items():
@ -416,14 +416,14 @@ def generate_file(config):
print(VBAR_INFO_DEFINE, file=config) print(VBAR_INFO_DEFINE, file=config)
common.get_vm_types() common.get_vm_types()
pre_vm = False pre_vm = False
sos_vm = False service_vm = False
for vm_type in common.VM_TYPES.values(): for vm_type in common.VM_TYPES.values():
if scenario_cfg_lib.VM_DB[vm_type]['load_type'] == "PRE_LAUNCHED_VM": if scenario_cfg_lib.VM_DB[vm_type]['load_type'] == "PRE_LAUNCHED_VM":
pre_vm = True pre_vm = True
if scenario_cfg_lib.VM_DB[vm_type]['load_type'] == "SERVICE_VM": if scenario_cfg_lib.VM_DB[vm_type]['load_type'] == "SERVICE_VM":
sos_vm = True service_vm = True
if not pre_vm and not sos_vm: if not pre_vm and not service_vm:
print(VBAR_INFO_ENDIF, file=config) print(VBAR_INFO_ENDIF, file=config)
return return

View File

@ -783,7 +783,7 @@ def upload_board_info():
continue continue
# update RDT->CLOS_MASK according to board xml # update RDT->CLOS_MASK according to board xml
# if 'board' in xml_config_root.attrib and 'scenario' in xml_config_root.attrib \ # if 'board' in xml_config_root.attrib and 'scenario' in xml_config_root.attrib \
# and 'uos_launcher' not in xml_config_root.attrib: # and 'user_vm_launcher' not in xml_config_root.attrib:
# cdp_enabled = xml_config.get_curr_value('hv', 'FEATURES', 'RDT', 'CDP_ENABLED') # cdp_enabled = xml_config.get_curr_value('hv', 'FEATURES', 'RDT', 'CDP_ENABLED')
# (num_clos_mask, num_mba_delay) = \ # (num_clos_mask, num_mba_delay) = \
# get_num_of_rdt_res(filename.rsplit('.', 1)[0], cdp_enabled) # get_num_of_rdt_res(filename.rsplit('.', 1)[0], cdp_enabled)
@ -1249,7 +1249,7 @@ def assign_vm_id(scenario_config):
""" """
root = scenario_config.get_curr_root() root = scenario_config.get_curr_root()
pre_launched_vm_num = 0 pre_launched_vm_num = 0
sos_vm_num = 0 service_vm_num = 0
post_launched_vm_num = 0 post_launched_vm_num = 0
for vm in list(root): for vm in list(root):
@ -1259,13 +1259,13 @@ def assign_vm_id(scenario_config):
if item.text in ['PRE_STD_VM', 'SAFETY_VM', 'PRE_RT_VM']: if item.text in ['PRE_STD_VM', 'SAFETY_VM', 'PRE_RT_VM']:
pre_launched_vm_num += 1 pre_launched_vm_num += 1
elif item.text in ['SERVICE_VM']: elif item.text in ['SERVICE_VM']:
sos_vm_num += 1 service_vm_num += 1
elif item.text in ['POST_STD_VM', 'POST_RT_VM']: elif item.text in ['POST_STD_VM', 'POST_RT_VM']:
post_launched_vm_num += 1 post_launched_vm_num += 1
pre_launched_vm_index = 0 pre_launched_vm_index = 0
sos_vm_index = pre_launched_vm_num servier_vm_index = pre_launched_vm_num
post_launched_vm_index = pre_launched_vm_num + sos_vm_num post_launched_vm_index = pre_launched_vm_num + service_vm_num
for vm in list(root): for vm in list(root):
if vm.tag == 'vm': if vm.tag == 'vm':
for item in list(vm): for item in list(vm):
@ -1274,8 +1274,8 @@ def assign_vm_id(scenario_config):
vm.attrib['id'] = str(pre_launched_vm_index) vm.attrib['id'] = str(pre_launched_vm_index)
pre_launched_vm_index += 1 pre_launched_vm_index += 1
elif item.text in ['SERVICE_VM']: elif item.text in ['SERVICE_VM']:
vm.attrib['id'] = str(sos_vm_index) vm.attrib['id'] = str(servier_vm_index)
sos_vm_index += 1 servier_vm_index += 1
elif item.text in ['POST_STD_VM', 'POST_RT_VM']: elif item.text in ['POST_STD_VM', 'POST_RT_VM']:
vm.attrib['id'] = str(post_launched_vm_index) vm.attrib['id'] = str(post_launched_vm_index)
post_launched_vm_index += 1 post_launched_vm_index += 1

View File

@ -134,7 +134,7 @@
<start_hpa>0</start_hpa> <start_hpa>0</start_hpa>
</memory> </memory>
<os_config> <os_config>
<name>ACRN Service OS</name> <name>ACRN Service VM OS</name>
<kern_type>KERNEL_BZIMAGE</kern_type> <kern_type>KERNEL_BZIMAGE</kern_type>
<kern_mod>Linux_bzImage</kern_mod> <kern_mod>Linux_bzImage</kern_mod>
<ramdisk_mod/> <ramdisk_mod/>
@ -260,4 +260,4 @@
</communication_vuart> </communication_vuart>
<PTM>n</PTM> <PTM>n</PTM>
</vm> </vm>
</acrn-config> </acrn-config>

View File

@ -67,7 +67,7 @@
<size>0x20000000</size> <size>0x20000000</size>
</memory> </memory>
<os_config> <os_config>
<name>ACRN Service OS</name> <name>ACRN Service VM OS</name>
<kern_type>KERNEL_BZIMAGE</kern_type> <kern_type>KERNEL_BZIMAGE</kern_type>
<kern_mod>Linux_bzImage</kern_mod> <kern_mod>Linux_bzImage</kern_mod>
<ramdisk_mod/> <ramdisk_mod/>
@ -343,4 +343,4 @@
</communication_vuart> </communication_vuart>
<PTM>n</PTM> <PTM>n</PTM>
</vm> </vm>
</acrn-config> </acrn-config>

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (C) 2021 Intel Corporation. All rights reserved. * Copyright (C) 2021 Intel Corporation.
* *
* SPDX-License-Identifier: BSD-3-Clause * SPDX-License-Identifier: BSD-3-Clause
*/ */
@ -7,12 +7,15 @@
#ifndef BOARD_INFO_H #ifndef BOARD_INFO_H
#define BOARD_INFO_H #define BOARD_INFO_H
#define MAX_PCPU_NUM 4U #define MAX_HIDDEN_PDEVS_NUM 0U
#define MAX_VMSIX_ON_MSI_PDEVS_NUM 0U #define MAX_PCPU_NUM 4U
#define MAX_HIDDEN_PDEVS_NUM 0U #define MAX_VMSIX_ON_MSI_PDEVS_NUM 0U
#define MAXIMUM_PA_WIDTH 39U
#define HI_MMIO_START 0x4000000000UL #define MMIO32_START 0X4F800000UL
#define HI_MMIO_END 0x8000000000UL #define MMIO32_END 0XC0000000UL
#define HI_MMIO_SIZE 0x20504000UL #define MMIO64_START 0X4000000000UL
#define MMIO64_END 0X8000000000UL
#define HI_MMIO_START 0X4000000000UL
#define HI_MMIO_END 0X8000000000UL
#endif /* BOARD_INFO_H */ #endif /* BOARD_INFO_H */

View File

@ -7,4 +7,5 @@
#ifndef IVSHMEM_CFG_H #ifndef IVSHMEM_CFG_H
#define IVSHMEM_CFG_H #define IVSHMEM_CFG_H
#endif /* IVSHMEM_CFG_H */ #endif /* IVSHMEM_CFG_H */

View File

@ -7,27 +7,26 @@
#ifndef MISC_CFG_H #ifndef MISC_CFG_H
#define MISC_CFG_H #define MISC_CFG_H
#define SERVICE_VM_ROOTFS "root=/dev/nvme0n1p3 " #define SERVICE_VM_ROOTFS "root=/dev/nvme0n1p3 "
#define SERVICE_VM_OS_CONSOLE "console=ttyS0 " #define SERVICE_VM_OS_CONSOLE "console=ttyS0 "
#define SERVICE_VM_BOOTARGS_DIFF \ #define SERVICE_VM_BOOTARGS_DIFF "rw rootwait console=tty0 consoleblank=0 no_timer_check quiet loglevel=3 i915.nuclear_pageflip=1 swiotlb=131072 maxcpus=3 hugepagesz=1G hugepages=8 "
"rw rootwait console=tty0 consoleblank=0 no_timer_check quiet loglevel=3 i915.nuclear_pageflip=1 " \ #define VM0_CONFIG_CPU_AFFINITY (AFFINITY_CPU(3U))
"swiotlb=131072 maxcpus=3 hugepagesz=1G hugepages=8 " #define SERVICE_VM_CONFIG_CPU_AFFINITY (AFFINITY_CPU(0U)|AFFINITY_CPU(1U)|AFFINITY_CPU(2U))
#define VM0_CONFIG_CPU_AFFINITY (AFFINITY_CPU(3U)) #define VM2_CONFIG_CPU_AFFINITY (AFFINITY_CPU(2U))
#define SERVICE_VM_CONFIG_CPU_AFFINITY (AFFINITY_CPU(0U) | AFFINITY_CPU(1U) | AFFINITY_CPU(2U)) #define VM3_CONFIG_CPU_AFFINITY (AFFINITY_CPU(2U))
#define VM2_CONFIG_CPU_AFFINITY (AFFINITY_CPU(2U))
#define VM3_CONFIG_CPU_AFFINITY (AFFINITY_CPU(2U))
#ifdef CONFIG_RDT_ENABLED #ifdef CONFIG_RDT_ENABLED
#define HV_SUPPORTED_MAX_CLOS 0U #define HV_SUPPORTED_MAX_CLOS 0U
#define MAX_MBA_CLOS_NUM_ENTRIES 0U #define MAX_MBA_CLOS_NUM_ENTRIES 0U
#define MAX_CACHE_CLOS_NUM_ENTRIES 0U #define MAX_CACHE_CLOS_NUM_ENTRIES 0U
#define CLOS_MASK_0 0xfffffU #define CLOS_MASK_0 0xfffffU
#define CLOS_MASK_1 0xfffffU #define CLOS_MASK_1 0xfffffU
#define CLOS_MASK_2 0xfffffU #define CLOS_MASK_2 0xfffffU
#define CLOS_MASK_3 0xfffffU #define CLOS_MASK_3 0xfffffU
#define CLOS_MASK_4 0xfffffU #define CLOS_MASK_4 0xfffffU
#define CLOS_MASK_5 0xfffffU #define CLOS_MASK_5 0xfffffU
#define CLOS_MASK_6 0xfffffU #define CLOS_MASK_6 0xfffffU
#define CLOS_MASK_7 0xfffffU #define CLOS_MASK_7 0xfffffU
#endif #endif
#endif /* MISC_CFG_H */ #endif /* MISC_CFG_H */

View File

@ -10,5 +10,6 @@
#include <asm/page.h> #include <asm/page.h>
#include <vmcs9900.h> #include <vmcs9900.h>
#include <ivshmem_cfg.h> #include <ivshmem_cfg.h>
#define INVALID_PCI_BASE 0U #define INVALID_PCI_BASE 0U
struct acrn_vm_pci_dev_config sos_pci_devs[CONFIG_MAX_PCI_DEV_NUM] = {}; struct acrn_vm_pci_dev_config service_vm_pci_devs[CONFIG_MAX_PCI_DEV_NUM] = {
};

View File

@ -5,4 +5,6 @@
*/ */
#include <asm/vm_config.h> #include <asm/vm_config.h>
struct pt_intx_config vm0_pt_intx[1U] = {}; struct pt_intx_config vm0_pt_intx[1U] = {
};

View File

@ -7,42 +7,46 @@
#ifndef VBAR_BASE_H_ #ifndef VBAR_BASE_H_
#define VBAR_BASE_H_ #define VBAR_BASE_H_
#define VGA_COMPATIBLE_CONTROLLER_0_VBAR \ #define VGA_COMPATIBLE_CONTROLLER_0_VBAR .vbar_base[0] = HI_MMIO_START + 0x0UL, \
.vbar_base[0] = HI_MMIO_START + 0x0UL, .vbar_base[2] = HI_MMIO_START + 0x10000000UL .vbar_base[2] = HI_MMIO_START + 0x10000000UL
#define SYSTEM_PERIPHERAL_0_VBAR .vbar_base[0] = HI_MMIO_START + 0x20000000UL #define SYSTEM_PERIPHERAL_0_VBAR .vbar_base[0] = HI_MMIO_START + 0x20000000UL
#define USB_CONTROLLER_0_VBAR .vbar_base[0] = HI_MMIO_START + 0x20010000UL #define USB_CONTROLLER_0_VBAR .vbar_base[0] = HI_MMIO_START + 0x20010000UL
#define USB_CONTROLLER_1_VBAR .vbar_base[0] = HI_MMIO_START + 0x20040000UL, .vbar_base[2] = HI_MMIO_START + 0x20080000UL #define USB_CONTROLLER_1_VBAR .vbar_base[0] = HI_MMIO_START + 0x20040000UL, \
.vbar_base[2] = HI_MMIO_START + 0x20080000UL
#define USB_CONTROLLER_2_VBAR .vbar_base[0] = HI_MMIO_START + 0x200c0000UL, .vbar_base[2] = HI_MMIO_START + 0x20100000UL #define USB_CONTROLLER_2_VBAR .vbar_base[0] = HI_MMIO_START + 0x200c0000UL, \
.vbar_base[2] = HI_MMIO_START + 0x20100000UL
#define USB_CONTROLLER_3_VBAR .vbar_base[0] = HI_MMIO_START + 0x20110000UL #define USB_CONTROLLER_3_VBAR .vbar_base[0] = HI_MMIO_START + 0x20110000UL
#define RAM_MEMORY_0_VBAR .vbar_base[0] = HI_MMIO_START + 0x20120000UL, .vbar_base[2] = HI_MMIO_START + 0x20124000UL #define RAM_MEMORY_0_VBAR .vbar_base[0] = HI_MMIO_START + 0x20120000UL, \
.vbar_base[2] = HI_MMIO_START + 0x20124000UL
#define NETWORK_CONTROLLER_0_VBAR .vbar_base[0] = HI_MMIO_START + 0x20128000UL #define NETWORK_CONTROLLER_0_VBAR .vbar_base[0] = HI_MMIO_START + 0x20128000UL
#define SERIAL_BUS_CONTROLLER_0_VBAR .vbar_base[0] = HI_MMIO_START + 0x2012c000UL #define SERIAL_BUS_CONTROLLER_0_VBAR .vbar_base[0] = HI_MMIO_START + 0x2012c000UL
#define SERIAL_BUS_CONTROLLER_1_VBAR .vbar_base[0] = HI_MMIO_START + 0x2012d000UL #define SERIAL_BUS_CONTROLLER_1_VBAR .vbar_base[0] = HI_MMIO_START + 0x2012d000UL
#define SERIAL_BUS_CONTROLLER_2_VBAR .vbar_base[0] = HI_MMIO_START + 0x20301000UL #define SERIAL_BUS_CONTROLLER_2_VBAR .vbar_base[0] = HI_MMIO_START + 0x20301000UL
#define COMMUNICATION_CONTROLLER_0_VBAR .vbar_base[0] = HI_MMIO_START + 0x2012e000UL #define COMMUNICATION_CONTROLLER_0_VBAR .vbar_base[0] = HI_MMIO_START + 0x2012e000UL
#define SATA_CONTROLLER_0_VBAR \ #define SATA_CONTROLLER_0_VBAR .vbar_base[0] = HI_MMIO_START + 0x20130000UL, \
.vbar_base[0] = HI_MMIO_START + 0x20130000UL, .vbar_base[1] = HI_MMIO_START + 0x20132000UL, \ .vbar_base[1] = HI_MMIO_START + 0x20132000UL, \
.vbar_base[5] = HI_MMIO_START + 0x20132800UL .vbar_base[5] = HI_MMIO_START + 0x20132800UL
#define AUDIO_DEVICE_0_VBAR .vbar_base[0] = HI_MMIO_START + 0x20134000UL, .vbar_base[4] = HI_MMIO_START + 0x20200000UL #define AUDIO_DEVICE_0_VBAR .vbar_base[0] = HI_MMIO_START + 0x20134000UL, \
.vbar_base[4] = HI_MMIO_START + 0x20200000UL
#define SMBUS_0_VBAR .vbar_base[0] = HI_MMIO_START + 0x20300000UL #define SMBUS_0_VBAR .vbar_base[0] = HI_MMIO_START + 0x20300000UL
#define NON_VOLATILE_MEMORY_CONTROLLER_0_VBAR .vbar_base[0] = HI_MMIO_START + 0x20304000UL #define NON_VOLATILE_MEMORY_CONTROLLER_0_VBAR .vbar_base[0] = HI_MMIO_START + 0x20304000UL
#define ETHERNET_CONTROLLER_0_VBAR \ #define ETHERNET_CONTROLLER_0_VBAR .vbar_base[0] = HI_MMIO_START + 0x20400000UL, \
.vbar_base[0] = HI_MMIO_START + 0x20400000UL, .vbar_base[3] = HI_MMIO_START + 0x20500000UL .vbar_base[3] = HI_MMIO_START + 0x20500000UL
#endif /* VBAR_BASE_H_ */ #endif /* VBAR_BASE_H_ */

View File

@ -10,204 +10,150 @@
#include <asm/pgtable.h> #include <asm/pgtable.h>
#include <schedule.h> #include <schedule.h>
extern struct pt_intx_config vm0_pt_intx[1U]; extern struct pt_intx_config vm0_pt_intx[1U];
extern struct acrn_vm_pci_dev_config sos_pci_devs[CONFIG_MAX_PCI_DEV_NUM]; extern struct acrn_vm_pci_dev_config service_vm_pci_devs[CONFIG_MAX_PCI_DEV_NUM];
struct acrn_vm_config vm_configs[CONFIG_MAX_VM_NUM] = { struct acrn_vm_config vm_configs[CONFIG_MAX_VM_NUM] = {
{ {/* Static configured VM0 */
/* Static configured VM0 */ CONFIG_SAFETY_VM,
CONFIG_SAFETY_VM, .name = "SAFETY_VM0",
.name = "SAFETY_VM0", .vm_prio = PRIO_LOW,
.vm_prio = PRIO_LOW, .guest_flags = GUEST_FLAG_STATIC_VM,
.guest_flags = GUEST_FLAG_STATIC_VM, .cpu_affinity = VM0_CONFIG_CPU_AFFINITY,
.cpu_affinity = VM0_CONFIG_CPU_AFFINITY, .memory = {
.memory = .start_hpa = VM0_CONFIG_MEM_START_HPA,
{ .size = VM0_CONFIG_MEM_SIZE,
.start_hpa = VM0_CONFIG_MEM_START_HPA, .start_hpa2 = VM0_CONFIG_MEM_START_HPA2,
.size = VM0_CONFIG_MEM_SIZE, .size_hpa2 = VM0_CONFIG_MEM_SIZE_HPA2,
.start_hpa2 = VM0_CONFIG_MEM_START_HPA2, },
.size_hpa2 = VM0_CONFIG_MEM_SIZE_HPA2, .os_config = {
}, .name = "Zephyr",
.os_config = .kernel_type = KERNEL_ELF,
{ .kernel_mod_tag = "Zephyr_ElfImage",
.name = "Zephyr", .ramdisk_mod_tag = "",
.kernel_type = KERNEL_ELF, },
.kernel_mod_tag = "Zephyr_ElfImage", .acpi_config = {
.ramdisk_mod_tag = "", .acpi_mod_tag = "ACPI_VM0",
}, },
.acpi_config = .vuart[0] = {
{ .type = VUART_LEGACY_PIO,
.acpi_mod_tag = "ACPI_VM0", .addr.port_base = 0x3F8U,
}, .irq = 4U,
.vuart[0] = },
{ .vuart[1] = {
.type = VUART_LEGACY_PIO, .type = VUART_LEGACY_PIO,
.addr.port_base = 0x3F8U, .addr.port_base = 0x2F8U,
.irq = 4U, .irq = 3U,
}, .t_vuart.vm_id = 1U,
.vuart[1] = .t_vuart.vuart_id = 1U,
{ },
.type = VUART_LEGACY_PIO,
.addr.port_base = 0x2F8U,
.irq = 3U,
.t_vuart.vm_id = 1U,
.t_vuart.vuart_id = 1U,
},
#ifdef VM0_PASSTHROUGH_TPM #ifdef VM0_PASSTHROUGH_TPM
.pt_tpm2 = true, .pt_tpm2 = true,
.mmiodevs[0] = .mmiodevs[0] = {
{ .name = "tpm2",
.name = "tpm2", .res[0] = {
.res[0] = .user_vm_pa = VM0_TPM_BUFFER_BASE_ADDR_GPA,
{ .host_pa = VM0_TPM_BUFFER_BASE_ADDR,
.user_vm_pa = VM0_TPM_BUFFER_BASE_ADDR_GPA, .size = VM0_TPM_BUFFER_SIZE,
.host_pa = VM0_TPM_BUFFER_BASE_ADDR, .mem_type = EPT_UNCACHED,
.size = VM0_TPM_BUFFER_SIZE, },
.mem_type = EPT_UNCACHED, .res[1] = {
}, .user_vm_pa = VM0_TPM_EVENTLOG_BASE_ADDR,
.res[1] = .host_pa = VM0_TPM_EVENTLOG_BASE_ADDR_HPA,
{ .size = VM0_TPM_EVENTLOG_SIZE,
.user_vm_pa = VM0_TPM_EVENTLOG_BASE_ADDR, .mem_type = EPT_WB,
.host_pa = VM0_TPM_EVENTLOG_BASE_ADDR_HPA, },
.size = VM0_TPM_EVENTLOG_SIZE, },
.mem_type = EPT_WB,
},
},
#endif #endif
#ifdef P2SB_BAR_ADDR #ifdef P2SB_BAR_ADDR
.pt_p2sb_bar = true, .pt_p2sb_bar = true,
.mmiodevs[0] = .mmiodevs[0] = {
{ .res[0] = {
.res[0] = .user_vm_pa = P2SB_BAR_ADDR_GPA,
{ .host_pa = P2SB_BAR_ADDR,
.user_vm_pa = P2SB_BAR_ADDR_GPA, .size = P2SB_BAR_SIZE,
.host_pa = P2SB_BAR_ADDR, },
.size = P2SB_BAR_SIZE, },
},
},
#endif #endif
.pt_intx_num = 0, .pt_intx_num = 0,
.pt_intx = vm0_pt_intx, .pt_intx = vm0_pt_intx,
}, },
{ {/* Static configured VM1 */
/* Static configured VM1 */ CONFIG_SERVICE_VM,
CONFIG_SERVICE_VM, .name = "ACRN_Service_VM",
.name = "ACRN_Service_VM", /* Allow Service VM to reboot the system since it is the highest priority VM. */
/* Allow Service VM to reboot the system since it is the highest priority VM. */ .vm_prio = PRIO_LOW,
.vm_prio = PRIO_LOW, .guest_flags = GUEST_FLAG_STATIC_VM,
.guest_flags = GUEST_FLAG_STATIC_VM, .cpu_affinity = SERVICE_VM_CONFIG_CPU_AFFINITY,
.cpu_affinity = SERVICE_VM_CONFIG_CPU_AFFINITY, .memory = {
.memory = .start_hpa = 0UL,
{ },
.start_hpa = 0UL, .os_config = {
}, .name = "ACRN Service VM OS",
.os_config = .kernel_type = KERNEL_BZIMAGE,
{ .kernel_mod_tag = "Linux_bzImage",
.name = "ACRN Service OS", .ramdisk_mod_tag = "",
.kernel_type = KERNEL_BZIMAGE, .bootargs = SERVICE_VM_OS_BOOTARGS,
.kernel_mod_tag = "Linux_bzImage", },
.ramdisk_mod_tag = "", .vuart[0] = {
.bootargs = SERVICE_VM_OS_BOOTARGS, .type = VUART_LEGACY_PIO,
}, .addr.port_base = 0x3F8U,
.vuart[0] = .irq = 4U,
{ },
.type = VUART_LEGACY_PIO, .vuart[1] = {
.addr.port_base = 0x3F8U, .type = VUART_LEGACY_PIO,
.irq = 4U, .addr.port_base = 0x2F8U,
}, .irq = 3U,
.vuart[1] = .t_vuart.vm_id = 0U,
{ .t_vuart.vuart_id = 1U,
.type = VUART_LEGACY_PIO, },
.addr.port_base = 0x2F8U, .pci_dev_num = 0U,
.irq = 3U, .pci_devs = service_vm_pci_devs,
.t_vuart.vm_id = 0U, },
.t_vuart.vuart_id = 1U, {/* Static configured VM2 */
}, CONFIG_POST_STD_VM,
.pci_dev_num = 0U, .name = "POST_STD_VM1",
.pci_devs = sos_pci_devs, .vm_prio = PRIO_LOW,
}, .guest_flags = GUEST_FLAG_STATIC_VM,
{ .cpu_affinity = VM2_CONFIG_CPU_AFFINITY,
/* Static configured VM2 */ .vuart[0] = {
CONFIG_POST_STD_VM, .type = VUART_LEGACY_PIO,
.name = "POST_STD_VM1", .addr.port_base = 0x3F8U,
.vm_prio = PRIO_LOW, .irq = 4U,
.guest_flags = GUEST_FLAG_STATIC_VM, },
.cpu_affinity = VM2_CONFIG_CPU_AFFINITY, .vuart[1] = {
.vuart[0] = .type = VUART_LEGACY_PIO,
{ },
.type = VUART_LEGACY_PIO, },
.addr.port_base = 0x3F8U, {/* Static configured VM3 */
.irq = 4U, CONFIG_POST_STD_VM,
}, .name = "POST_STD_VM2",
.vuart[1] = .vm_prio = PRIO_LOW,
{ .guest_flags = GUEST_FLAG_STATIC_VM,
.type = VUART_LEGACY_PIO, .cpu_affinity = VM3_CONFIG_CPU_AFFINITY,
}, .vuart[0] = {
}, .type = VUART_LEGACY_PIO,
{ .addr.port_base = 0x3F8U,
/* Static configured VM3 */ .irq = 4U,
CONFIG_POST_STD_VM, },
.name = "POST_STD_VM2", .vuart[1] = {
.vm_prio = PRIO_LOW, .type = VUART_LEGACY_PIO,
.guest_flags = GUEST_FLAG_STATIC_VM, },
.cpu_affinity = VM3_CONFIG_CPU_AFFINITY, },
.vuart[0] = {/* Dynamic configured VM4 */
{ CONFIG_POST_STD_VM,
.type = VUART_LEGACY_PIO, }
.addr.port_base = 0x3F8U, ,
.irq = 4U, {/* Dynamic configured VM5 */
}, CONFIG_POST_STD_VM,
.vuart[1] = }
{ ,
.type = VUART_LEGACY_PIO, {/* Dynamic configured VM6 */
}, CONFIG_POST_STD_VM,
}, }
{ ,
/* Dynamic configured VM4 */ {/* Dynamic configured VM7 */
CONFIG_POST_STD_VM, CONFIG_POST_STD_VM,
}, }
{
/* Dynamic configured VM5 */
CONFIG_POST_STD_VM,
},
{
/* Dynamic configured VM6 */
CONFIG_POST_STD_VM,
},
{
/* Dynamic configured VM7 */
CONFIG_POST_STD_VM,
},
{
/* Dynamic configured VM8 */
CONFIG_POST_STD_VM,
},
{
/* Dynamic configured VM9 */
CONFIG_POST_STD_VM,
},
{
/* Dynamic configured VM10 */
CONFIG_POST_STD_VM,
},
{
/* Dynamic configured VM11 */
CONFIG_POST_STD_VM,
},
{
/* Dynamic configured VM12 */
CONFIG_POST_STD_VM,
},
{
/* Dynamic configured VM13 */
CONFIG_POST_STD_VM,
},
{
/* Dynamic configured VM14 */
CONFIG_POST_STD_VM,
},
{
/* Dynamic configured VM15 */
CONFIG_POST_STD_VM,
}
}; };

View File

@ -10,19 +10,17 @@
#include <misc_cfg.h> #include <misc_cfg.h>
#include <pci_devices.h> #include <pci_devices.h>
/* SERVICE_VM_NUM can only be 0 or 1; When SERVICE_VM_NUM is 1, MAX_POST_VM_NUM must be 0 too. */ /* SERVICE_VM_NUM can only be 0 or 1; When SERVICE_VM_NUM is 1, MAX_POST_VM_NUM must be 0 too. */
#define PRE_VM_NUM 1U #define PRE_VM_NUM 1U
#define SERVICE_VM_NUM 1U #define SERVICE_VM_NUM 1U
#define MAX_POST_VM_NUM 14U #define MAX_POST_VM_NUM 6U
#define CONFIG_MAX_VM_NUM 16U #define CONFIG_MAX_VM_NUM 8U
/* Bitmask of guest flags that can be programmed by device model. Other bits are set by hypervisor only. */ /* Bitmask of guest flags that can be programmed by device model. Other bits are set by hypervisor only. */
#define DM_OWNED_GUEST_FLAG_MASK \ #define DM_OWNED_GUEST_FLAG_MASK (GUEST_FLAG_SECURE_WORLD_ENABLED | GUEST_FLAG_LAPIC_PASSTHROUGH | GUEST_FLAG_RT | GUEST_FLAG_IO_COMPLETION_POLLING)
(GUEST_FLAG_SECURE_WORLD_ENABLED | GUEST_FLAG_LAPIC_PASSTHROUGH | GUEST_FLAG_RT | \ #define VM0_CONFIG_MEM_START_HPA 0x100000000UL
GUEST_FLAG_IO_COMPLETION_POLLING | GUEST_FLAG_SECURITY_VM) #define VM0_CONFIG_MEM_SIZE 0x20000000UL
#define VM0_CONFIG_MEM_START_HPA 0x100000000UL #define VM0_CONFIG_MEM_START_HPA2 0x0UL
#define VM0_CONFIG_MEM_SIZE 0x20000000UL #define VM0_CONFIG_MEM_SIZE_HPA2 0x0UL
#define VM0_CONFIG_MEM_START_HPA2 0x0UL
#define VM0_CONFIG_MEM_SIZE_HPA2 0x0UL
/* SERVICE_VM == VM1 */ /* SERVICE_VM == VM1 */
#define SERVICE_VM_OS_BOOTARGS SERVICE_VM_ROOTFS SERVICE_VM_OS_CONSOLE SERVICE_VM_IDLE SERVICE_VM_BOOTARGS_DIFF #define SERVICE_VM_OS_BOOTARGS SERVICE_VM_ROOTFS SERVICE_VM_OS_CONSOLE SERVICE_VM_IDLE SERVICE_VM_BOOTARGS_DIFF
#endif /* VM_CONFIGURATIONS_H */ #endif /* VM_CONFIGURATIONS_H */

View File

@ -7,4 +7,5 @@
#ifndef IVSHMEM_CFG_H #ifndef IVSHMEM_CFG_H
#define IVSHMEM_CFG_H #define IVSHMEM_CFG_H
#endif /* IVSHMEM_CFG_H */ #endif /* IVSHMEM_CFG_H */

View File

@ -7,29 +7,25 @@
#ifndef MISC_CFG_H #ifndef MISC_CFG_H
#define MISC_CFG_H #define MISC_CFG_H
#define VM0_CONFIG_CPU_AFFINITY (AFFINITY_CPU(0U) | AFFINITY_CPU(2U)) #define VM0_CONFIG_CPU_AFFINITY (AFFINITY_CPU(0U)|AFFINITY_CPU(2U))
#define VM1_CONFIG_CPU_AFFINITY (AFFINITY_CPU(1U) | AFFINITY_CPU(3U)) #define VM1_CONFIG_CPU_AFFINITY (AFFINITY_CPU(1U)|AFFINITY_CPU(3U))
#ifdef CONFIG_RDT_ENABLED #ifdef CONFIG_RDT_ENABLED
#define HV_SUPPORTED_MAX_CLOS 0U #define HV_SUPPORTED_MAX_CLOS 0U
#define MAX_MBA_CLOS_NUM_ENTRIES 0U #define MAX_MBA_CLOS_NUM_ENTRIES 0U
#define MAX_CACHE_CLOS_NUM_ENTRIES 0U #define MAX_CACHE_CLOS_NUM_ENTRIES 0U
#define CLOS_MASK_0 0xfffffU #define CLOS_MASK_0 0xfffffU
#define CLOS_MASK_1 0xfffffU #define CLOS_MASK_1 0xfffffU
#define CLOS_MASK_2 0xfffffU #define CLOS_MASK_2 0xfffffU
#define CLOS_MASK_3 0xfffffU #define CLOS_MASK_3 0xfffffU
#define CLOS_MASK_4 0xfffffU #define CLOS_MASK_4 0xfffffU
#define CLOS_MASK_5 0xfffffU #define CLOS_MASK_5 0xfffffU
#define CLOS_MASK_6 0xfffffU #define CLOS_MASK_6 0xfffffU
#define CLOS_MASK_7 0xfffffU #define CLOS_MASK_7 0xfffffU
#endif #endif
#define VM0_CONFIG_PCI_DEV_NUM 3U #define VM0_CONFIG_PCI_DEV_NUM 3U
#define VM1_CONFIG_PCI_DEV_NUM 2U #define VM1_CONFIG_PCI_DEV_NUM 2U
#define VM0_BOOT_ARGS \ #define VM0_BOOT_ARGS "rw rootwait root=/dev/sda3 console=ttyS0 noxsave nohpet no_timer_check ignore_loglevel log_buf_len=16M consoleblank=0 tsc=reliable reboot=acpi "
"rw rootwait root=/dev/sda3 console=ttyS0 noxsave nohpet no_timer_check ignore_loglevel log_buf_len=16M " \ #define VM1_BOOT_ARGS "rw rootwait root=/dev/sda2 console=ttyS0 noxsave nohpet no_timer_check ignore_loglevel log_buf_len=16M consoleblank=0 tsc=reliable reboot=acpi "
"consoleblank=0 tsc=reliable reboot=acpi "
#define VM1_BOOT_ARGS \
"rw rootwait root=/dev/sda2 console=ttyS0 noxsave nohpet no_timer_check ignore_loglevel log_buf_len=16M " \
"consoleblank=0 tsc=reliable reboot=acpi "
#endif /* MISC_CFG_H */ #endif /* MISC_CFG_H */

View File

@ -10,72 +10,60 @@
#include <asm/page.h> #include <asm/page.h>
#include <vmcs9900.h> #include <vmcs9900.h>
#include <ivshmem_cfg.h> #include <ivshmem_cfg.h>
#define INVALID_PCI_BASE 0U #define INVALID_PCI_BASE 0U
struct acrn_vm_pci_dev_config vm0_pci_devs[VM0_CONFIG_PCI_DEV_NUM] = { struct acrn_vm_pci_dev_config vm0_pci_devs[VM0_CONFIG_PCI_DEV_NUM] = {
{ {
.emu_type = PCI_DEV_TYPE_HVEMUL, .emu_type = PCI_DEV_TYPE_HVEMUL,
.vdev_ops = &vhostbridge_ops, .vdev_ops = &vhostbridge_ops,
.vbdf.bits = {.b = 0x00U, .d = 0x00U, .f = 0x00U}, .vbdf.bits = {.b = 0x00U, .d = 0x00U, .f = 0x00U},
}, },
{ {
.emu_type = PCI_DEV_TYPE_PTDEV, .emu_type = PCI_DEV_TYPE_PTDEV,
.vbdf.bits = .vbdf.bits = {.b = 0x00U,
{ .d = 0x01U,
.b = 0x00U, .f = 0x00U,
.d = 0x01U, },
.f = 0x00U, .pbdf.bits = {.b = 0x00U,
}, .d = 0x17U,
.pbdf.bits = .f = 0x00U,
{ },
.b = 0x00U, .vbar_base[0] = 0x80104000UL,
.d = 0x17U, .vbar_base[5] = 0x80106000UL,
.f = 0x00U, .vbar_base[1] = 0x80107000UL,
}, .vbar_base[4] = 0x3060UL,
.vbar_base[0] = 0x80104000UL, .vbar_base[3] = 0x3080UL,
.vbar_base[5] = 0x80106000UL, .vbar_base[2] = 0x3090UL,
.vbar_base[1] = 0x80107000UL, },
.vbar_base[4] = 0x3060UL, {
.vbar_base[3] = 0x3080UL, .emu_type = PCI_DEV_TYPE_PTDEV,
.vbar_base[2] = 0x3090UL, .vbdf.bits = {.b = 0x00U,
}, .d = 0x02U,
{ .f = 0x00U,
.emu_type = PCI_DEV_TYPE_PTDEV, },
.vbdf.bits = .pbdf.bits = {.b = 0x58U,
{ .d = 0x00U,
.b = 0x00U, .f = 0x00U,
.d = 0x02U, },
.f = 0x00U, .vbar_base[0] = 0x80000000UL,
}, .vbar_base[3] = 0x80100000UL,
.pbdf.bits = },
{
.b = 0x58U,
.d = 0x00U,
.f = 0x00U,
},
.vbar_base[0] = 0x80000000UL,
.vbar_base[3] = 0x80100000UL,
},
}; };
struct acrn_vm_pci_dev_config vm1_pci_devs[VM1_CONFIG_PCI_DEV_NUM] = { struct acrn_vm_pci_dev_config vm1_pci_devs[VM1_CONFIG_PCI_DEV_NUM] = {
{ {
.emu_type = PCI_DEV_TYPE_HVEMUL, .emu_type = PCI_DEV_TYPE_HVEMUL,
.vdev_ops = &vhostbridge_ops, .vdev_ops = &vhostbridge_ops,
.vbdf.bits = {.b = 0x00U, .d = 0x00U, .f = 0x00U}, .vbdf.bits = {.b = 0x00U, .d = 0x00U, .f = 0x00U},
}, },
{ {
.emu_type = PCI_DEV_TYPE_PTDEV, .emu_type = PCI_DEV_TYPE_PTDEV,
.vbdf.bits = .vbdf.bits = {.b = 0x00U,
{ .d = 0x01U,
.b = 0x00U, .f = 0x00U,
.d = 0x01U, },
.f = 0x00U, .pbdf.bits = {.b = 0x00U,
}, .d = 0x14U,
.pbdf.bits = .f = 0x00U,
{ },
.b = 0x00U, .vbar_base[0] = 0x80000000UL,
.d = 0x14U, },
.f = 0x00U,
},
.vbar_base[0] = 0x80000000UL,
},
}; };

View File

@ -5,6 +5,9 @@
*/ */
#include <asm/vm_config.h> #include <asm/vm_config.h>
struct pt_intx_config vm0_pt_intx[1U] = {}; struct pt_intx_config vm0_pt_intx[1U] = {
};
struct pt_intx_config vm1_pt_intx[1U] = {
};
struct pt_intx_config vm1_pt_intx[1U] = {};

View File

@ -7,42 +7,46 @@
#ifndef VBAR_BASE_H_ #ifndef VBAR_BASE_H_
#define VBAR_BASE_H_ #define VBAR_BASE_H_
#define VGA_COMPATIBLE_CONTROLLER_0_VBAR \ #define VGA_COMPATIBLE_CONTROLLER_0_VBAR .vbar_base[0] = HI_MMIO_START + 0x0UL, \
.vbar_base[0] = HI_MMIO_START + 0x0UL, .vbar_base[2] = HI_MMIO_START + 0x10000000UL .vbar_base[2] = HI_MMIO_START + 0x10000000UL
#define SYSTEM_PERIPHERAL_0_VBAR .vbar_base[0] = HI_MMIO_START + 0x20000000UL #define SYSTEM_PERIPHERAL_0_VBAR .vbar_base[0] = HI_MMIO_START + 0x20000000UL
#define USB_CONTROLLER_0_VBAR .vbar_base[0] = HI_MMIO_START + 0x20010000UL #define USB_CONTROLLER_0_VBAR .vbar_base[0] = HI_MMIO_START + 0x20010000UL
#define USB_CONTROLLER_1_VBAR .vbar_base[0] = HI_MMIO_START + 0x20040000UL, .vbar_base[2] = HI_MMIO_START + 0x20080000UL #define USB_CONTROLLER_1_VBAR .vbar_base[0] = HI_MMIO_START + 0x20040000UL, \
.vbar_base[2] = HI_MMIO_START + 0x20080000UL
#define USB_CONTROLLER_2_VBAR .vbar_base[0] = HI_MMIO_START + 0x200c0000UL, .vbar_base[2] = HI_MMIO_START + 0x20100000UL #define USB_CONTROLLER_2_VBAR .vbar_base[0] = HI_MMIO_START + 0x200c0000UL, \
.vbar_base[2] = HI_MMIO_START + 0x20100000UL
#define USB_CONTROLLER_3_VBAR .vbar_base[0] = HI_MMIO_START + 0x20110000UL #define USB_CONTROLLER_3_VBAR .vbar_base[0] = HI_MMIO_START + 0x20110000UL
#define RAM_MEMORY_0_VBAR .vbar_base[0] = HI_MMIO_START + 0x20120000UL, .vbar_base[2] = HI_MMIO_START + 0x20124000UL #define RAM_MEMORY_0_VBAR .vbar_base[0] = HI_MMIO_START + 0x20120000UL, \
.vbar_base[2] = HI_MMIO_START + 0x20124000UL
#define NETWORK_CONTROLLER_0_VBAR .vbar_base[0] = HI_MMIO_START + 0x20128000UL #define NETWORK_CONTROLLER_0_VBAR .vbar_base[0] = HI_MMIO_START + 0x20128000UL
#define SERIAL_BUS_CONTROLLER_0_VBAR .vbar_base[0] = HI_MMIO_START + 0x2012c000UL #define SERIAL_BUS_CONTROLLER_0_VBAR .vbar_base[0] = HI_MMIO_START + 0x2012c000UL
#define SERIAL_BUS_CONTROLLER_1_VBAR .vbar_base[0] = HI_MMIO_START + 0x2012d000UL #define SERIAL_BUS_CONTROLLER_1_VBAR .vbar_base[0] = HI_MMIO_START + 0x2012d000UL
#define SERIAL_BUS_CONTROLLER_2_VBAR .vbar_base[0] = HI_MMIO_START + 0x20301000UL #define SERIAL_BUS_CONTROLLER_2_VBAR .vbar_base[0] = HI_MMIO_START + 0x20301000UL
#define COMMUNICATION_CONTROLLER_0_VBAR .vbar_base[0] = HI_MMIO_START + 0x2012e000UL #define COMMUNICATION_CONTROLLER_0_VBAR .vbar_base[0] = HI_MMIO_START + 0x2012e000UL
#define SATA_CONTROLLER_0_VBAR \ #define SATA_CONTROLLER_0_VBAR .vbar_base[0] = HI_MMIO_START + 0x20130000UL, \
.vbar_base[0] = HI_MMIO_START + 0x20130000UL, .vbar_base[1] = HI_MMIO_START + 0x20132000UL, \ .vbar_base[1] = HI_MMIO_START + 0x20132000UL, \
.vbar_base[5] = HI_MMIO_START + 0x20132800UL .vbar_base[5] = HI_MMIO_START + 0x20132800UL
#define AUDIO_DEVICE_0_VBAR .vbar_base[0] = HI_MMIO_START + 0x20134000UL, .vbar_base[4] = HI_MMIO_START + 0x20200000UL #define AUDIO_DEVICE_0_VBAR .vbar_base[0] = HI_MMIO_START + 0x20134000UL, \
.vbar_base[4] = HI_MMIO_START + 0x20200000UL
#define SMBUS_0_VBAR .vbar_base[0] = HI_MMIO_START + 0x20300000UL #define SMBUS_0_VBAR .vbar_base[0] = HI_MMIO_START + 0x20300000UL
#define NON_VOLATILE_MEMORY_CONTROLLER_0_VBAR .vbar_base[0] = HI_MMIO_START + 0x20304000UL #define NON_VOLATILE_MEMORY_CONTROLLER_0_VBAR .vbar_base[0] = HI_MMIO_START + 0x20304000UL
#define ETHERNET_CONTROLLER_0_VBAR \ #define ETHERNET_CONTROLLER_0_VBAR .vbar_base[0] = HI_MMIO_START + 0x20400000UL, \
.vbar_base[0] = HI_MMIO_START + 0x20400000UL, .vbar_base[3] = HI_MMIO_START + 0x20500000UL .vbar_base[3] = HI_MMIO_START + 0x20500000UL
#endif /* VBAR_BASE_H_ */ #endif /* VBAR_BASE_H_ */

View File

@ -10,189 +10,140 @@
#include <asm/pgtable.h> #include <asm/pgtable.h>
#include <schedule.h> #include <schedule.h>
extern struct acrn_vm_pci_dev_config vm0_pci_devs[VM0_CONFIG_PCI_DEV_NUM]; extern struct acrn_vm_pci_dev_config vm0_pci_devs[VM0_CONFIG_PCI_DEV_NUM];
extern struct pt_intx_config vm0_pt_intx[1U]; extern struct pt_intx_config vm0_pt_intx[1U];
extern struct acrn_vm_pci_dev_config vm1_pci_devs[VM1_CONFIG_PCI_DEV_NUM]; extern struct acrn_vm_pci_dev_config vm1_pci_devs[VM1_CONFIG_PCI_DEV_NUM];
extern struct pt_intx_config vm1_pt_intx[1U]; extern struct pt_intx_config vm1_pt_intx[1U];
struct acrn_vm_config vm_configs[CONFIG_MAX_VM_NUM] = { struct acrn_vm_config vm_configs[CONFIG_MAX_VM_NUM] = {
{ {/* Static configured VM0 */
/* Static configured VM0 */ CONFIG_PRE_STD_VM,
CONFIG_PRE_STD_VM, .name = "PRE_STD_VM0",
.name = "PRE_STD_VM0", .vm_prio = PRIO_LOW,
.vm_prio = PRIO_LOW, .guest_flags = GUEST_FLAG_STATIC_VM,
.guest_flags = GUEST_FLAG_STATIC_VM, .cpu_affinity = VM0_CONFIG_CPU_AFFINITY,
.cpu_affinity = VM0_CONFIG_CPU_AFFINITY, .memory = {
.memory = .start_hpa = VM0_CONFIG_MEM_START_HPA,
{ .size = VM0_CONFIG_MEM_SIZE,
.start_hpa = VM0_CONFIG_MEM_START_HPA, .start_hpa2 = VM0_CONFIG_MEM_START_HPA2,
.size = VM0_CONFIG_MEM_SIZE, .size_hpa2 = VM0_CONFIG_MEM_SIZE_HPA2,
.start_hpa2 = VM0_CONFIG_MEM_START_HPA2, },
.size_hpa2 = VM0_CONFIG_MEM_SIZE_HPA2, .os_config = {
}, .name = "YOCTO",
.os_config = .kernel_type = KERNEL_BZIMAGE,
{ .kernel_mod_tag = "Linux_bzImage",
.name = "YOCTO", .ramdisk_mod_tag = "",
.kernel_type = KERNEL_BZIMAGE, .bootargs = VM0_BOOT_ARGS,
.kernel_mod_tag = "Linux_bzImage", },
.ramdisk_mod_tag = "", .acpi_config = {
.bootargs = VM0_BOOT_ARGS, .acpi_mod_tag = "ACPI_VM0",
}, },
.acpi_config = .vuart[0] = {
{ .type = VUART_LEGACY_PIO,
.acpi_mod_tag = "ACPI_VM0", .addr.port_base = 0x3F8U,
}, .irq = 4U,
.vuart[0] = },
{ .vuart[1] = {
.type = VUART_LEGACY_PIO, .type = VUART_LEGACY_PIO,
.addr.port_base = 0x3F8U, .addr.port_base = 0x2F8U,
.irq = 4U, .irq = 3U,
}, .t_vuart.vm_id = 1U,
.vuart[1] = .t_vuart.vuart_id = 1U,
{ },
.type = VUART_LEGACY_PIO, .pci_dev_num = VM0_CONFIG_PCI_DEV_NUM,
.addr.port_base = 0x2F8U, .pci_devs = vm0_pci_devs,
.irq = 3U,
.t_vuart.vm_id = 1U,
.t_vuart.vuart_id = 1U,
},
.pci_dev_num = VM0_CONFIG_PCI_DEV_NUM,
.pci_devs = vm0_pci_devs,
#ifdef VM0_PASSTHROUGH_TPM #ifdef VM0_PASSTHROUGH_TPM
.pt_tpm2 = true, .pt_tpm2 = true,
.mmiodevs[0] = .mmiodevs[0] = {
{ .name = "tpm2",
.name = "tpm2", .res[0] = {
.res[0] = .user_vm_pa = VM0_TPM_BUFFER_BASE_ADDR_GPA,
{ .host_pa = VM0_TPM_BUFFER_BASE_ADDR,
.user_vm_pa = VM0_TPM_BUFFER_BASE_ADDR_GPA, .size = VM0_TPM_BUFFER_SIZE,
.host_pa = VM0_TPM_BUFFER_BASE_ADDR, .mem_type = EPT_UNCACHED,
.size = VM0_TPM_BUFFER_SIZE, },
.mem_type = EPT_UNCACHED, .res[1] = {
}, .user_vm_pa = VM0_TPM_EVENTLOG_BASE_ADDR,
.res[1] = .host_pa = VM0_TPM_EVENTLOG_BASE_ADDR_HPA,
{ .size = VM0_TPM_EVENTLOG_SIZE,
.user_vm_pa = VM0_TPM_EVENTLOG_BASE_ADDR, .mem_type = EPT_WB,
.host_pa = VM0_TPM_EVENTLOG_BASE_ADDR_HPA, },
.size = VM0_TPM_EVENTLOG_SIZE, },
.mem_type = EPT_WB,
},
},
#endif #endif
#ifdef P2SB_BAR_ADDR #ifdef P2SB_BAR_ADDR
.pt_p2sb_bar = true, .pt_p2sb_bar = true,
.mmiodevs[0] = .mmiodevs[0] = {
{ .res[0] = {
.res[0] = .user_vm_pa = P2SB_BAR_ADDR_GPA,
{ .host_pa = P2SB_BAR_ADDR,
.user_vm_pa = P2SB_BAR_ADDR_GPA, .size = P2SB_BAR_SIZE,
.host_pa = P2SB_BAR_ADDR, },
.size = P2SB_BAR_SIZE, },
},
},
#endif #endif
.pt_intx_num = 0, .pt_intx_num = 0,
.pt_intx = vm0_pt_intx, .pt_intx = vm0_pt_intx,
}, },
{ {/* Static configured VM1 */
/* Static configured VM1 */ CONFIG_PRE_STD_VM,
CONFIG_PRE_STD_VM, .name = "PRE_STD_VM1",
.name = "PRE_STD_VM1", .vm_prio = PRIO_LOW,
.vm_prio = PRIO_LOW, .guest_flags = GUEST_FLAG_STATIC_VM,
.guest_flags = GUEST_FLAG_STATIC_VM, .cpu_affinity = VM1_CONFIG_CPU_AFFINITY,
.cpu_affinity = VM1_CONFIG_CPU_AFFINITY, .memory = {
.memory = .start_hpa = VM1_CONFIG_MEM_START_HPA,
{ .size = VM1_CONFIG_MEM_SIZE,
.start_hpa = VM1_CONFIG_MEM_START_HPA, .start_hpa2 = VM1_CONFIG_MEM_START_HPA2,
.size = VM1_CONFIG_MEM_SIZE, .size_hpa2 = VM1_CONFIG_MEM_SIZE_HPA2,
.start_hpa2 = VM1_CONFIG_MEM_START_HPA2, },
.size_hpa2 = VM1_CONFIG_MEM_SIZE_HPA2, .os_config = {
}, .name = "YOCTO",
.os_config = .kernel_type = KERNEL_BZIMAGE,
{ .kernel_mod_tag = "Linux_bzImage",
.name = "YOCTO", .ramdisk_mod_tag = "",
.kernel_type = KERNEL_BZIMAGE, .bootargs = VM1_BOOT_ARGS,
.kernel_mod_tag = "Linux_bzImage", },
.ramdisk_mod_tag = "", .acpi_config = {
.bootargs = VM1_BOOT_ARGS, .acpi_mod_tag = "ACPI_VM1",
}, },
.acpi_config = .vuart[0] = {
{ .type = VUART_LEGACY_PIO,
.acpi_mod_tag = "ACPI_VM1", .addr.port_base = 0x3F8U,
}, .irq = 4U,
.vuart[0] = },
{ .vuart[1] = {
.type = VUART_LEGACY_PIO, .type = VUART_LEGACY_PIO,
.addr.port_base = 0x3F8U, .addr.port_base = 0x2F8U,
.irq = 4U, .irq = 3U,
}, .t_vuart.vm_id = 0U,
.vuart[1] = .t_vuart.vuart_id = 1U,
{ },
.type = VUART_LEGACY_PIO, .pci_dev_num = VM1_CONFIG_PCI_DEV_NUM,
.addr.port_base = 0x2F8U, .pci_devs = vm1_pci_devs,
.irq = 3U, .pt_intx_num = 0,
.t_vuart.vm_id = 0U, .pt_intx = vm1_pt_intx,
.t_vuart.vuart_id = 1U, },
}, {/* Dynamic configured VM2 */
.pci_dev_num = VM1_CONFIG_PCI_DEV_NUM, CONFIG_POST_STD_VM,
.pci_devs = vm1_pci_devs, }
.pt_intx_num = 0, ,
.pt_intx = vm1_pt_intx, {/* Dynamic configured VM3 */
}, CONFIG_POST_STD_VM,
{ }
/* Dynamic configured VM2 */ ,
CONFIG_POST_STD_VM, {/* Dynamic configured VM4 */
}, CONFIG_POST_STD_VM,
{ }
/* Dynamic configured VM3 */ ,
CONFIG_POST_STD_VM, {/* Dynamic configured VM5 */
}, CONFIG_POST_STD_VM,
{ }
/* Dynamic configured VM4 */ ,
CONFIG_POST_STD_VM, {/* Dynamic configured VM6 */
}, CONFIG_POST_STD_VM,
{ }
/* Dynamic configured VM5 */ ,
CONFIG_POST_STD_VM, {/* Dynamic configured VM7 */
}, CONFIG_POST_STD_VM,
{ }
/* Dynamic configured VM6 */
CONFIG_POST_STD_VM,
},
{
/* Dynamic configured VM7 */
CONFIG_POST_STD_VM,
},
{
/* Dynamic configured VM8 */
CONFIG_POST_STD_VM,
},
{
/* Dynamic configured VM9 */
CONFIG_POST_STD_VM,
},
{
/* Dynamic configured VM10 */
CONFIG_POST_STD_VM,
},
{
/* Dynamic configured VM11 */
CONFIG_POST_STD_VM,
},
{
/* Dynamic configured VM12 */
CONFIG_POST_STD_VM,
},
{
/* Dynamic configured VM13 */
CONFIG_POST_STD_VM,
},
{
/* Dynamic configured VM14 */
CONFIG_POST_STD_VM,
},
{
/* Dynamic configured VM15 */
CONFIG_POST_STD_VM,
}
}; };

View File

@ -10,18 +10,18 @@
#include <misc_cfg.h> #include <misc_cfg.h>
#include <pci_devices.h> #include <pci_devices.h>
/* SERVICE_VM_NUM can only be 0 or 1; When SERVICE_VM_NUM is 1, MAX_POST_VM_NUM must be 0 too. */ /* SERVICE_VM_NUM can only be 0 or 1; When SERVICE_VM_NUM is 1, MAX_POST_VM_NUM must be 0 too. */
#define PRE_VM_NUM 2U #define PRE_VM_NUM 2U
#define SERVICE_VM_NUM 0U #define SERVICE_VM_NUM 0U
#define MAX_POST_VM_NUM 14U #define MAX_POST_VM_NUM 6U
#define CONFIG_MAX_VM_NUM 16U #define CONFIG_MAX_VM_NUM 8U
#define DM_OWNED_GUEST_FLAG_MASK 0UL #define DM_OWNED_GUEST_FLAG_MASK 0UL
#define VM0_CONFIG_MEM_START_HPA 0x100000000UL #define VM0_CONFIG_MEM_START_HPA 0x100000000UL
#define VM0_CONFIG_MEM_SIZE 0x20000000UL #define VM0_CONFIG_MEM_SIZE 0x20000000UL
#define VM0_CONFIG_MEM_START_HPA2 0x0UL #define VM0_CONFIG_MEM_START_HPA2 0x0UL
#define VM0_CONFIG_MEM_SIZE_HPA2 0x0UL #define VM0_CONFIG_MEM_SIZE_HPA2 0x0UL
#define VM1_CONFIG_MEM_START_HPA 0x120000000UL #define VM1_CONFIG_MEM_START_HPA 0x120000000UL
#define VM1_CONFIG_MEM_SIZE 0x20000000UL #define VM1_CONFIG_MEM_SIZE 0x20000000UL
#define VM1_CONFIG_MEM_START_HPA2 0x0UL #define VM1_CONFIG_MEM_START_HPA2 0x0UL
#define VM1_CONFIG_MEM_SIZE_HPA2 0x0UL #define VM1_CONFIG_MEM_SIZE_HPA2 0x0UL
#endif /* VM_CONFIGURATIONS_H */ #endif /* VM_CONFIGURATIONS_H */

View File

@ -7,4 +7,5 @@
#ifndef IVSHMEM_CFG_H #ifndef IVSHMEM_CFG_H
#define IVSHMEM_CFG_H #define IVSHMEM_CFG_H
#endif /* IVSHMEM_CFG_H */ #endif /* IVSHMEM_CFG_H */

View File

@ -7,30 +7,29 @@
#ifndef MISC_CFG_H #ifndef MISC_CFG_H
#define MISC_CFG_H #define MISC_CFG_H
#define SERVICE_VM_ROOTFS "root=/dev/nvme0n1p3 " #define SERVICE_VM_ROOTFS "root=/dev/nvme0n1p3 "
#define SERVICE_VM_OS_CONSOLE "console=ttyS0 " #define SERVICE_VM_OS_CONSOLE "console=ttyS0 "
#define SERVICE_VM_BOOTARGS_DIFF \ #define SERVICE_VM_BOOTARGS_DIFF "rw rootwait console=tty0 consoleblank=0 no_timer_check quiet loglevel=3 i915.nuclear_pageflip=1 swiotlb=131072 maxcpus=4 hugepagesz=1G hugepages=8 "
"rw rootwait console=tty0 consoleblank=0 no_timer_check quiet loglevel=3 i915.nuclear_pageflip=1 " \ #define SERVICE_VM_CONFIG_CPU_AFFINITY (AFFINITY_CPU(0U)|AFFINITY_CPU(1U)|AFFINITY_CPU(2U)|AFFINITY_CPU(3U))
"swiotlb=131072 maxcpus=4 hugepagesz=1G hugepages=8 " #define VM1_CONFIG_CPU_AFFINITY (AFFINITY_CPU(0U)|AFFINITY_CPU(1U))
#define SERVICE_VM_CONFIG_CPU_AFFINITY (AFFINITY_CPU(0U) | AFFINITY_CPU(1U) | AFFINITY_CPU(2U) | AFFINITY_CPU(3U)) #define VM2_CONFIG_CPU_AFFINITY (AFFINITY_CPU(2U)|AFFINITY_CPU(3U))
#define VM1_CONFIG_CPU_AFFINITY (AFFINITY_CPU(0U) | AFFINITY_CPU(1U)) #define VM3_CONFIG_CPU_AFFINITY (AFFINITY_CPU(0U)|AFFINITY_CPU(1U))
#define VM2_CONFIG_CPU_AFFINITY (AFFINITY_CPU(2U) | AFFINITY_CPU(3U)) #define VM4_CONFIG_CPU_AFFINITY (AFFINITY_CPU(0U)|AFFINITY_CPU(1U))
#define VM3_CONFIG_CPU_AFFINITY (AFFINITY_CPU(0U) | AFFINITY_CPU(1U)) #define VM5_CONFIG_CPU_AFFINITY (AFFINITY_CPU(0U)|AFFINITY_CPU(1U))
#define VM4_CONFIG_CPU_AFFINITY (AFFINITY_CPU(0U) | AFFINITY_CPU(1U)) #define VM6_CONFIG_CPU_AFFINITY (AFFINITY_CPU(0U)|AFFINITY_CPU(1U))
#define VM5_CONFIG_CPU_AFFINITY (AFFINITY_CPU(0U) | AFFINITY_CPU(1U))
#define VM6_CONFIG_CPU_AFFINITY (AFFINITY_CPU(0U) | AFFINITY_CPU(1U))
#ifdef CONFIG_RDT_ENABLED #ifdef CONFIG_RDT_ENABLED
#define HV_SUPPORTED_MAX_CLOS 0U #define HV_SUPPORTED_MAX_CLOS 0U
#define MAX_MBA_CLOS_NUM_ENTRIES 0U #define MAX_MBA_CLOS_NUM_ENTRIES 0U
#define MAX_CACHE_CLOS_NUM_ENTRIES 0U #define MAX_CACHE_CLOS_NUM_ENTRIES 0U
#define CLOS_MASK_0 0xfffffU #define CLOS_MASK_0 0xfffffU
#define CLOS_MASK_1 0xfffffU #define CLOS_MASK_1 0xfffffU
#define CLOS_MASK_2 0xfffffU #define CLOS_MASK_2 0xfffffU
#define CLOS_MASK_3 0xfffffU #define CLOS_MASK_3 0xfffffU
#define CLOS_MASK_4 0xfffffU #define CLOS_MASK_4 0xfffffU
#define CLOS_MASK_5 0xfffffU #define CLOS_MASK_5 0xfffffU
#define CLOS_MASK_6 0xfffffU #define CLOS_MASK_6 0xfffffU
#define CLOS_MASK_7 0xfffffU #define CLOS_MASK_7 0xfffffU
#endif #endif
#endif /* MISC_CFG_H */ #endif /* MISC_CFG_H */

View File

@ -10,5 +10,6 @@
#include <asm/page.h> #include <asm/page.h>
#include <vmcs9900.h> #include <vmcs9900.h>
#include <ivshmem_cfg.h> #include <ivshmem_cfg.h>
#define INVALID_PCI_BASE 0U #define INVALID_PCI_BASE 0U
struct acrn_vm_pci_dev_config sos_pci_devs[CONFIG_MAX_PCI_DEV_NUM] = {}; struct acrn_vm_pci_dev_config service_vm_pci_devs[CONFIG_MAX_PCI_DEV_NUM] = {
};

View File

@ -7,42 +7,46 @@
#ifndef VBAR_BASE_H_ #ifndef VBAR_BASE_H_
#define VBAR_BASE_H_ #define VBAR_BASE_H_
#define VGA_COMPATIBLE_CONTROLLER_0_VBAR \ #define VGA_COMPATIBLE_CONTROLLER_0_VBAR .vbar_base[0] = HI_MMIO_START + 0x0UL, \
.vbar_base[0] = HI_MMIO_START + 0x0UL, .vbar_base[2] = HI_MMIO_START + 0x10000000UL .vbar_base[2] = HI_MMIO_START + 0x10000000UL
#define SYSTEM_PERIPHERAL_0_VBAR .vbar_base[0] = HI_MMIO_START + 0x20000000UL #define SYSTEM_PERIPHERAL_0_VBAR .vbar_base[0] = HI_MMIO_START + 0x20000000UL
#define USB_CONTROLLER_0_VBAR .vbar_base[0] = HI_MMIO_START + 0x20010000UL #define USB_CONTROLLER_0_VBAR .vbar_base[0] = HI_MMIO_START + 0x20010000UL
#define USB_CONTROLLER_1_VBAR .vbar_base[0] = HI_MMIO_START + 0x20040000UL, .vbar_base[2] = HI_MMIO_START + 0x20080000UL #define USB_CONTROLLER_1_VBAR .vbar_base[0] = HI_MMIO_START + 0x20040000UL, \
.vbar_base[2] = HI_MMIO_START + 0x20080000UL
#define USB_CONTROLLER_2_VBAR .vbar_base[0] = HI_MMIO_START + 0x200c0000UL, .vbar_base[2] = HI_MMIO_START + 0x20100000UL #define USB_CONTROLLER_2_VBAR .vbar_base[0] = HI_MMIO_START + 0x200c0000UL, \
.vbar_base[2] = HI_MMIO_START + 0x20100000UL
#define USB_CONTROLLER_3_VBAR .vbar_base[0] = HI_MMIO_START + 0x20110000UL #define USB_CONTROLLER_3_VBAR .vbar_base[0] = HI_MMIO_START + 0x20110000UL
#define RAM_MEMORY_0_VBAR .vbar_base[0] = HI_MMIO_START + 0x20120000UL, .vbar_base[2] = HI_MMIO_START + 0x20124000UL #define RAM_MEMORY_0_VBAR .vbar_base[0] = HI_MMIO_START + 0x20120000UL, \
.vbar_base[2] = HI_MMIO_START + 0x20124000UL
#define NETWORK_CONTROLLER_0_VBAR .vbar_base[0] = HI_MMIO_START + 0x20128000UL #define NETWORK_CONTROLLER_0_VBAR .vbar_base[0] = HI_MMIO_START + 0x20128000UL
#define SERIAL_BUS_CONTROLLER_0_VBAR .vbar_base[0] = HI_MMIO_START + 0x2012c000UL #define SERIAL_BUS_CONTROLLER_0_VBAR .vbar_base[0] = HI_MMIO_START + 0x2012c000UL
#define SERIAL_BUS_CONTROLLER_1_VBAR .vbar_base[0] = HI_MMIO_START + 0x2012d000UL #define SERIAL_BUS_CONTROLLER_1_VBAR .vbar_base[0] = HI_MMIO_START + 0x2012d000UL
#define SERIAL_BUS_CONTROLLER_2_VBAR .vbar_base[0] = HI_MMIO_START + 0x20301000UL #define SERIAL_BUS_CONTROLLER_2_VBAR .vbar_base[0] = HI_MMIO_START + 0x20301000UL
#define COMMUNICATION_CONTROLLER_0_VBAR .vbar_base[0] = HI_MMIO_START + 0x2012e000UL #define COMMUNICATION_CONTROLLER_0_VBAR .vbar_base[0] = HI_MMIO_START + 0x2012e000UL
#define SATA_CONTROLLER_0_VBAR \ #define SATA_CONTROLLER_0_VBAR .vbar_base[0] = HI_MMIO_START + 0x20130000UL, \
.vbar_base[0] = HI_MMIO_START + 0x20130000UL, .vbar_base[1] = HI_MMIO_START + 0x20132000UL, \ .vbar_base[1] = HI_MMIO_START + 0x20132000UL, \
.vbar_base[5] = HI_MMIO_START + 0x20132800UL .vbar_base[5] = HI_MMIO_START + 0x20132800UL
#define AUDIO_DEVICE_0_VBAR .vbar_base[0] = HI_MMIO_START + 0x20134000UL, .vbar_base[4] = HI_MMIO_START + 0x20200000UL #define AUDIO_DEVICE_0_VBAR .vbar_base[0] = HI_MMIO_START + 0x20134000UL, \
.vbar_base[4] = HI_MMIO_START + 0x20200000UL
#define SMBUS_0_VBAR .vbar_base[0] = HI_MMIO_START + 0x20300000UL #define SMBUS_0_VBAR .vbar_base[0] = HI_MMIO_START + 0x20300000UL
#define NON_VOLATILE_MEMORY_CONTROLLER_0_VBAR .vbar_base[0] = HI_MMIO_START + 0x20304000UL #define NON_VOLATILE_MEMORY_CONTROLLER_0_VBAR .vbar_base[0] = HI_MMIO_START + 0x20304000UL
#define ETHERNET_CONTROLLER_0_VBAR \ #define ETHERNET_CONTROLLER_0_VBAR .vbar_base[0] = HI_MMIO_START + 0x20400000UL, \
.vbar_base[0] = HI_MMIO_START + 0x20400000UL, .vbar_base[3] = HI_MMIO_START + 0x20500000UL .vbar_base[3] = HI_MMIO_START + 0x20500000UL
#endif /* VBAR_BASE_H_ */ #endif /* VBAR_BASE_H_ */

View File

@ -10,192 +10,137 @@
#include <asm/pgtable.h> #include <asm/pgtable.h>
#include <schedule.h> #include <schedule.h>
extern struct acrn_vm_pci_dev_config sos_pci_devs[CONFIG_MAX_PCI_DEV_NUM];
extern struct acrn_vm_pci_dev_config service_vm_pci_devs[CONFIG_MAX_PCI_DEV_NUM];
struct acrn_vm_config vm_configs[CONFIG_MAX_VM_NUM] = { struct acrn_vm_config vm_configs[CONFIG_MAX_VM_NUM] = {
{ {/* Static configured VM0 */
/* Static configured VM0 */ CONFIG_SERVICE_VM,
CONFIG_SERVICE_VM, .name = "ACRN_Service_VM",
.name = "ACRN_Service_VM", /* Allow Service VM to reboot the system since it is the highest priority VM. */
/* Allow Service VM to reboot the system since it is the highest priority VM. */ .vm_prio = PRIO_LOW,
.vm_prio = PRIO_LOW, .guest_flags = GUEST_FLAG_STATIC_VM,
.guest_flags = GUEST_FLAG_STATIC_VM, .cpu_affinity = SERVICE_VM_CONFIG_CPU_AFFINITY,
.cpu_affinity = SERVICE_VM_CONFIG_CPU_AFFINITY, .memory = {
.memory = .start_hpa = 0UL,
{ },
.start_hpa = 0UL, .os_config = {
}, .name = "ACRN Service VM OS",
.os_config = .kernel_type = KERNEL_BZIMAGE,
{ .kernel_mod_tag = "Linux_bzImage",
.name = "ACRN Service OS", .ramdisk_mod_tag = "",
.kernel_type = KERNEL_BZIMAGE, .bootargs = SERVICE_VM_OS_BOOTARGS,
.kernel_mod_tag = "Linux_bzImage", },
.ramdisk_mod_tag = "", .vuart[0] = {
.bootargs = SERVICE_VM_OS_BOOTARGS, .type = VUART_LEGACY_PIO,
}, .addr.port_base = 0x3F8U,
.vuart[0] = .irq = 4U,
{ },
.type = VUART_LEGACY_PIO, .vuart[1] = {
.addr.port_base = 0x3F8U, .type = VUART_LEGACY_PIO,
.irq = 4U, .addr.port_base = 0x2F8U,
}, .irq = 3U,
.vuart[1] = .t_vuart.vm_id = 2U,
{ .t_vuart.vuart_id = 1U,
.type = VUART_LEGACY_PIO, },
.addr.port_base = 0x2F8U, .pci_dev_num = 0U,
.irq = 3U, .pci_devs = service_vm_pci_devs,
.t_vuart.vm_id = 2U, },
.t_vuart.vuart_id = 1U, {/* Static configured VM1 */
}, CONFIG_POST_STD_VM,
.pci_dev_num = 0U, .name = "POST_STD_VM1",
.pci_devs = sos_pci_devs, .vm_prio = PRIO_LOW,
}, .guest_flags = GUEST_FLAG_STATIC_VM,
{ .cpu_affinity = VM1_CONFIG_CPU_AFFINITY,
/* Static configured VM1 */ .vuart[0] = {
CONFIG_POST_STD_VM, .type = VUART_LEGACY_PIO,
.name = "POST_STD_VM1", .addr.port_base = 0x3F8U,
.vm_prio = PRIO_LOW, .irq = 4U,
.guest_flags = GUEST_FLAG_STATIC_VM, },
.cpu_affinity = VM1_CONFIG_CPU_AFFINITY, .vuart[1] = {
.vuart[0] = .type = VUART_LEGACY_PIO,
{ },
.type = VUART_LEGACY_PIO, },
.addr.port_base = 0x3F8U, {/* Static configured VM2 */
.irq = 4U, CONFIG_POST_RT_VM,
}, .name = "POST_RT_VM1",
.vuart[1] = .vm_prio = PRIO_LOW,
{ .guest_flags = (GUEST_FLAG_STATIC_VM|GUEST_FLAG_LAPIC_PASSTHROUGH|GUEST_FLAG_RT),
.type = VUART_LEGACY_PIO, .cpu_affinity = VM2_CONFIG_CPU_AFFINITY,
}, .vuart[0] = {
}, .type = VUART_LEGACY_PIO,
{ .addr.port_base = 0x3F8U,
/* Static configured VM2 */ .irq = 4U,
CONFIG_POST_RT_VM, },
.name = "POST_RT_VM1", .vuart[1] = {
.vm_prio = PRIO_LOW, .type = VUART_LEGACY_PIO,
.guest_flags = (GUEST_FLAG_STATIC_VM | GUEST_FLAG_LAPIC_PASSTHROUGH | GUEST_FLAG_RT), .addr.port_base = 0x2F8U,
.cpu_affinity = VM2_CONFIG_CPU_AFFINITY, .irq = 3U,
.vuart[0] = .t_vuart.vm_id = 0U,
{ .t_vuart.vuart_id = 1U,
.type = VUART_LEGACY_PIO, },
.addr.port_base = 0x3F8U, },
.irq = 4U, {/* Static configured VM3 */
}, CONFIG_POST_STD_VM,
.vuart[1] = .name = "POST_STD_VM2",
{ .vm_prio = PRIO_LOW,
.type = VUART_LEGACY_PIO, .guest_flags = GUEST_FLAG_STATIC_VM,
.addr.port_base = 0x2F8U, .cpu_affinity = VM3_CONFIG_CPU_AFFINITY,
.irq = 3U, .vuart[0] = {
.t_vuart.vm_id = 0U, .type = VUART_LEGACY_PIO,
.t_vuart.vuart_id = 1U, .addr.port_base = 0x3F8U,
}, .irq = 4U,
}, },
{ .vuart[1] = {
/* Static configured VM3 */ .type = VUART_LEGACY_PIO,
CONFIG_POST_STD_VM, },
.name = "POST_STD_VM2", },
.vm_prio = PRIO_LOW, {/* Static configured VM4 */
.guest_flags = GUEST_FLAG_STATIC_VM, CONFIG_POST_STD_VM,
.cpu_affinity = VM3_CONFIG_CPU_AFFINITY, .name = "POST_STD_VM3",
.vuart[0] = .vm_prio = PRIO_LOW,
{ .guest_flags = GUEST_FLAG_STATIC_VM,
.type = VUART_LEGACY_PIO, .cpu_affinity = VM4_CONFIG_CPU_AFFINITY,
.addr.port_base = 0x3F8U, .vuart[0] = {
.irq = 4U, .type = VUART_LEGACY_PIO,
}, .addr.port_base = 0x3F8U,
.vuart[1] = .irq = 4U,
{ },
.type = VUART_LEGACY_PIO, .vuart[1] = {
}, .type = VUART_LEGACY_PIO,
}, },
{ },
/* Static configured VM4 */ {/* Static configured VM5 */
CONFIG_POST_STD_VM, CONFIG_POST_STD_VM,
.name = "POST_STD_VM3", .name = "POST_STD_VM4",
.vm_prio = PRIO_LOW, .vm_prio = PRIO_LOW,
.guest_flags = GUEST_FLAG_STATIC_VM, .guest_flags = GUEST_FLAG_STATIC_VM,
.cpu_affinity = VM4_CONFIG_CPU_AFFINITY, .cpu_affinity = VM5_CONFIG_CPU_AFFINITY,
.vuart[0] = .vuart[0] = {
{ .type = VUART_LEGACY_PIO,
.type = VUART_LEGACY_PIO, .addr.port_base = 0x3F8U,
.addr.port_base = 0x3F8U, .irq = 4U,
.irq = 4U, },
}, .vuart[1] = {
.vuart[1] = .type = VUART_LEGACY_PIO,
{ },
.type = VUART_LEGACY_PIO, },
}, {/* Static configured VM6 */
}, CONFIG_POST_STD_VM,
{ .name = "POST_STD_VM5",
/* Static configured VM5 */ .vm_prio = PRIO_LOW,
CONFIG_POST_STD_VM, .guest_flags = GUEST_FLAG_STATIC_VM,
.name = "POST_STD_VM4", .cpu_affinity = VM6_CONFIG_CPU_AFFINITY,
.vm_prio = PRIO_LOW, .vuart[0] = {
.guest_flags = GUEST_FLAG_STATIC_VM, .type = VUART_LEGACY_PIO,
.cpu_affinity = VM5_CONFIG_CPU_AFFINITY, .addr.port_base = 0x3F8U,
.vuart[0] = .irq = 4U,
{ },
.type = VUART_LEGACY_PIO, .vuart[1] = {
.addr.port_base = 0x3F8U, .type = VUART_LEGACY_PIO,
.irq = 4U, },
}, },
.vuart[1] = {/* Dynamic configured VM7 */
{ CONFIG_POST_STD_VM,
.type = VUART_LEGACY_PIO, }
},
},
{
/* Static configured VM6 */
CONFIG_POST_STD_VM,
.name = "POST_STD_VM5",
.vm_prio = PRIO_LOW,
.guest_flags = GUEST_FLAG_STATIC_VM,
.cpu_affinity = VM6_CONFIG_CPU_AFFINITY,
.vuart[0] =
{
.type = VUART_LEGACY_PIO,
.addr.port_base = 0x3F8U,
.irq = 4U,
},
.vuart[1] =
{
.type = VUART_LEGACY_PIO,
},
},
{
/* Dynamic configured VM7 */
CONFIG_POST_STD_VM,
},
{
/* Dynamic configured VM8 */
CONFIG_POST_STD_VM,
},
{
/* Dynamic configured VM9 */
CONFIG_POST_STD_VM,
},
{
/* Dynamic configured VM10 */
CONFIG_POST_STD_VM,
},
{
/* Dynamic configured VM11 */
CONFIG_POST_STD_VM,
},
{
/* Dynamic configured VM12 */
CONFIG_POST_STD_VM,
},
{
/* Dynamic configured VM13 */
CONFIG_POST_STD_VM,
},
{
/* Dynamic configured VM14 */
CONFIG_POST_STD_VM,
},
{
/* Dynamic configured VM15 */
CONFIG_POST_STD_VM,
}
}; };

View File

@ -10,15 +10,13 @@
#include <misc_cfg.h> #include <misc_cfg.h>
#include <pci_devices.h> #include <pci_devices.h>
/* SERVICE_VM_NUM can only be 0 or 1; When SERVICE_VM_NUM is 1, MAX_POST_VM_NUM must be 0 too. */ /* SERVICE_VM_NUM can only be 0 or 1; When SERVICE_VM_NUM is 1, MAX_POST_VM_NUM must be 0 too. */
#define PRE_VM_NUM 0U #define PRE_VM_NUM 0U
#define SERVICE_VM_NUM 1U #define SERVICE_VM_NUM 1U
#define MAX_POST_VM_NUM 15U #define MAX_POST_VM_NUM 7U
#define CONFIG_MAX_VM_NUM 16U #define CONFIG_MAX_VM_NUM 8U
/* Bitmask of guest flags that can be programmed by device model. Other bits are set by hypervisor only. */ /* Bitmask of guest flags that can be programmed by device model. Other bits are set by hypervisor only. */
#define DM_OWNED_GUEST_FLAG_MASK \ #define DM_OWNED_GUEST_FLAG_MASK (GUEST_FLAG_SECURE_WORLD_ENABLED | GUEST_FLAG_LAPIC_PASSTHROUGH | GUEST_FLAG_RT | GUEST_FLAG_IO_COMPLETION_POLLING)
(GUEST_FLAG_SECURE_WORLD_ENABLED | GUEST_FLAG_LAPIC_PASSTHROUGH | GUEST_FLAG_RT | \
GUEST_FLAG_IO_COMPLETION_POLLING | GUEST_FLAG_SECURITY_VM)
/* SERVICE_VM == VM0 */ /* SERVICE_VM == VM0 */
#define SERVICE_VM_OS_BOOTARGS SERVICE_VM_ROOTFS SERVICE_VM_OS_CONSOLE SERVICE_VM_IDLE SERVICE_VM_BOOTARGS_DIFF #define SERVICE_VM_OS_BOOTARGS SERVICE_VM_ROOTFS SERVICE_VM_OS_CONSOLE SERVICE_VM_IDLE SERVICE_VM_BOOTARGS_DIFF
#endif /* VM_CONFIGURATIONS_H */ #endif /* VM_CONFIGURATIONS_H */

View File

@ -138,7 +138,7 @@
<start_hpa>0</start_hpa> <start_hpa>0</start_hpa>
</memory> </memory>
<os_config> <os_config>
<name>ACRN Service OS</name> <name>ACRN Service VM OS</name>
<kern_type>KERNEL_BZIMAGE</kern_type> <kern_type>KERNEL_BZIMAGE</kern_type>
<kern_mod>Linux_bzImage</kern_mod> <kern_mod>Linux_bzImage</kern_mod>
<ramdisk_mod/> <ramdisk_mod/>
@ -250,4 +250,4 @@
</communication_vuart> </communication_vuart>
<PTM>n</PTM> <PTM>n</PTM>
</vm> </vm>
</acrn-config> </acrn-config>

View File

@ -144,7 +144,7 @@
<start_hpa>0</start_hpa> <start_hpa>0</start_hpa>
</memory> </memory>
<os_config> <os_config>
<name>ACRN Service OS</name> <name>ACRN Service VM OS</name>
<kern_type>KERNEL_BZIMAGE</kern_type> <kern_type>KERNEL_BZIMAGE</kern_type>
<kern_mod>Linux_bzImage</kern_mod> <kern_mod>Linux_bzImage</kern_mod>
<ramdisk_mod/> <ramdisk_mod/>
@ -259,4 +259,4 @@
</communication_vuart> </communication_vuart>
<PTM>n</PTM> <PTM>n</PTM>
</vm> </vm>
</acrn-config> </acrn-config>

View File

@ -74,7 +74,7 @@
<size>0x20000000</size> <size>0x20000000</size>
</memory> </memory>
<os_config> <os_config>
<name>ACRN Service OS</name> <name>ACRN Service VM OS</name>
<kern_type>KERNEL_BZIMAGE</kern_type> <kern_type>KERNEL_BZIMAGE</kern_type>
<kern_mod>Linux_bzImage</kern_mod> <kern_mod>Linux_bzImage</kern_mod>
<ramdisk_mod/> <ramdisk_mod/>
@ -351,4 +351,4 @@
</communication_vuart> </communication_vuart>
<PTM>n</PTM> <PTM>n</PTM>
</vm> </vm>
</acrn-config> </acrn-config>

View File

@ -1,9 +1,9 @@
<acrn-config board="generic_board" scenario="shared" user_vm_launcher="6"> <acrn-config board="generic_board" scenario="shared" user_vm_launcher="6">
<user_vm id="1"> <user_vm id="1">
<user_vm_type desc="UOS type">WINDOWS</user_vm_type> <user_vm_type desc="User VM type">WINDOWS</user_vm_type>
<vm_name>POST_STD_VM1</vm_name> <vm_name>POST_STD_VM1</vm_name>
<rtos_type desc="UOS Realtime capability">no</rtos_type> <rtos_type desc="User VM Realtime capability">no</rtos_type>
<mem_size desc="UOS memory size in MByte">4096</mem_size> <mem_size desc="User VM memory size in MByte">4096</mem_size>
<vbootloader desc="virtual bootloader method" readonly="true">ovmf</vbootloader> <vbootloader desc="virtual bootloader method" readonly="true">ovmf</vbootloader>
<vuart0 desc="vUART0 which emulated by device model">Disable</vuart0> <vuart0 desc="vUART0 which emulated by device model">Disable</vuart0>
<poweroff_channel desc="the method of power off User VM"/> <poweroff_channel desc="the method of power off User VM"/>
@ -47,10 +47,10 @@
</sriov> </sriov>
</user_vm> </user_vm>
<user_vm id="2"> <user_vm id="2">
<user_vm_type desc="UOS type">PREEMPT-RT LINUX</user_vm_type> <user_vm_type desc="User VM type">PREEMPT-RT LINUX</user_vm_type>
<vm_name>POST_RT_VM1</vm_name> <vm_name>POST_RT_VM1</vm_name>
<rtos_type desc="UOS Realtime capability">Hard RT</rtos_type> <rtos_type desc="User VM Realtime capability">Hard RT</rtos_type>
<mem_size desc="UOS memory size in MByte">1024</mem_size> <mem_size desc="User VM memory size in MByte">1024</mem_size>
<vbootloader desc="virtual bootloader method" readonly="true">ovmf</vbootloader> <vbootloader desc="virtual bootloader method" readonly="true">ovmf</vbootloader>
<vuart0 desc="vUART0 which emulated by device model">Disable</vuart0> <vuart0 desc="vUART0 which emulated by device model">Disable</vuart0>
<poweroff_channel desc="the method of power off User VM"/> <poweroff_channel desc="the method of power off User VM"/>
@ -94,10 +94,10 @@
</sriov> </sriov>
</user_vm> </user_vm>
<user_vm id="3"> <user_vm id="3">
<user_vm_type desc="UOS type">YOCTO</user_vm_type> <user_vm_type desc="User VM type">YOCTO</user_vm_type>
<vm_name>POST_STD_VM2</vm_name> <vm_name>POST_STD_VM2</vm_name>
<rtos_type desc="UOS Realtime capability">no</rtos_type> <rtos_type desc="User VM Realtime capability">no</rtos_type>
<mem_size desc="UOS memory size in MByte">512</mem_size> <mem_size desc="User VM memory size in MByte">512</mem_size>
<vbootloader desc="virtual bootloader method" readonly="true">ovmf</vbootloader> <vbootloader desc="virtual bootloader method" readonly="true">ovmf</vbootloader>
<vuart0 desc="vUART0 which emulated by device model">Disable</vuart0> <vuart0 desc="vUART0 which emulated by device model">Disable</vuart0>
<poweroff_channel desc="the method of power off User VM"/> <poweroff_channel desc="the method of power off User VM"/>
@ -141,10 +141,10 @@
</sriov> </sriov>
</user_vm> </user_vm>
<user_vm id="4"> <user_vm id="4">
<user_vm_type desc="UOS type">YOCTO</user_vm_type> <user_vm_type desc="User VM type">YOCTO</user_vm_type>
<vm_name>POST_STD_VM3</vm_name> <vm_name>POST_STD_VM3</vm_name>
<rtos_type desc="UOS Realtime capability">no</rtos_type> <rtos_type desc="User VM Realtime capability">no</rtos_type>
<mem_size desc="UOS memory size in MByte">512</mem_size> <mem_size desc="User VM memory size in MByte">512</mem_size>
<vbootloader desc="virtual bootloader method" readonly="true">ovmf</vbootloader> <vbootloader desc="virtual bootloader method" readonly="true">ovmf</vbootloader>
<vuart0 desc="vUART0 which emulated by device model">Disable</vuart0> <vuart0 desc="vUART0 which emulated by device model">Disable</vuart0>
<poweroff_channel desc="the method of power off User VM"/> <poweroff_channel desc="the method of power off User VM"/>
@ -188,10 +188,10 @@
</sriov> </sriov>
</user_vm> </user_vm>
<user_vm id="5"> <user_vm id="5">
<user_vm_type desc="UOS type">YOCTO</user_vm_type> <user_vm_type desc="User VM type">YOCTO</user_vm_type>
<vm_name>POST_STD_VM4</vm_name> <vm_name>POST_STD_VM4</vm_name>
<rtos_type desc="UOS Realtime capability">no</rtos_type> <rtos_type desc="User VM Realtime capability">no</rtos_type>
<mem_size desc="UOS memory size in MByte">512</mem_size> <mem_size desc="User VM memory size in MByte">512</mem_size>
<vbootloader desc="virtual bootloader method" readonly="true">ovmf</vbootloader> <vbootloader desc="virtual bootloader method" readonly="true">ovmf</vbootloader>
<vuart0 desc="vUART0 which emulated by device model">Disable</vuart0> <vuart0 desc="vUART0 which emulated by device model">Disable</vuart0>
<poweroff_channel desc="the method of power off User VM"/> <poweroff_channel desc="the method of power off User VM"/>
@ -235,10 +235,10 @@
</sriov> </sriov>
</user_vm> </user_vm>
<user_vm id="6"> <user_vm id="6">
<user_vm_type desc="UOS type">YOCTO</user_vm_type> <user_vm_type desc="User VM type">YOCTO</user_vm_type>
<vm_name>POST_STD_VM5</vm_name> <vm_name>POST_STD_VM5</vm_name>
<rtos_type desc="UOS Realtime capability">no</rtos_type> <rtos_type desc="User VM Realtime capability">no</rtos_type>
<mem_size desc="UOS memory size in MByte">512</mem_size> <mem_size desc="User VM memory size in MByte">512</mem_size>
<vbootloader desc="virtual bootloader method" readonly="true">ovmf</vbootloader> <vbootloader desc="virtual bootloader method" readonly="true">ovmf</vbootloader>
<vuart0 desc="vUART0 which emulated by device model">Disable</vuart0> <vuart0 desc="vUART0 which emulated by device model">Disable</vuart0>
<poweroff_channel desc="the method of power off User VM"/> <poweroff_channel desc="the method of power off User VM"/>
@ -281,4 +281,4 @@
<network/> <network/>
</sriov> </sriov>
</user_vm> </user_vm>
</acrn-config> </acrn-config>

View File

@ -138,7 +138,7 @@
<start_hpa>0</start_hpa> <start_hpa>0</start_hpa>
</memory> </memory>
<os_config> <os_config>
<name>ACRN Service OS</name> <name>ACRN Service VM OS</name>
<kern_type>KERNEL_BZIMAGE</kern_type> <kern_type>KERNEL_BZIMAGE</kern_type>
<kern_mod>Linux_bzImage</kern_mod> <kern_mod>Linux_bzImage</kern_mod>
<ramdisk_mod/> <ramdisk_mod/>
@ -250,4 +250,4 @@
</communication_vuart> </communication_vuart>
<PTM>n</PTM> <PTM>n</PTM>
</vm> </vm>
</acrn-config> </acrn-config>

View File

@ -74,7 +74,7 @@
<size>0x20000000</size> <size>0x20000000</size>
</memory> </memory>
<os_config> <os_config>
<name>ACRN Service OS</name> <name>ACRN Service VM OS</name>
<kern_type>KERNEL_BZIMAGE</kern_type> <kern_type>KERNEL_BZIMAGE</kern_type>
<kern_mod>Linux_bzImage</kern_mod> <kern_mod>Linux_bzImage</kern_mod>
<ramdisk_mod/> <ramdisk_mod/>
@ -351,4 +351,4 @@
</communication_vuart> </communication_vuart>
<PTM>n</PTM> <PTM>n</PTM>
</vm> </vm>
</acrn-config> </acrn-config>

View File

@ -66,7 +66,7 @@
<start_hpa>0</start_hpa> <start_hpa>0</start_hpa>
</memory> </memory>
<os_config> <os_config>
<name>ACRN Service OS</name> <name>ACRN Service VM OS</name>
<kern_type>KERNEL_BZIMAGE</kern_type> <kern_type>KERNEL_BZIMAGE</kern_type>
<kern_mod>Linux_bzImage</kern_mod> <kern_mod>Linux_bzImage</kern_mod>
<ramdisk_mod/> <ramdisk_mod/>
@ -140,4 +140,4 @@
<target_uart_id>1</target_uart_id> <target_uart_id>1</target_uart_id>
</communication_vuart> </communication_vuart>
</vm> </vm>
</acrn-config> </acrn-config>

View File

@ -1,5 +1,5 @@
[Unit] [Unit]
Description=Start ACRN UOS Description=Start ACRN User VM
After=acrnprobe.service After=acrnprobe.service
After=weston.service After=weston.service
After=systemd-resolved.service After=systemd-resolved.service
@ -10,7 +10,7 @@ ConditionPathExists=/dev/acrn_hsm
[Service] [Service]
Type=simple Type=simple
RemainAfterExit=false RemainAfterExit=false
ExecStart=/bin/sh /usr/share/acrn/samples/apl-mrb/launch_uos.sh -V 6 ExecStart=/bin/sh /usr/share/acrn/samples/apl-mrb/launch_user_vm.sh -V 6
[Install] [Install]
WantedBy=multi-user.target WantedBy=multi-user.target

View File

@ -2,8 +2,6 @@
# Copyright (C) 2019 Intel Corporation. # Copyright (C) 2019 Intel Corporation.
# SPDX-License-Identifier: BSD-3-Clause # SPDX-License-Identifier: BSD-3-Clause
kernel_version=$(uname -r)
audio_module="/usr/lib/modules/$kernel_version/kernel/sound/soc/intel/boards/snd-soc-sst_bxt_sos_tdf8532.ko"
ipu_passthrough=0 ipu_passthrough=0
# Check the device file of /dev/vbs_ipu to determine the IPU mode # Check the device file of /dev/vbs_ipu to determine the IPU mode
@ -14,12 +12,9 @@ fi
# use the modprobe to force loading snd-soc-skl/sst_bxt_bdf8532 # use the modprobe to force loading snd-soc-skl/sst_bxt_bdf8532
if [ ! -e $(audio_module)]; then if [ ! -e $(audio_module)]; then
modprobe -q snd-soc-skl modprobe -q snd-soc-skl
modprobe -q snd-soc-sst_bxt_tdf8532
else else
modprobe -q snd_soc_skl modprobe -q snd_soc_skl
modprobe -q snd_soc_tdf8532
modprobe -q snd_soc_sst_bxt_sos_tdf8532
modprobe -q snd_soc_skl_virtio_be modprobe -q snd_soc_skl_virtio_be
fi fi
audio_passthrough=0 audio_passthrough=0
@ -72,7 +67,7 @@ if [ ! -f "/data/$4/$4.img" ]; then
exit exit
fi fi
#vm-name used to generate uos-mac address #vm-name used to generate User-VM-mac address
mac=$(cat /sys/class/net/e*/address) mac=$(cat /sys/class/net/e*/address)
vm_name=vm$1 vm_name=vm$1
mac_seed=${mac:9:8}-${vm_name} mac_seed=${mac:9:8}-${vm_name}
@ -149,7 +144,7 @@ echo ${passthru_vpid["sd_card"]} > /sys/bus/pci/drivers/pci-stub/new_id
echo ${passthru_bdf["sd_card"]} > /sys/bus/pci/devices/${passthru_bdf["sd_card"]}/driver/unbind echo ${passthru_bdf["sd_card"]} > /sys/bus/pci/devices/${passthru_bdf["sd_card"]}/driver/unbind
echo ${passthru_bdf["sd_card"]} > /sys/bus/pci/drivers/pci-stub/bind echo ${passthru_bdf["sd_card"]} > /sys/bus/pci/drivers/pci-stub/bind
#for memsize setting, total 8GB(>7.5GB) uos->6GB, 4GB(>3.5GB) uos->2GB #for memsize setting, total 8GB(>7.5GB) User-VM->6GB, 4GB(>3.5GB) User-VM->2GB
memsize=`cat /proc/meminfo|head -n 1|awk '{print $2}'` memsize=`cat /proc/meminfo|head -n 1|awk '{print $2}'`
if [ $memsize -gt 7500000 ];then if [ $memsize -gt 7500000 ];then
mem_size=6G mem_size=6G
@ -216,7 +211,7 @@ if [ ! -f "/data/$4/$4.img" ]; then
exit exit
fi fi
#vm-name used to generate uos-mac address #vm-name used to generate User-VM-mac address
mac=$(cat /sys/class/net/e*/address) mac=$(cat /sys/class/net/e*/address)
vm_name=vm$1 vm_name=vm$1
mac_seed=${mac:9:8}-${vm_name} mac_seed=${mac:9:8}-${vm_name}
@ -336,7 +331,7 @@ else
boot_cse_option="$boot_cse_option"" -s 15,virtio-heci,0/0f/0 " boot_cse_option="$boot_cse_option"" -s 15,virtio-heci,0/0f/0 "
fi fi
#for memsize setting, total 8GB(>7.5GB) uos->6GB, 4GB(>3.5GB) uos->2GB #for memsize setting, total 8GB(>7.5GB) User-VM->6GB, 4GB(>3.5GB) User-VM->2GB
memsize=`cat /proc/meminfo|head -n 1|awk '{print $2}'` memsize=`cat /proc/meminfo|head -n 1|awk '{print $2}'`
if [ $memsize -gt 7500000 ];then if [ $memsize -gt 7500000 ];then
mem_size=6G mem_size=6G
@ -424,14 +419,14 @@ launch_android "$@"
function help() function help()
{ {
echo "Use luanch_uos.sh like that ./launch_uos.sh -V <#>" echo "Use luanch_user_vm.sh like that ./launch_user_vm.sh -V <#>"
echo "The option -V means the UOSs group to be launched by vsbl as below" echo "The option -V means the User VMs group to be launched by vsbl as below"
echo "-V 1 means just launching 1 clearlinux UOS" echo "-V 1 means just launching 1 clearlinux User VM"
echo "-V 2 means just launching 1 android UOS" echo "-V 2 means just launching 1 android User VM"
echo "-V 3 means launching 1 clearlinux UOS + 1 android UOS" echo "-V 3 means launching 1 clearlinux User VM + 1 android User VM"
echo "-V 4 means launching 2 clearlinux UOSs" echo "-V 4 means launching 2 clearlinux User VMs"
echo "-V 5 means just launching 1 alios UOS" echo "-V 5 means just launching 1 alios User VM"
echo "-V 6 means auto check android/linux/alios UOS; if exist, launch it" echo "-V 6 means auto check android/linux/alios User VM; if exist, launch it"
echo "-C means launching acrn-dm in runC container for QoS" echo "-C means launching acrn-dm in runC container for QoS"
} }
@ -471,7 +466,7 @@ for((i=0;i<${#vms[@]};i++))
do do
if [ "$vm_name" = "${vms[$i]}" ]; then if [ "$vm_name" = "${vms[$i]}" ]; then
if [ "stopped" != "${vms[$i+1]}" ]; then if [ "stopped" != "${vms[$i+1]}" ]; then
echo "Uos ${vms[$i]} ${vms[$i+1]}" echo "User VM ${vms[$i]} ${vms[$i+1]}"
acrnctl stop ${vms[$i]} acrnctl stop ${vms[$i]}
fi fi
fi fi
@ -551,7 +546,7 @@ if [ $runC_enable == 1 ]; then
exit exit
fi fi
# offline SOS CPUs except BSP before launch UOS # offline Service VM CPUs except BSP before launch User VM
for i in `ls -d /sys/devices/system/cpu/cpu[1-99]`; do for i in `ls -d /sys/devices/system/cpu/cpu[1-99]`; do
online=`cat $i/online` online=`cat $i/online`
idx=`echo $i | tr -cd "[1-99]"` idx=`echo $i | tr -cd "[1-99]"`
@ -570,23 +565,23 @@ for i in `ls -d /sys/devices/system/cpu/cpu[1-99]`; do
done done
case $launch_type in case $launch_type in
1) echo "Launch clearlinux UOS" 1) echo "Launch clearlinux User VM"
launch_clearlinux 1 "64 448 8" 0x070F00 clearlinux "LaaG" $debug launch_clearlinux 1 "64 448 8" 0x070F00 clearlinux "LaaG" $debug
;; ;;
2) echo "Launch android UOS" 2) echo "Launch android User VM"
launch_android 1 "64 448 8" 0x070F00 android "AaaG" $debug launch_android 1 "64 448 8" 0x070F00 android "AaaG" $debug
;; ;;
3) echo "Launch clearlinux UOS + android UOS" 3) echo "Launch clearlinux User VM + android User VM"
launch_android 1 "64 448 4" 0x00000C android "AaaG" $debug & launch_android 1 "64 448 4" 0x00000C android "AaaG" $debug &
sleep 5 sleep 5
launch_clearlinux 2 "64 448 4" 0x070F00 clearlinux "LaaG" $debug launch_clearlinux 2 "64 448 4" 0x070F00 clearlinux "LaaG" $debug
;; ;;
4) echo "Launch two clearlinux UOSs" 4) echo "Launch two clearlinux User VMs"
launch_clearlinux 1 "64 448 4" 0x00000C clearlinux "L1aaG" $debug & launch_clearlinux 1 "64 448 4" 0x00000C clearlinux "L1aaG" $debug &
sleep 5 sleep 5
launch_clearlinux 2 "64 448 4" 0x070F00 clearlinux_dup "L2aaG" $debug launch_clearlinux 2 "64 448 4" 0x070F00 clearlinux_dup "L2aaG" $debug
;; ;;
5) echo "Launch alios UOS" 5) echo "Launch alios User VM"
launch_alios 1 "64 448 8" 0x070F00 alios "AliaaG" $debug launch_alios 1 "64 448 8" 0x070F00 alios "AliaaG" $debug
;; ;;
esac esac

View File

@ -57,7 +57,7 @@ if [ ! -f "/data/$4/$4.img" ]; then
exit exit
fi fi
#vm-name used to generate uos-mac address #vm-name used to generate user-vm-mac address
mac=$(cat /sys/class/net/en*/address) mac=$(cat /sys/class/net/en*/address)
vm_name=vm$1 vm_name=vm$1
mac_seed=${mac:9:8}-${vm_name} mac_seed=${mac:9:8}-${vm_name}
@ -132,7 +132,7 @@ fi
# echo ${passthru_bdf["sd_card"]} > /sys/bus/pci/devices/${passthru_bdf["sd_card"]}/driver/unbind # echo ${passthru_bdf["sd_card"]} > /sys/bus/pci/devices/${passthru_bdf["sd_card"]}/driver/unbind
# echo ${passthru_bdf["sd_card"]} > /sys/bus/pci/drivers/pci-stub/bind # echo ${passthru_bdf["sd_card"]} > /sys/bus/pci/drivers/pci-stub/bind
#for memsize setting, total 8GB(>7.5GB) uos->6GB, 4GB(>3.5GB) uos->2GB #for memsize setting, total 8GB(>7.5GB) User-VM->6GB, 4GB(>3.5GB) User-VM->2GB
memsize=`cat /proc/meminfo|head -n 1|awk '{print $2}'` memsize=`cat /proc/meminfo|head -n 1|awk '{print $2}'`
if [ $memsize -gt 7500000 ];then if [ $memsize -gt 7500000 ];then
mem_size=6G mem_size=6G
@ -197,7 +197,7 @@ if [ ! -f "/data/$4/$4.img" ]; then
exit exit
fi fi
#vm-name used to generate uos-mac address #vm-name used to generate User-VM-mac address
mac=$(cat /sys/class/net/en*/address) mac=$(cat /sys/class/net/en*/address)
vm_name=vm$1 vm_name=vm$1
mac_seed=${mac:9:8}-${vm_name} mac_seed=${mac:9:8}-${vm_name}
@ -304,7 +304,7 @@ else
boot_cse_option="$boot_cse_option"" -s 15,virtio-heci,0/0f/0 " boot_cse_option="$boot_cse_option"" -s 15,virtio-heci,0/0f/0 "
fi fi
#for memsize setting, total 8GB(>7.5GB) uos->6GB, 4GB(>3.5GB) uos->2GB #for memsize setting, total 8GB(>7.5GB) User-VM->6GB, 4GB(>3.5GB) User-VM->2GB
memsize=`cat /proc/meminfo|head -n 1|awk '{print $2}'` memsize=`cat /proc/meminfo|head -n 1|awk '{print $2}'`
if [ $memsize -gt 7500000 ];then if [ $memsize -gt 7500000 ];then
mem_size=6G mem_size=6G
@ -389,14 +389,14 @@ launch_android "$@"
function help() function help()
{ {
echo "Use luanch_uos.sh like that ./launch_uos.sh -V <#>" echo "Use luanch_user_vm.sh like that ./launch_user_vm.sh -V <#>"
echo "The option -V means the UOSs group to be launched by vsbl as below" echo "The option -V means the User VMs group to be launched by vsbl as below"
echo "-V 1 means just launching 1 clearlinux UOS" echo "-V 1 means just launching 1 clearlinux User VM"
echo "-V 2 means just launching 1 android UOS" echo "-V 2 means just launching 1 android User VM"
echo "-V 3 means launching 1 clearlinux UOS + 1 android UOS" echo "-V 3 means launching 1 clearlinux User VM + 1 android User VM"
echo "-V 4 means launching 2 clearlinux UOSs" echo "-V 4 means launching 2 clearlinux User VMs"
echo "-V 5 means just launching 1 alios UOS" echo "-V 5 means just launching 1 alios User VM"
echo "-V 6 means auto check android/linux/alios UOS; if exist, launch it" echo "-V 6 means auto check android/linux/alios User VM; if exist, launch it"
} }
launch_type=1 launch_type=1
@ -438,7 +438,7 @@ if [ $launch_type == 6 ]; then
fi fi
fi fi
# offline SOS CPUs except BSP before launch UOS # offline Service VM CPUs except BSP before launch User VM
for i in `ls -d /sys/devices/system/cpu/cpu[1-99]`; do for i in `ls -d /sys/devices/system/cpu/cpu[1-99]`; do
online=`cat $i/online` online=`cat $i/online`
idx=`echo $i | tr -cd "[1-99]"` idx=`echo $i | tr -cd "[1-99]"`
@ -457,23 +457,23 @@ for i in `ls -d /sys/devices/system/cpu/cpu[1-99]`; do
done done
case $launch_type in case $launch_type in
1) echo "Launch clearlinux UOS" 1) echo "Launch clearlinux User VM"
launch_clearlinux 1 "64 448 8" 0x070F00 clearlinux "LaaG" $debug launch_clearlinux 1 "64 448 8" 0x070F00 clearlinux "LaaG" $debug
;; ;;
2) echo "Launch android UOS" 2) echo "Launch android User VM"
launch_android 1 "64 448 8" 0x070F00 android "AaaG" $debug launch_android 1 "64 448 8" 0x070F00 android "AaaG" $debug
;; ;;
3) echo "Launch clearlinux UOS + android UOS" 3) echo "Launch clearlinux User VM + android User VM"
launch_android 1 "64 448 4" 0x00000C android "AaaG" $debug & launch_android 1 "64 448 4" 0x00000C android "AaaG" $debug &
sleep 5 sleep 5
launch_clearlinux 2 "64 448 4" 0x070F00 clearlinux "LaaG" $debug launch_clearlinux 2 "64 448 4" 0x070F00 clearlinux "LaaG" $debug
;; ;;
4) echo "Launch two clearlinux UOSs" 4) echo "Launch two clearlinux User VMs"
launch_clearlinux 1 "64 448 4" 0x00000C clearlinux "L1aaG" $debug & launch_clearlinux 1 "64 448 4" 0x00000C clearlinux "L1aaG" $debug &
sleep 5 sleep 5
launch_clearlinux 2 "64 448 4" 0x070F00 clearlinux_dup "L2aaG" $debug launch_clearlinux 2 "64 448 4" 0x070F00 clearlinux_dup "L2aaG" $debug
;; ;;
5) echo "Launch alios UOS" 5) echo "Launch alios User VM"
launch_alios 1 "64 448 8" 0x070F00 alios "AliaaG" $debug launch_alios 1 "64 448 8" 0x070F00 alios "AliaaG" $debug
;; ;;
esac esac

View File

@ -20,16 +20,16 @@ fi
mem_size=1024M mem_size=1024M
acrn-dm -A -m $mem_size -s 0:0,hostbridge \ acrn-dm -A -m $mem_size -s 0:0,hostbridge \
-s 3,virtio-blk,/home/guestl1/acrn-dm-bins/ubuntuUOS.img \ -s 3,virtio-blk,/home/guestl1/acrn-dm-bins/ubuntuUserVM.img \
-s 4,virtio-net,tap0 \ -s 4,virtio-net,tap0 \
-s 5,virtio-console,@stdio:stdio_port \ -s 5,virtio-console,@stdio:stdio_port \
-k /home/guestl1/acrn-dm-bins/bzImage_uos \ -k /home/guestl1/acrn-dm-bins/bzImage_user_vm \
-B "earlyprintk=serial,ttyS0,115200n8 consoleblank=0 root=/dev/vda1 rw rootwait maxcpus=1 nohpet console=tty0 console=hvc0 console=ttyS0 no_timer_check ignore_loglevel log_buf_len=16M tsc=reliable" \ -B "earlyprintk=serial,ttyS0,115200n8 consoleblank=0 root=/dev/vda1 rw rootwait maxcpus=1 nohpet console=tty0 console=hvc0 console=ttyS0 no_timer_check ignore_loglevel log_buf_len=16M tsc=reliable" \
$logger_setting \ $logger_setting \
$vm_name $vm_name
} }
# offline SOS CPUs except BSP before launch UOS # offline Service VM CPUs except BSP before launch User VM
for i in `ls -d /sys/devices/system/cpu/cpu[1-99]`; do for i in `ls -d /sys/devices/system/cpu/cpu[1-99]`; do
online=`cat $i/online` online=`cat $i/online`
idx=`echo $i | tr -cd "[1-99]"` idx=`echo $i | tr -cd "[1-99]"`

View File

@ -64,7 +64,7 @@ echo ${passthru_bdf["nvme"]} > /sys/bus/pci/drivers/pci-stub/bind
#isolcpus=nohz,domain,1 nohz_full=1 rcu_nocbs=1 nosoftlockup idle=poll \ #isolcpus=nohz,domain,1 nohz_full=1 rcu_nocbs=1 nosoftlockup idle=poll \
#irqaffinity=0 #irqaffinity=0
# offline SOS CPUs except BSP before launch UOS # offline Service VM CPUs except BSP before launch User VM
for i in `ls -d /sys/devices/system/cpu/cpu[1-99]`; do for i in `ls -d /sys/devices/system/cpu/cpu[1-99]`; do
online=`cat $i/online` online=`cat $i/online`
idx=`echo $i | tr -cd "[1-99]"` idx=`echo $i | tr -cd "[1-99]"`

View File

@ -34,7 +34,7 @@ for((i=0;i<${#vms[@]};i++))
do do
if [ "$vm_name" = "${vms[$i]}" ]; then if [ "$vm_name" = "${vms[$i]}" ]; then
if [ "stopped" != "${vms[$i+1]}" ]; then if [ "stopped" != "${vms[$i+1]}" ]; then
echo "Uos ${vms[$i]} ${vms[$i+1]}" echo "User VM ${vms[$i]} ${vms[$i+1]}"
acrnctl stop ${vms[$i]} acrnctl stop ${vms[$i]}
fi fi
fi fi
@ -94,7 +94,7 @@ acrn-dm -A -m $mem_size -s 0:0,hostbridge \
-s 2,pci-gvt -G "$2" \ -s 2,pci-gvt -G "$2" \
-s 5,virtio-console,@stdio:stdio_port \ -s 5,virtio-console,@stdio:stdio_port \
-s 6,virtio-hyper_dmabuf \ -s 6,virtio-hyper_dmabuf \
-s 3,virtio-blk,/home/clear/uos/uos.img \ -s 3,virtio-blk,/home/clear/user_vm/user_vm.img \
-s 4,virtio-net,tap0 \ -s 4,virtio-net,tap0 \
-s 7,virtio-rnd \ -s 7,virtio-rnd \
--ovmf /usr/share/acrn/bios/OVMF.fd \ --ovmf /usr/share/acrn/bios/OVMF.fd \
@ -113,7 +113,7 @@ acrn-dm -A -m $mem_size -s 0:0,hostbridge \
#i915.enable_guc_loading=0 #i915.enable_guc_loading=0
#i915.enable_guc_submission=0 i915.enable_guc=0 #i915.enable_guc_submission=0 i915.enable_guc=0
# offline SOS CPUs except BSP before launch UOS # offline Service VM CPUs except BSP before launch User VM
for i in `ls -d /sys/devices/system/cpu/cpu[1-99]`; do for i in `ls -d /sys/devices/system/cpu/cpu[1-99]`; do
online=`cat $i/online` online=`cat $i/online`
idx=`echo $i | tr -cd "[1-99]"` idx=`echo $i | tr -cd "[1-99]"`

View File

@ -36,7 +36,7 @@ acrn-dm -A -m $mem_size -s 0:0,hostbridge \
$vm_name $vm_name
} }
# offline SOS CPUs except BSP before launch UOS # offline Service VM CPUs except BSP before launch User VM
for i in `ls -d /sys/devices/system/cpu/cpu[1-99]`; do for i in `ls -d /sys/devices/system/cpu/cpu[1-99]`; do
online=`cat $i/online` online=`cat $i/online`
idx=`echo $i | tr -cd "[1-99]"` idx=`echo $i | tr -cd "[1-99]"`

View File

@ -1,5 +1,5 @@
#!/bin/bash #!/bin/bash
# board: WHL-IPC-I5, scenario: INDUSTRY, uos: WINDOWS # board: WHL-IPC-I5, scenario: INDUSTRY, User VM: WINDOWS
# pci devices for passthru # pci devices for passthru
declare -A passthru_vpid declare -A passthru_vpid
declare -A passthru_bdf declare -A passthru_bdf
@ -35,7 +35,7 @@ fi
function launch_windows() function launch_windows()
{ {
#vm-name used to generate uos-mac address #vm-name used to generate User-VM-mac address
mac=$(cat /sys/class/net/e*/address) mac=$(cat /sys/class/net/e*/address)
vm_name=post_vm_id$1 vm_name=post_vm_id$1
mac_seed=${mac:0:17}-${vm_name} mac_seed=${mac:0:17}-${vm_name}
@ -53,18 +53,13 @@ echo ${passthru_vpid["gpu"]} > /sys/bus/pci/drivers/pci-stub/new_id
echo ${passthru_bdf["gpu"]} > /sys/bus/pci/devices/${passthru_bdf["gpu"]}/driver/unbind echo ${passthru_bdf["gpu"]} > /sys/bus/pci/devices/${passthru_bdf["gpu"]}/driver/unbind
echo ${passthru_bdf["gpu"]} > /sys/bus/pci/drivers/pci-stub/bind echo ${passthru_bdf["gpu"]} > /sys/bus/pci/drivers/pci-stub/bind
modprobe pci_stub modprobe pci_stub
kernel_version=$(uname -r)
audio_module="/usr/lib/modules/$kernel_version/kernel/sound/soc/intel/boards/snd-soc-sst_bxt_sos_tdf8532.ko"
# use the modprobe to force loading snd-soc-skl/sst_bxt_bdf8532 # use the modprobe to force loading snd-soc-skl/sst_bxt_bdf8532
if [ ! -e $audio_module ]; then if [ ! -e $audio_module ]; then
modprobe -q snd-soc-skl modprobe -q snd-soc-skl
modprobe -q snd-soc-sst_bxt_tdf8532
else else
modprobe -q snd_soc_skl modprobe -q snd_soc_skl
modprobe -q snd_soc_tdf8532
modprobe -q snd_soc_sst_bxt_sos_tdf8532
modprobe -q snd_soc_skl_virtio_be modprobe -q snd_soc_skl_virtio_be
fi fi
audio_passthrough=0 audio_passthrough=0

View File

@ -208,7 +208,7 @@ rcu_nocb_poll isolcpus=1 nohz_full=1 rcu_nocbs=1 \
tsc=reliable x2apic_phys xenomai.supported_cpus=2 irqaffinity=0 mce=off" hard_rtvm tsc=reliable x2apic_phys xenomai.supported_cpus=2 irqaffinity=0 mce=off" hard_rtvm
} }
# offline SOS CPUs except BSP before launch UOS # offline Service VM CPUs except BSP before launch User VM
for i in `ls -d /sys/devices/system/cpu/cpu[1-99]`; do for i in `ls -d /sys/devices/system/cpu/cpu[1-99]`; do
online=`cat $i/online` online=`cat $i/online`
idx=`echo $i | tr -cd "[1-99]"` idx=`echo $i | tr -cd "[1-99]"`

View File

@ -24,7 +24,7 @@ acrn-dm -A -m $mem_size -s 0:0,hostbridge -s 1:0,lpc -l com1,stdio \
$vm_name $vm_name
} }
# offline SOS CPUs except BSP before launch UOS # offline Service VM CPUs except BSP before launch User VM
for i in `ls -d /sys/devices/system/cpu/cpu[1-99]`; do for i in `ls -d /sys/devices/system/cpu/cpu[1-99]`; do
online=`cat $i/online` online=`cat $i/online`
idx=`echo $i | tr -cd "[1-99]"` idx=`echo $i | tr -cd "[1-99]"`

View File

@ -128,7 +128,7 @@
<start_hpa>0</start_hpa> <start_hpa>0</start_hpa>
</memory> </memory>
<os_config> <os_config>
<name>ACRN Service OS</name> <name>ACRN Service VM OS</name>
<kern_type>KERNEL_BZIMAGE</kern_type> <kern_type>KERNEL_BZIMAGE</kern_type>
<kern_mod>Linux_bzImage</kern_mod> <kern_mod>Linux_bzImage</kern_mod>
<ramdisk_mod/> <ramdisk_mod/>
@ -203,4 +203,4 @@
</communication_vuart> </communication_vuart>
<PTM>n</PTM> <PTM>n</PTM>
</vm> </vm>
</acrn-config> </acrn-config>

View File

@ -133,7 +133,7 @@
<start_hpa>0</start_hpa> <start_hpa>0</start_hpa>
</memory> </memory>
<os_config> <os_config>
<name>ACRN Service OS</name> <name>ACRN Service VM OS</name>
<kern_type>KERNEL_BZIMAGE</kern_type> <kern_type>KERNEL_BZIMAGE</kern_type>
<kern_mod>Linux_bzImage</kern_mod> <kern_mod>Linux_bzImage</kern_mod>
<ramdisk_mod/> <ramdisk_mod/>
@ -248,4 +248,4 @@
</communication_vuart> </communication_vuart>
<PTM>n</PTM> <PTM>n</PTM>
</vm> </vm>
</acrn-config> </acrn-config>

View File

@ -65,7 +65,7 @@
<start_hpa>0</start_hpa> <start_hpa>0</start_hpa>
</memory> </memory>
<os_config> <os_config>
<name>ACRN Service OS</name> <name>ACRN Service VM OS</name>
<kern_type>KERNEL_BZIMAGE</kern_type> <kern_type>KERNEL_BZIMAGE</kern_type>
<kern_mod>Linux_bzImage</kern_mod> <kern_mod>Linux_bzImage</kern_mod>
<ramdisk_mod/> <ramdisk_mod/>
@ -142,4 +142,4 @@
</communication_vuart> </communication_vuart>
<PTM>n</PTM> <PTM>n</PTM>
</vm> </vm>
</acrn-config> </acrn-config>

View File

@ -38,7 +38,7 @@
<virtio_devices> <virtio_devices>
<network desc="virtio network devices setting. Input format: tap_name,[vhost],[mac=XX:XX:XX:XX:XX:XX].">LaaG</network> <network desc="virtio network devices setting. Input format: tap_name,[vhost],[mac=XX:XX:XX:XX:XX:XX].">LaaG</network>
<input desc="virtio input device"/> <input desc="virtio input device"/>
<block desc="virtio block device setting. format: [blk partition:][img path] e.g.: /dev/sda3:./a/b.img">/home/clear/uos/uos.img</block> <block desc="virtio block device setting. format: [blk partition:][img path] e.g.: /dev/sda3:./a/b.img">/home/clear/user_vm/user_vm.img</block>
<console desc="virtio console device,input format: [@]stdio|tty|pty|sock:portname[=portpath][,[@]stdio|tty|pty:portname[=portpath]]">@stdio:stdio_port</console> <console desc="virtio console device,input format: [@]stdio|tty|pty|sock:portname[=portpath][,[@]stdio|tty|pty:portname[=portpath]]">@stdio:stdio_port</console>
</virtio_devices> </virtio_devices>
<sriov> <sriov>
@ -46,4 +46,4 @@
<network/> <network/>
</sriov> </sriov>
</user_vm> </user_vm>
</acrn-config> </acrn-config>

View File

@ -66,7 +66,7 @@
<size>0x20000000</size> <size>0x20000000</size>
</memory> </memory>
<os_config> <os_config>
<name>ACRN Service OS</name> <name>ACRN Service VM OS</name>
<kern_type>KERNEL_BZIMAGE</kern_type> <kern_type>KERNEL_BZIMAGE</kern_type>
<kern_mod>Linux_bzImage</kern_mod> <kern_mod>Linux_bzImage</kern_mod>
<ramdisk_mod/> <ramdisk_mod/>
@ -342,4 +342,4 @@
</communication_vuart> </communication_vuart>
<PTM>n</PTM> <PTM>n</PTM>
</vm> </vm>
</acrn-config> </acrn-config>

View File

@ -151,8 +151,8 @@ class Memory:
self.low_ram_size = 0 self.low_ram_size = 0
self.hv_ram_start = 0 self.hv_ram_start = 0
self.platform_ram_size = 0 self.platform_ram_size = 0
self.sos_ram_size = 0 self.service_vm_ram_size = 0
self.uos_ram_size = 0 self.user_vm_ram_size = 0
self.ivshmem_enable = 'n' self.ivshmem_enable = 'n'
self.ivshmem_region = [] self.ivshmem_region = []

View File

@ -81,9 +81,9 @@ def off_line_cpus(args, vmid, user_vm_type, config):
""" """
pcpu_id_list = get_cpu_affinity_list(args["cpu_affinity"], vmid) pcpu_id_list = get_cpu_affinity_list(args["cpu_affinity"], vmid)
if not pcpu_id_list: if not pcpu_id_list:
sos_vmid = launch_cfg_lib.get_sos_vmid() service_vmid = launch_cfg_lib.get_service_vmid()
cpu_affinity = common.get_leaf_tag_map(common.SCENARIO_INFO_FILE, "cpu_affinity", "pcpu_id") cpu_affinity = common.get_leaf_tag_map(common.SCENARIO_INFO_FILE, "cpu_affinity", "pcpu_id")
pcpu_id_list = get_cpu_affinity_list(cpu_affinity, sos_vmid+vmid) pcpu_id_list = get_cpu_affinity_list(cpu_affinity, service_vmid+vmid)
if not pcpu_id_list: if not pcpu_id_list:
key = "scenario config error" key = "scenario config error"
@ -160,7 +160,7 @@ def run_container(board_name, user_vm_type, config):
print("do", file=config) print("do", file=config)
print(' if [ "$vm_name" = "${vms[$i]}" ]; then', file=config) print(' if [ "$vm_name" = "${vms[$i]}" ]; then', file=config)
print(' if [ "stopped" != "${vms[$i+1]}" ]; then', file=config) print(' if [ "stopped" != "${vms[$i+1]}" ]; then', file=config)
print(' echo "Uos ${vms[$i]} ${vms[$i+1]}"', file=config) print(' echo "User VM ${vms[$i]} ${vms[$i+1]}"', file=config)
print(" acrnctl stop ${vms[$i]}", file=config) print(" acrnctl stop ${vms[$i]}", file=config)
print(" fi", file=config) print(" fi", file=config)
print(" fi", file=config) print(" fi", file=config)
@ -273,10 +273,10 @@ def launch_begin(names, virt_io, vmid, config):
board_name = names['board_name'] board_name = names['board_name']
user_vm_type = names['user_vm_types'][vmid] user_vm_type = names['user_vm_types'][vmid]
launch_uos = common.undline_name(user_vm_type).lower() launch_user_vm = common.undline_name(user_vm_type).lower()
tap_network(virt_io, vmid, config) tap_network(virt_io, vmid, config)
run_container(board_name, user_vm_type, config) run_container(board_name, user_vm_type, config)
print("function launch_{}()".format(launch_uos), file=config) print("function launch_{}()".format(launch_user_vm), file=config)
print("{", file=config) print("{", file=config)
@ -295,7 +295,7 @@ def mem_size_set(args, vmid, config):
def user_vm_launch(names, args, virt_io, vmid, config): def user_vm_launch(names, args, virt_io, vmid, config):
user_vm_type = names['user_vm_types'][vmid] user_vm_type = names['user_vm_types'][vmid]
launch_uos = common.undline_name(user_vm_type).lower() launch_user_vm = common.undline_name(user_vm_type).lower()
board_name = names['board_name'] board_name = names['board_name']
if 'nuc' in board_name: if 'nuc' in board_name:
board_name = 'nuc' board_name = 'nuc'
@ -313,7 +313,7 @@ def user_vm_launch(names, args, virt_io, vmid, config):
print("fi", file=config) print("fi", file=config)
if is_mount_needed(virt_io, vmid): if is_mount_needed(virt_io, vmid):
print("", file=config) print("", file=config)
print('launch_{} {} "{}" $debug'.format(launch_uos, vmid, vmid), file=config) print('launch_{} {} "{}" $debug'.format(launch_user_vm, vmid, vmid), file=config)
print("", file=config) print("", file=config)
i = 0 i = 0
for mount_flag in launch_cfg_lib.MOUNT_FLAG_DIC[vmid]: for mount_flag in launch_cfg_lib.MOUNT_FLAG_DIC[vmid]:
@ -325,14 +325,14 @@ def user_vm_launch(names, args, virt_io, vmid, config):
else: else:
print("else", file=config) print("else", file=config)
print(' launch_{} {}'.format(launch_uos, vmid), file=config) print(' launch_{} {}'.format(launch_user_vm, vmid), file=config)
print("fi", file=config) print("fi", file=config)
return return
elif not is_mount_needed(virt_io, vmid): elif not is_mount_needed(virt_io, vmid):
print('launch_{} {}'.format(launch_uos, vmid), file=config) print('launch_{} {}'.format(launch_user_vm, vmid), file=config)
else: else:
print("", file=config) print("", file=config)
print('launch_{} {} "{}" $debug'.format(launch_uos, vmid, vmid), file=config) print('launch_{} {} "{}" $debug'.format(launch_user_vm, vmid, vmid), file=config)
print("", file=config) print("", file=config)
i = 0 i = 0
for mount_flag in launch_cfg_lib.MOUNT_FLAG_DIC[vmid]: for mount_flag in launch_cfg_lib.MOUNT_FLAG_DIC[vmid]:
@ -386,8 +386,8 @@ def launch_end(names, args, virt_io, vmid, config):
print("", file=config) print("", file=config)
i += 1 i += 1
sos_vmid = launch_cfg_lib.get_sos_vmid() service_vmid = launch_cfg_lib.get_service_vmid()
if args['cpu_sharing'] == "SCHED_NOOP" or common.VM_TYPES[vmid+sos_vmid] == "POST_RT_VM": if args['cpu_sharing'] == "SCHED_NOOP" or common.VM_TYPES[vmid+service_vmid] == "POST_RT_VM":
off_line_cpus(args, vmid, user_vm_type, config) off_line_cpus(args, vmid, user_vm_type, config)
user_vm_launch(names, args, virt_io, vmid, config) user_vm_launch(names, args, virt_io, vmid, config)
@ -558,7 +558,7 @@ def dm_arg_set(names, sel, virt_io, dm, sriov, vmid, config):
boot_image_type(dm, vmid, config) boot_image_type(dm, vmid, config)
sos_vmid = launch_cfg_lib.get_sos_vmid() service_vmid = launch_cfg_lib.get_service_vmid()
# clearlinux/android/alios # clearlinux/android/alios
print('acrn-dm -A -m $mem_size -s 0:0,hostbridge \\', file=config) print('acrn-dm -A -m $mem_size -s 0:0,hostbridge \\', file=config)
@ -593,12 +593,12 @@ def dm_arg_set(names, sel, virt_io, dm, sriov, vmid, config):
else: else:
pm_vuart = pm_vuart + " " pm_vuart = pm_vuart + " "
if pm_key == "vuart1(tty)": if pm_key == "vuart1(tty)":
vuart_base = launch_cfg_lib.get_vuart1_from_scenario(sos_vmid + vmid) vuart_base = launch_cfg_lib.get_vuart1_from_scenario(service_vmid + vmid)
if vuart_base == "INVALID_COM_BASE": if vuart_base == "INVALID_COM_BASE":
err_key = "user_vm:id={}:poweroff_channel".format(vmid) err_key = "user_vm:id={}:poweroff_channel".format(vmid)
launch_cfg_lib.ERR_LIST[err_key] = "vuart1 of VM{} in scenario file should select 'SERVICE_VM_COM2_BASE'".format(sos_vmid + vmid) launch_cfg_lib.ERR_LIST[err_key] = "vuart1 of VM{} in scenario file should select 'SERVICE_VM_COM2_BASE'".format(service_vmid + vmid)
return return
scenario_cfg_lib.get_sos_vuart_settings() scenario_cfg_lib.get_service_vm_vuart_settings()
print(" {} \\".format(pm_vuart + launch_cfg_lib.PM_CHANNEL_DIC[pm_key] + scenario_cfg_lib.SERVICE_VM_UART1_VALID_NUM), file=config) print(" {} \\".format(pm_vuart + launch_cfg_lib.PM_CHANNEL_DIC[pm_key] + scenario_cfg_lib.SERVICE_VM_UART1_VALID_NUM), file=config)
elif pm_key == "vuart1(pty)": elif pm_key == "vuart1(pty)":
print(" {} \\".format(pm_vuart + launch_cfg_lib.PM_CHANNEL_DIC[pm_key]), file=config) print(" {} \\".format(pm_vuart + launch_cfg_lib.PM_CHANNEL_DIC[pm_key]), file=config)

View File

@ -135,18 +135,13 @@ def audio_pt(user_vm_type, sel, vmid, config):
slot_codec = sel.slot['audio_codec'][vmid] slot_codec = sel.slot['audio_codec'][vmid]
if bdf_audio: if bdf_audio:
print("kernel_version=$(uname -r)", file=config)
print('audio_module="/usr/lib/modules/$kernel_version/kernel/sound/soc/intel/boards/snd-soc-sst_bxt_sos_tdf8532.ko"', file=config)
print("", file=config) print("", file=config)
print("# use the modprobe to force loading snd-soc-skl/sst_bxt_bdf8532", file=config) print("# use the modprobe to force loading snd-soc-skl/sst_bxt_bdf8532", file=config)
print("if [ ! -e $audio_module ]; then", file=config) print("if [ ! -e $audio_module ]; then", file=config)
print("modprobe -q snd-soc-skl", file=config) print("modprobe -q snd-soc-skl", file=config)
print("modprobe -q snd-soc-sst_bxt_tdf8532", file=config)
print("else", file=config) print("else", file=config)
print("", file=config) print("", file=config)
print("modprobe -q snd_soc_skl", file=config) print("modprobe -q snd_soc_skl", file=config)
print("modprobe -q snd_soc_tdf8532", file=config)
print("modprobe -q snd_soc_sst_bxt_sos_tdf8532", file=config)
print("modprobe -q snd_soc_skl_virtio_be", file=config) print("modprobe -q snd_soc_skl_virtio_be", file=config)
print("fi", file=config) print("fi", file=config)
print("audio_passthrough=0", file=config) print("audio_passthrough=0", file=config)

View File

@ -208,15 +208,15 @@ def is_config_file_match():
return (err_dic, match) return (err_dic, match)
def get_sos_vmid(): def get_service_vmid():
sos_id = '' service_vmid = ''
for vm_i,vm_type in common.VM_TYPES.items(): for vm_i,vm_type in common.VM_TYPES.items():
if vm_type == "SERVICE_VM": if vm_type == "SERVICE_VM":
sos_id = vm_i service_vmid = vm_i
break break
return sos_id return service_vmid
def get_bdf_from_tag(config_file, branch_tag, tag_str): def get_bdf_from_tag(config_file, branch_tag, tag_str):
@ -550,9 +550,9 @@ def get_gpu_vpid():
def user_vm_cpu_affinity(user_vmid_cpu_affinity): def user_vm_cpu_affinity(user_vmid_cpu_affinity):
cpu_affinity = {} cpu_affinity = {}
sos_vm_id = get_sos_vmid() service_vm_id = get_service_vmid()
for user_vmid,cpu_affinity_list in user_vmid_cpu_affinity.items(): for user_vmid,cpu_affinity_list in user_vmid_cpu_affinity.items():
cpu_affinity[int(user_vmid) + int(sos_vm_id)] = cpu_affinity_list cpu_affinity[int(user_vmid) + int(service_vm_id)] = cpu_affinity_list
return cpu_affinity return cpu_affinity
@ -606,12 +606,12 @@ def set_shm_regions(launch_item_values, scenario_info):
except: except:
return return
sos_vm_id = 0 service_vm_id = 0
for vm_id, vm_type in vm_types.items(): for vm_id, vm_type in vm_types.items():
if vm_type in ['SERVICE_VM']: if vm_type in ['SERVICE_VM']:
sos_vm_id = vm_id service_vm_id = vm_id
elif vm_type in ['POST_STD_VM', 'POST_RT_VM']: elif vm_type in ['POST_STD_VM', 'POST_RT_VM']:
user_vmid = vm_id - sos_vm_id user_vmid = vm_id - service_vm_id
shm_region_key = 'user_vm:id={},shm_regions,shm_region'.format(user_vmid) shm_region_key = 'user_vm:id={},shm_regions,shm_region'.format(user_vmid)
launch_item_values[shm_region_key] = [''] launch_item_values[shm_region_key] = ['']
if shm_enabled == 'y': if shm_enabled == 'y':
@ -633,13 +633,13 @@ def set_pci_vuarts(launch_item_values, scenario_info):
try: try:
launch_item_values['user_vm,console_vuart'] = DM_VUART0 launch_item_values['user_vm,console_vuart'] = DM_VUART0
vm_types = common.get_leaf_tag_map(scenario_info, 'vm_type') vm_types = common.get_leaf_tag_map(scenario_info, 'vm_type')
sos_vm_id = 0 service_vm_id = 0
for vm_id, vm_type in vm_types.items(): for vm_id, vm_type in vm_types.items():
if vm_type in ['SERVICE_VM']: if vm_type in ['SERVICE_VM']:
sos_vm_id = vm_id service_vm_id = vm_id
for vm in list(common.get_config_root(scenario_info)): for vm in list(common.get_config_root(scenario_info)):
if vm.tag == 'vm' and scenario_cfg_lib.VM_DB[vm_types[int(vm.attrib['id'])]]['load_type'] == 'POST_LAUNCHED_VM': if vm.tag == 'vm' and scenario_cfg_lib.VM_DB[vm_types[int(vm.attrib['id'])]]['load_type'] == 'POST_LAUNCHED_VM':
user_vmid = int(vm.attrib['id']) - sos_vm_id user_vmid = int(vm.attrib['id']) - service_vm_id
pci_vuart_key = 'user_vm:id={},communication_vuarts,communication_vuart'.format(user_vmid) pci_vuart_key = 'user_vm:id={},communication_vuarts,communication_vuart'.format(user_vmid)
for elem in list(vm): for elem in list(vm):
if elem.tag == 'communication_vuart': if elem.tag == 'communication_vuart':

View File

@ -32,7 +32,7 @@ VUART_IRQ = ['SERVICE_VM_COM1_IRQ', 'SERVICE_VM_COM2_IRQ', 'SERVICE_VM_COM3_IRQ'
'COM1_IRQ', 'COM2_IRQ', 'COM3_IRQ', 'COM4_IRQ', 'CONFIG_COM_IRQ', '0'] 'COM1_IRQ', 'COM2_IRQ', 'COM3_IRQ', 'COM4_IRQ', 'CONFIG_COM_IRQ', '0']
# Support 512M, 1G, 2G # Support 512M, 1G, 2G
# pre launch less then 2G, sos vm less than 24G # pre launch less then 2G, Service VM less than 24G
START_HPA_SIZE_LIST = ['0x20000000', '0x40000000', '0x80000000'] START_HPA_SIZE_LIST = ['0x20000000', '0x40000000', '0x80000000']
COMMUNICATE_VM_ID = [] COMMUNICATE_VM_ID = []
@ -234,7 +234,7 @@ def load_vm_check(load_vms, item):
:param item: vm name item in xml :param item: vm name item in xml
:return: None :return: None
""" """
sos_vm_ids = [] service_vm_ids = []
pre_vm_ids = [] pre_vm_ids = []
post_vm_ids = [] post_vm_ids = []
rt_vm_ids = [] rt_vm_ids = []
@ -249,7 +249,7 @@ def load_vm_check(load_vms, item):
ERR_LIST[key] = "VM load order unknown" ERR_LIST[key] = "VM load order unknown"
if "SERVICE_VM" == VM_DB[load_str]['load_type']: if "SERVICE_VM" == VM_DB[load_str]['load_type']:
sos_vm_ids.append(order_i) service_vm_ids.append(order_i)
if "PRE_LAUNCHED_VM" == VM_DB[load_str]['load_type']: if "PRE_LAUNCHED_VM" == VM_DB[load_str]['load_type']:
pre_vm_ids.append(order_i) pre_vm_ids.append(order_i)
@ -260,19 +260,19 @@ def load_vm_check(load_vms, item):
if "POST_RT_VM" == load_str: if "POST_RT_VM" == load_str:
rt_vm_ids.append(order_i) rt_vm_ids.append(order_i)
if len(sos_vm_ids) > 1: if len(service_vm_ids) > 1:
key = "vm:id={},{}".format(sos_vm_ids[0], item) key = "vm:id={},{}".format(service_vm_ids[0], item)
ERR_LIST[key] = "Service VM number should not be greater than 1" ERR_LIST[key] = "Service VM number should not be greater than 1"
return return
if post_vm_ids and sos_vm_ids: if post_vm_ids and service_vm_ids:
if post_vm_ids[0] < sos_vm_ids[-1]: if post_vm_ids[0] < service_vm_ids[-1]:
key = "vm:id={},{}".format(post_vm_ids[0], item) key = "vm:id={},{}".format(post_vm_ids[0], item)
ERR_LIST[key] = "Post vm should be configured after SERVICE_VM" ERR_LIST[key] = "Post vm should be configured after SERVICE_VM"
if pre_vm_ids and sos_vm_ids: if pre_vm_ids and service_vm_ids:
if sos_vm_ids[-1] < pre_vm_ids[-1]: if service_vm_ids[-1] < pre_vm_ids[-1]:
key = "vm:id={},{}".format(sos_vm_ids[0], item) key = "vm:id={},{}".format(service_vm_ids[0], item)
ERR_LIST[key] = "Pre vm should be configured before SERVICE_VM" ERR_LIST[key] = "Pre vm should be configured before SERVICE_VM"
@ -309,24 +309,24 @@ def vm_cpu_affinity_check(scenario_file, launch_file, cpu_affinity):
cpu_sharing_enabled = False cpu_sharing_enabled = False
# validate cpu_affinity config with scenario file # validate cpu_affinity config with scenario file
sos_vmid = launch_cfg_lib.get_sos_vmid() service_vmid = launch_cfg_lib.get_service_vmid()
scenario_cpu_aff = common.get_leaf_tag_map(scenario_file, "cpu_affinity", "pcpu_id") scenario_cpu_aff = common.get_leaf_tag_map(scenario_file, "cpu_affinity", "pcpu_id")
scenario_vm_names = {v: k for k, v in common.get_leaf_tag_map(scenario_file, 'name').items()} scenario_vm_names = {v: k for k, v in common.get_leaf_tag_map(scenario_file, 'name').items()}
if launch_file: if launch_file:
launch_vm_names = common.get_leaf_tag_map(launch_file, 'vm_name') launch_vm_names = common.get_leaf_tag_map(launch_file, 'vm_name')
for vm_id, cpu_ids in cpu_affinity.items(): for vm_id, cpu_ids in cpu_affinity.items():
launch_vm_name = launch_vm_names[vm_id - sos_vmid] launch_vm_name = launch_vm_names[vm_id - service_vmid]
if launch_vm_name not in scenario_vm_names: if launch_vm_name not in scenario_vm_names:
# Dynamic VM, skip scenario cpu affinity subset check # Dynamic VM, skip scenario cpu affinity subset check
continue continue
abs_vmid = scenario_vm_names[launch_vm_name] abs_vmid = scenario_vm_names[launch_vm_name]
for vm_cpu in cpu_ids: for vm_cpu in cpu_ids:
if vm_cpu is None: if vm_cpu is None:
key = "vm:id={},{}".format(abs_vmid - sos_vmid, 'pcpu_id') key = "vm:id={},{}".format(abs_vmid - service_vmid, 'pcpu_id')
err_dic[key] = "This vm cpu_affinity is empty. " \ err_dic[key] = "This vm cpu_affinity is empty. " \
"Please update your launch file accordingly." "Please update your launch file accordingly."
if vm_cpu not in scenario_cpu_aff[abs_vmid]: if vm_cpu not in scenario_cpu_aff[abs_vmid]:
key = "vm:id={},{}".format(abs_vmid - sos_vmid, 'pcpu_id') key = "vm:id={},{}".format(abs_vmid - service_vmid, 'pcpu_id')
err_dic[key] = "This pCPU is not included in this VM's allowed CPU pool. " \ err_dic[key] = "This pCPU is not included in this VM's allowed CPU pool. " \
"Please update your scenario file accordingly or remove it from this list." "Please update your scenario file accordingly or remove it from this list."
@ -341,7 +341,7 @@ def vm_cpu_affinity_check(scenario_file, launch_file, cpu_affinity):
else: else:
use_cpus.append(cpu) use_cpus.append(cpu)
sos_vm_cpus = [] service_vm_cpus = []
pre_launch_cpus = [] pre_launch_cpus = []
post_launch_cpus = [] post_launch_cpus = []
for vm_i, vm_type in common.VM_TYPES.items(): for vm_i, vm_type in common.VM_TYPES.items():
@ -355,7 +355,7 @@ def vm_cpu_affinity_check(scenario_file, launch_file, cpu_affinity):
post_launch_cpus.extend(cpus) post_launch_cpus.extend(cpus)
elif VM_DB[vm_type]['load_type'] == "SERVICE_VM": elif VM_DB[vm_type]['load_type'] == "SERVICE_VM":
cpus = [x for x in cpu_affinity[vm_i] if not None] cpus = [x for x in cpu_affinity[vm_i] if not None]
sos_vm_cpus.extend(cpus) service_vm_cpus.extend(cpus)
# duplicate cpus assign the same VM check # duplicate cpus assign the same VM check
cpus_vm_i = cpu_affinity[vm_i] cpus_vm_i = cpu_affinity[vm_i]
@ -366,7 +366,7 @@ def vm_cpu_affinity_check(scenario_file, launch_file, cpu_affinity):
return err_dic return err_dic
if pre_launch_cpus: if pre_launch_cpus:
if "SERVICE_VM" in common.VM_TYPES and not sos_vm_cpus: if "SERVICE_VM" in common.VM_TYPES and not service_vm_cpus:
key = "Service VM cpu_affinity" key = "Service VM cpu_affinity"
err_dic[key] = "Should assign CPU id for Service VM" err_dic[key] = "Should assign CPU id for Service VM"
@ -582,7 +582,7 @@ def cpus_assignment(cpus_per_vm, index):
vm_cpu_bmp = {} vm_cpu_bmp = {}
if "SERVICE_VM" == common.VM_TYPES[index]: if "SERVICE_VM" == common.VM_TYPES[index]:
if index not in cpus_per_vm or cpus_per_vm[index] == [None]: if index not in cpus_per_vm or cpus_per_vm[index] == [None]:
sos_extend_all_cpus = board_cfg_lib.get_processor_info() service_vm_extend_all_cpus = board_cfg_lib.get_processor_info()
pre_all_cpus = [] pre_all_cpus = []
for vmid, cpu_list in cpus_per_vm.items(): for vmid, cpu_list in cpus_per_vm.items():
if vmid in common.VM_TYPES: if vmid in common.VM_TYPES:
@ -592,7 +592,7 @@ def cpus_assignment(cpus_per_vm, index):
load_type = VM_DB[vm_type]['load_type'] load_type = VM_DB[vm_type]['load_type']
if load_type == "PRE_LAUNCHED_VM": if load_type == "PRE_LAUNCHED_VM":
pre_all_cpus += cpu_list pre_all_cpus += cpu_list
cpus_per_vm[index] = list(set(sos_extend_all_cpus) - set(pre_all_cpus)) cpus_per_vm[index] = list(set(service_vm_extend_all_cpus) - set(pre_all_cpus))
cpus_per_vm[index].sort() cpus_per_vm[index].sort()
for i in range(len(cpus_per_vm[index])): for i in range(len(cpus_per_vm[index])):
@ -1239,7 +1239,7 @@ def check_pt_intx(phys_gsi, virt_gsi):
return return
def get_valid_ttys_for_sos_vuart(ttys_n): def get_valid_ttys_for_service_vm_vuart(ttys_n):
""" """
Get available ttysn list for vuart0/vuart1 Get available ttysn list for vuart0/vuart1
:param ttys_n: the serial port was chosen as hv console :param ttys_n: the serial port was chosen as hv console
@ -1272,7 +1272,7 @@ def get_valid_ttys_for_sos_vuart(ttys_n):
return (vuart0_valid, vuart1_valid) return (vuart0_valid, vuart1_valid)
def get_sos_vuart_settings(launch_flag=True): def get_service_vm_vuart_settings(launch_flag=True):
""" """
Get vuart setting from scenario setting Get vuart setting from scenario setting
:return: vuart0/vuart1 setting dictionary :return: vuart0/vuart1 setting dictionary
@ -1290,7 +1290,7 @@ def get_sos_vuart_settings(launch_flag=True):
return err_dic return err_dic
if ttys_n: if ttys_n:
(vuart0_valid, vuart1_valid) = get_valid_ttys_for_sos_vuart(ttys_n) (vuart0_valid, vuart1_valid) = get_valid_ttys_for_service_vm_vuart(ttys_n)
# VUART0 setting # VUART0 setting
if not launch_flag: if not launch_flag:

View File

@ -97,7 +97,7 @@ def generate_file(vm_info, config):
board_cfg_lib.parse_mem() board_cfg_lib.parse_mem()
compared_bdf = [] compared_bdf = []
sos_used_bdf = [] service_vm_used_bdf = []
for cnt_sub_name in board_cfg_lib.SUB_NAME_COUNT.keys(): for cnt_sub_name in board_cfg_lib.SUB_NAME_COUNT.keys():
i_cnt = 0 i_cnt = 0
@ -113,11 +113,11 @@ def generate_file(vm_info, config):
for bdf in compared_bdf: for bdf in compared_bdf:
bdf_tuple = BusDevFunc.from_str(bdf) bdf_tuple = BusDevFunc.from_str(bdf)
sos_used_bdf.append(bdf_tuple) service_vm_used_bdf.append(bdf_tuple)
# BDF 00:01.0 cannot be used in tgl # BDF 00:01.0 cannot be used in tgl
bdf_tuple = BusDevFunc(bus=0,dev=1,func=0) bdf_tuple = BusDevFunc(bus=0,dev=1,func=0)
sos_used_bdf.append(bdf_tuple) service_vm_used_bdf.append(bdf_tuple)
vuarts = common.get_vuart_info(common.SCENARIO_INFO_FILE) vuarts = common.get_vuart_info(common.SCENARIO_INFO_FILE)
pci_vuarts_num = scenario_cfg_lib.get_pci_vuart_num(vuarts) pci_vuarts_num = scenario_cfg_lib.get_pci_vuart_num(vuarts)
@ -173,7 +173,7 @@ def generate_file(vm_info, config):
scenario_cfg_lib.VM_DB[vm_type]['load_type'] == "SERVICE_VM": scenario_cfg_lib.VM_DB[vm_type]['load_type'] == "SERVICE_VM":
print("", file=config) print("", file=config)
print("struct acrn_vm_pci_dev_config " + print("struct acrn_vm_pci_dev_config " +
"sos_pci_devs[CONFIG_MAX_PCI_DEV_NUM];", file=config) "service_vm_pci_devs[CONFIG_MAX_PCI_DEV_NUM];", file=config)
continue continue
pci_cnt = 1 pci_cnt = 1
@ -181,7 +181,7 @@ def generate_file(vm_info, config):
print("", file=config) print("", file=config)
if scenario_cfg_lib.VM_DB[vm_type]['load_type'] == "SERVICE_VM": if scenario_cfg_lib.VM_DB[vm_type]['load_type'] == "SERVICE_VM":
print("struct acrn_vm_pci_dev_config " + print("struct acrn_vm_pci_dev_config " +
"sos_pci_devs[CONFIG_MAX_PCI_DEV_NUM] = {", file=config) "service_vm_pci_devs[CONFIG_MAX_PCI_DEV_NUM] = {", file=config)
else: else:
print("struct acrn_vm_pci_dev_config " + print("struct acrn_vm_pci_dev_config " +
"vm{}_pci_devs[VM{}_CONFIG_PCI_DEV_NUM] = {{".format(vm_i, vm_i), file=config) "vm{}_pci_devs[VM{}_CONFIG_PCI_DEV_NUM] = {{".format(vm_i, vm_i), file=config)
@ -243,11 +243,11 @@ def generate_file(vm_info, config):
print("\t\t.emu_type = {},".format(PCI_DEV_TYPE[0]), file=config) print("\t\t.emu_type = {},".format(PCI_DEV_TYPE[0]), file=config)
if scenario_cfg_lib.VM_DB[vm_type]['load_type'] == "SERVICE_VM": if scenario_cfg_lib.VM_DB[vm_type]['load_type'] == "SERVICE_VM":
free_bdf = find_unused_bdf(sos_used_bdf, "ivshmem", last_bdf) free_bdf = find_unused_bdf(service_vm_used_bdf, "ivshmem", last_bdf)
last_bdf = free_bdf last_bdf = free_bdf
print("\t\t.vbdf.bits = {{.b = 0x00U, .d = 0x{:02x}U, .f = 0x{:02x}U}}," \ print("\t\t.vbdf.bits = {{.b = 0x00U, .d = 0x{:02x}U, .f = 0x{:02x}U}}," \
.format(free_bdf.dev,free_bdf.func), file=config) .format(free_bdf.dev,free_bdf.func), file=config)
sos_used_bdf.append(free_bdf) service_vm_used_bdf.append(free_bdf)
elif scenario_cfg_lib.VM_DB[vm_type]['load_type'] == "PRE_LAUNCHED_VM": elif scenario_cfg_lib.VM_DB[vm_type]['load_type'] == "PRE_LAUNCHED_VM":
print("\t\t.vbdf.bits = {{.b = 0x00U, .d = 0x{0:02x}U, .f = 0x00U}},".format(pci_cnt), file=config) print("\t\t.vbdf.bits = {{.b = 0x00U, .d = 0x{0:02x}U, .f = 0x00U}},".format(pci_cnt), file=config)
bdf_tuple = BusDevFunc(0,pci_cnt,0) bdf_tuple = BusDevFunc(0,pci_cnt,0)
@ -265,7 +265,7 @@ def generate_file(vm_info, config):
print("\t\tIVSHMEM_DEVICE_{}_VBAR,".format(index), file=config) print("\t\tIVSHMEM_DEVICE_{}_VBAR,".format(index), file=config)
elif scenario_cfg_lib.VM_DB[vm_type]['load_type'] == "SERVICE_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\t.shm_region_name = IVSHMEM_SHM_REGION_{},".format(region), file=config)
print("\t\tSOS_IVSHMEM_DEVICE_{}_VBAR,".format(index), file=config) print("\t\tSERVICE_VM_IVSHMEM_DEVICE_{}_VBAR,".format(index), file=config)
else: else:
print("\t\t.shm_region_name = IVSHMEM_SHM_REGION_{},".format(region), file=config) print("\t\t.shm_region_name = IVSHMEM_SHM_REGION_{},".format(region), file=config)
pci_cnt += 1 pci_cnt += 1
@ -306,8 +306,8 @@ def generate_file(vm_info, config):
free_bdf = find_unused_bdf(vm_used_bdf, "vuart", last_bdf) free_bdf = find_unused_bdf(vm_used_bdf, "vuart", last_bdf)
vm_used_bdf.append(free_bdf) vm_used_bdf.append(free_bdf)
elif scenario_cfg_lib.VM_DB[vm_type]['load_type'] == "SERVICE_VM": elif scenario_cfg_lib.VM_DB[vm_type]['load_type'] == "SERVICE_VM":
free_bdf = find_unused_bdf(sos_used_bdf, "vuart", last_bdf) free_bdf = find_unused_bdf(service_vm_used_bdf, "vuart", last_bdf)
sos_used_bdf.append(free_bdf) service_vm_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) print("\t\t.vbdf.bits = {{.b = 0x00U, .d = 0x{:02x}U, .f = 0x00U}},".format(free_bdf.dev,free_bdf.func), file=config)
if vuart_id != 0: if vuart_id != 0:

View File

@ -266,12 +266,12 @@ class LoadOrderNum:
""" This is Abstract of VM number for different load order """ """ This is Abstract of VM number for different load order """
def __init__(self): def __init__(self):
self.pre_vm = 0 self.pre_vm = 0
self.sos_vm = 0 self.service_vm = 0
self.post_vm = 0 self.post_vm = 0
def get_info(self, load_vm): def get_info(self, load_vm):
self.pre_vm = scenario_cfg_lib.get_load_vm_cnt(load_vm, "PRE_LAUNCHED_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, "SERVICE_VM") self.service_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") self.post_vm = scenario_cfg_lib.get_load_vm_cnt(load_vm, "POST_LAUNCHED_VM")

View File

@ -238,10 +238,10 @@ def gen_source_header(config):
print("{0}".format(C_HEADER), file=config) print("{0}".format(C_HEADER), file=config)
def gen_sos_vm(vm_type, vm_i, scenario_items, config): def gen_service_vm(vm_type, vm_i, scenario_items, config):
vm_info = scenario_items['vm'] vm_info = scenario_items['vm']
(err_dic, sos_guest_flags) = get_guest_flag(vm_info.guest_flags[vm_i]) (err_dic, service_vm_guest_flags) = get_guest_flag(vm_info.guest_flags[vm_i])
if err_dic: if err_dic:
return err_dic return err_dic
@ -251,8 +251,8 @@ def gen_sos_vm(vm_type, vm_i, scenario_items, config):
print("", file=config) print("", file=config)
print("\t\t/* Allow Service VM 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) "there is supposed to be the highest severity guest */", file=config)
if sos_guest_flags: if service_vm_guest_flags:
print("\t\t.guest_flags = {0},".format(sos_guest_flags), file=config) print("\t\t.guest_flags = {0},".format(service_vm_guest_flags), file=config)
clos_output(scenario_items, vm_i, config) clos_output(scenario_items, vm_i, config)
cpu_affinity_output(vm_info, vm_i, config) cpu_affinity_output(vm_info, vm_i, config)
print("\t\t.memory = {", file=config) print("\t\t.memory = {", file=config)
@ -272,9 +272,9 @@ def gen_sos_vm(vm_type, vm_i, scenario_items, config):
err_dic = vuart_output(vm_type, vm_i, vm_info, config) err_dic = vuart_output(vm_type, vm_i, vm_info, config)
if err_dic: if err_dic:
return err_dic return err_dic
sos_dev_num = scenario_cfg_lib.get_pci_dev_num_per_vm()[vm_i] service_vm_dev_num = scenario_cfg_lib.get_pci_dev_num_per_vm()[vm_i]
print("\t\t.pci_dev_num = {}U,".format(sos_dev_num), file=config) print("\t\t.pci_dev_num = {}U,".format(service_vm_dev_num), file=config)
print("\t\t.pci_devs = sos_pci_devs,", file=config) print("\t\t.pci_devs = service_vm_pci_devs,", file=config)
print("\t},", file=config) print("\t},", file=config)
@ -385,7 +385,7 @@ def declare_pci_devs(vm_info, config):
for vm_i,vm_type in common.VM_TYPES.items(): for vm_i,vm_type in common.VM_TYPES.items():
if vm_type == "SERVICE_VM": if vm_type == "SERVICE_VM":
print("extern struct acrn_vm_pci_dev_config " + print("extern struct acrn_vm_pci_dev_config " +
"sos_pci_devs[CONFIG_MAX_PCI_DEV_NUM];", file=config) "service_vm_pci_devs[CONFIG_MAX_PCI_DEV_NUM];", file=config)
continue continue
if scenario_cfg_lib.get_pci_dev_num_per_vm()[vm_i]: if scenario_cfg_lib.get_pci_dev_num_per_vm()[vm_i]:
print("extern struct acrn_vm_pci_dev_config " + print("extern struct acrn_vm_pci_dev_config " +
@ -416,7 +416,7 @@ def generate_file(scenario_items, config):
for vm_i, vm_type in common.VM_TYPES.items(): for vm_i, vm_type in common.VM_TYPES.items():
if "SERVICE_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) gen_service_vm(vm_type, vm_i, scenario_items, config)
elif "PRE_LAUNCHED_VM" == scenario_cfg_lib.VM_DB[vm_type]['load_type']: elif "PRE_LAUNCHED_VM" == scenario_cfg_lib.VM_DB[vm_type]['load_type']:
gen_pre_launch_vm(vm_type, vm_i, scenario_items, config) gen_pre_launch_vm(vm_type, vm_i, scenario_items, config)
elif "POST_LAUNCHED_VM" == scenario_cfg_lib.VM_DB[vm_type]['load_type']: elif "POST_LAUNCHED_VM" == scenario_cfg_lib.VM_DB[vm_type]['load_type']:

View File

@ -32,7 +32,7 @@ def scenario_vm_num(scenario_items, config):
load_type_cnt = scenario_items['vm'].load_order_cnt load_type_cnt = scenario_items['vm'].load_order_cnt
print("#define PRE_VM_NUM\t\t\t{}U".format(load_type_cnt.pre_vm), file=config) print("#define PRE_VM_NUM\t\t\t{}U".format(load_type_cnt.pre_vm), file=config)
print("#define SERVICE_VM_NUM\t\t\t{}U".format(load_type_cnt.sos_vm), file=config) print("#define SERVICE_VM_NUM\t\t\t{}U".format(load_type_cnt.service_vm), file=config)
print("#define MAX_POST_VM_NUM\t\t\t{}U".format(load_type_cnt.post_vm), file=config) print("#define MAX_POST_VM_NUM\t\t\t{}U".format(load_type_cnt.post_vm), file=config)
@ -59,7 +59,7 @@ def gen_pre_launch_vm(scenario_items, config):
vm_i += 1 vm_i += 1
def gen_sos_header(scenario_items, config): def gen_service_vm_header(scenario_items, config):
if 'SERVICE_VM' not in common.VM_TYPES.values(): if 'SERVICE_VM' not in common.VM_TYPES.values():
return return
@ -79,7 +79,7 @@ def gen_sos_header(scenario_items, config):
def gen_header_file(scenario_items, config): def gen_header_file(scenario_items, config):
gen_pre_launch_vm(scenario_items, config) gen_pre_launch_vm(scenario_items, config)
gen_sos_header(scenario_items, config) gen_service_vm_header(scenario_items, config)
def get_dm_owned_guest_flag_mask(vm_info, config): def get_dm_owned_guest_flag_mask(vm_info, config):

View File

@ -380,7 +380,7 @@ to the pre-launched VM.</xs:documentation>
</xs:element> </xs:element>
<xs:element name="bootargs" type="xs:string"> <xs:element name="bootargs" type="xs:string">
<xs:annotation> <xs:annotation>
<xs:documentation>Specify kernel boot arguments for Service OS.</xs:documentation> <xs:documentation>Specify kernel boot arguments for Service VM OS.</xs:documentation>
</xs:annotation> </xs:annotation>
</xs:element> </xs:element>
</xs:sequence> </xs:sequence>

View File

@ -129,7 +129,7 @@ def fn(board_etree, scenario_etree, allocation_etree):
if vm_type is not None and lib.lib.is_post_launched_vm(vm_type): if vm_type is not None and lib.lib.is_post_launched_vm(vm_type):
continue continue
if vm_type is not None and lib.lib.is_sos_vm(vm_type): if vm_type is not None and lib.lib.is_service_vm(vm_type):
native_used = get_devs_bdf_native(board_etree) native_used = get_devs_bdf_native(board_etree)
passthrough_used = get_devs_bdf_passthrough(scenario_etree) passthrough_used = get_devs_bdf_passthrough(scenario_etree)
used = [bdf for bdf in native_used if bdf not in passthrough_used] used = [bdf for bdf in native_used if bdf not in passthrough_used]

View File

@ -9,28 +9,28 @@ import sys, os
sys.path.append(os.path.join(os.path.dirname(os.path.abspath(__file__)), '..', 'library')) sys.path.append(os.path.join(os.path.dirname(os.path.abspath(__file__)), '..', 'library'))
import common, board_cfg_lib import common, board_cfg_lib
def sos_cpu_affinity(etree): def service_vm_cpu_affinity(etree):
if common.get_node("//vm[vm_type = 'SERVICE_VM']", etree) is None: if common.get_node("//vm[vm_type = 'SERVICE_VM']", etree) is None:
return None return None
if common.get_node("//vm[vm_type = 'SERVICE_VM' and count(cpu_affinity)]", etree) is not None: if common.get_node("//vm[vm_type = 'SERVICE_VM' and count(cpu_affinity)]", etree) is not None:
return None return None
sos_extend_all_cpus = board_cfg_lib.get_processor_info() service_vm_extend_all_cpus = board_cfg_lib.get_processor_info()
pre_all_cpus = etree.xpath("//vm[vm_type = 'PRE_RT_VM' or vm_type = 'PRE_STD_VM' or vm_type = 'SAFETY_VM']/cpu_affinity/pcpu_id/text()") pre_all_cpus = etree.xpath("//vm[vm_type = 'PRE_RT_VM' or vm_type = 'PRE_STD_VM' or vm_type = 'SAFETY_VM']/cpu_affinity/pcpu_id/text()")
cpus_for_sos = list(set(sos_extend_all_cpus) - set(pre_all_cpus)) cpus_for_service_vm = list(set(service_vm_extend_all_cpus) - set(pre_all_cpus))
return sorted(cpus_for_sos) return sorted(cpus_for_service_vm)
def fn(board_etree, scenario_etree, allocation_etree): def fn(board_etree, scenario_etree, allocation_etree):
cpus_for_sos = sos_cpu_affinity(scenario_etree) cpus_for_service_vm = service_vm_cpu_affinity(scenario_etree)
if cpus_for_sos: if cpus_for_service_vm:
if common.get_node("//vm[vm_type = 'SERVICE_VM']", scenario_etree) is not None: if common.get_node("//vm[vm_type = 'SERVICE_VM']", scenario_etree) is not None:
vm_id = common.get_node("//vm[vm_type = 'SERVICE_VM']/@id", scenario_etree) vm_id = common.get_node("//vm[vm_type = 'SERVICE_VM']/@id", scenario_etree)
allocation_sos_vm_node = common.get_node(f"/acrn-config/vm[@id='{vm_id}']", allocation_etree) allocation_service_vm_node = common.get_node(f"/acrn-config/vm[@id='{vm_id}']", allocation_etree)
if allocation_sos_vm_node is None: if allocation_service_vm_node is None:
allocation_sos_vm_node = common.append_node("/acrn-config/vm", None, allocation_etree, id = vm_id) allocation_service_vm_node = common.append_node("/acrn-config/vm", None, allocation_etree, id = vm_id)
if common.get_node("./vm_type", allocation_sos_vm_node) is None: if common.get_node("./vm_type", allocation_service_vm_node) is None:
common.append_node("./vm_type", "SERVICE_VM", allocation_sos_vm_node) common.append_node("./vm_type", "SERVICE_VM", allocation_service_vm_node)
for pcpu_id in cpus_for_sos: for pcpu_id in cpus_for_service_vm:
common.append_node("./cpu_affinity/pcpu_id", str(pcpu_id), allocation_sos_vm_node) common.append_node("./cpu_affinity/pcpu_id", str(pcpu_id), allocation_service_vm_node)

View File

@ -433,7 +433,7 @@ def allocate_pci_bar(board_etree, scenario_etree, allocation_etree):
if vm_type is not None and lib.lib.is_pre_launched_vm(vm_type): if vm_type is not None and lib.lib.is_pre_launched_vm(vm_type):
low_mem = [AddrWindow(start = PRE_LAUNCHED_VM_LOW_MEM_START, end = PRE_LAUNCHED_VM_LOW_MEM_END - 1)] low_mem = [AddrWindow(start = PRE_LAUNCHED_VM_LOW_MEM_START, end = PRE_LAUNCHED_VM_LOW_MEM_END - 1)]
high_mem = [AddrWindow(start = PRE_LAUNCHED_VM_HIGH_MEM_START, end = PRE_LAUNCHED_VM_HIGH_MEM_END - 1)] high_mem = [AddrWindow(start = PRE_LAUNCHED_VM_HIGH_MEM_START, end = PRE_LAUNCHED_VM_HIGH_MEM_END - 1)]
elif vm_type is not None and lib.lib.is_sos_vm(vm_type): elif vm_type is not None and lib.lib.is_service_vm(vm_type):
low_mem = native_low_mem low_mem = native_low_mem
high_mem = native_high_mem high_mem = native_high_mem
mem_passthrough = get_devs_mem_passthrough(board_etree, scenario_etree) mem_passthrough = get_devs_mem_passthrough(board_etree, scenario_etree)
@ -465,7 +465,7 @@ def allocate_io_port(board_etree, scenario_etree, allocation_etree):
used_io_port_list = [] used_io_port_list = []
vm_type = common.get_node("./vm_type/text()", vm_node) vm_type = common.get_node("./vm_type/text()", vm_node)
if vm_type is not None and lib.lib.is_sos_vm(vm_type): if vm_type is not None and lib.lib.is_service_vm(vm_type):
io_port_range_list = io_port_range_list_native io_port_range_list = io_port_range_list_native
io_port_passthrough = get_pt_devs_io_port_passthrough(board_etree, scenario_etree) io_port_passthrough = get_pt_devs_io_port_passthrough(board_etree, scenario_etree)
used_io_port_list_native = get_devs_io_port_native(board_etree, io_port_range_list_native) used_io_port_list_native = get_devs_io_port_native(board_etree, io_port_range_list_native)

View File

@ -149,7 +149,7 @@ def alloc_device_irqs(board_etree, scenario_etree, allocation_etree):
for device in devices: for device in devices:
print(f"\t{device}") print(f"\t{device}")
raise lib.error.ResourceError(f"Pre-launched VM {vm_id} with LAPIC_PASSTHROUGH flag cannot use interrupt lines.") raise lib.error.ResourceError(f"Pre-launched VM {vm_id} with LAPIC_PASSTHROUGH flag cannot use interrupt lines.")
elif lib.lib.is_sos_vm(vm_type): elif lib.lib.is_service_vm(vm_type):
service_vm_id = vm_id service_vm_id = vm_id
# #

View File

@ -122,7 +122,7 @@ def is_post_launched_vm(vm_type):
return True return True
return False return False
def is_sos_vm(vm_type): def is_service_vm(vm_type):
if vm_type in SERVICE_VM_TYPE: if vm_type in SERVICE_VM_TYPE:
return True return True
return False return False

View File

@ -353,7 +353,7 @@
<xsl:if test="acrn:is-post-launched-vm($vmtype)"> <xsl:if test="acrn:is-post-launched-vm($vmtype)">
<func:result select="$ivshmem + $console_vuart + $communication_vuart + $virtual_root_port" /> <func:result select="$ivshmem + $console_vuart + $communication_vuart + $virtual_root_port" />
</xsl:if> </xsl:if>
<xsl:if test="acrn:is-sos-vm($vmtype)"> <xsl:if test="acrn:is-service-vm($vmtype)">
<func:result select="$ivshmem + $console_vuart + $communication_vuart" /> <func:result select="$ivshmem + $console_vuart + $communication_vuart" />
</xsl:if> </xsl:if>
</xsl:for-each> </xsl:for-each>
@ -455,7 +455,7 @@
</xsl:choose> </xsl:choose>
</func:function> </func:function>
<func:function name="acrn:is-sos-vm"> <func:function name="acrn:is-service-vm">
<xsl:param name="vm_type" /> <xsl:param name="vm_type" />
<xsl:choose> <xsl:choose>
<xsl:when test="$vm_type = 'SERVICE_VM'"> <xsl:when test="$vm_type = 'SERVICE_VM'">

View File

@ -34,10 +34,10 @@
</xsl:template> </xsl:template>
<xsl:template match="config-data/acrn-config"> <xsl:template match="config-data/acrn-config">
<xsl:if test="count(vm[acrn:is-sos-vm(vm_type)])"> <xsl:if test="count(vm[acrn:is-service-vm(vm_type)])">
<xsl:call-template name="sos_rootfs" /> <xsl:call-template name="service_vm_os_rootfs" />
<xsl:call-template name="sos_serial_console" /> <xsl:call-template name="service_vm_os_serial_console" />
<xsl:call-template name="sos_bootargs_diff" /> <xsl:call-template name="service_vm_os_bootargs_diff" />
</xsl:if> </xsl:if>
<xsl:call-template name="cpu_affinity" /> <xsl:call-template name="cpu_affinity" />
<xsl:call-template name="rdt" /> <xsl:call-template name="rdt" />
@ -65,13 +65,13 @@
</xsl:for-each> </xsl:for-each>
</xsl:template> </xsl:template>
<xsl:template name="sos_rootfs"> <xsl:template name="service_vm_os_rootfs">
<xsl:value-of select="acrn:define('SERVICE_VM_ROOTFS', concat($quot, 'root=', vm/board_private/rootfs[text()], ' ', $quot), '')" /> <xsl:value-of select="acrn:define('SERVICE_VM_ROOTFS', concat($quot, 'root=', vm/board_private/rootfs[text()], ' ', $quot), '')" />
</xsl:template> </xsl:template>
<xsl:template name="sos_serial_console"> <xsl:template name="service_vm_os_serial_console">
<xsl:variable name="consoleport" select="hv/DEBUG_OPTIONS/SERIAL_CONSOLE" /> <xsl:variable name="consoleport" select="hv/DEBUG_OPTIONS/SERIAL_CONSOLE" />
<xsl:variable name="sos_console"> <xsl:variable name="service_vm_os_console">
<xsl:if test="$consoleport = ''"> <xsl:if test="$consoleport = ''">
<xsl:text>" "</xsl:text> <xsl:text>" "</xsl:text>
</xsl:if> </xsl:if>
@ -84,12 +84,12 @@
</xsl:if> </xsl:if>
</xsl:if> </xsl:if>
</xsl:variable> </xsl:variable>
<xsl:value-of select="acrn:define('SERVICE_VM_OS_CONSOLE', $sos_console, '')" /> <xsl:value-of select="acrn:define('SERVICE_VM_OS_CONSOLE', $service_vm_os_console, '')" />
</xsl:template> </xsl:template>
<xsl:template name="sos_bootargs_diff"> <xsl:template name="service_vm_os_bootargs_diff">
<xsl:variable name="bootargs" select="normalize-space(vm[acrn:is-sos-vm(vm_type)]/board_private/bootargs[text()])" /> <xsl:variable name="bootargs" select="normalize-space(vm[acrn:is-service-vm(vm_type)]/board_private/bootargs[text()])" />
<xsl:variable name="maxcpunum" select="count(//vm[acrn:is-sos-vm(vm_type)]/cpu_affinity/pcpu_id)" /> <xsl:variable name="maxcpunum" select="count(//vm[acrn:is-service-vm(vm_type)]/cpu_affinity/pcpu_id)" />
<xsl:variable name="hugepages" select="round(number(substring-before(//board-data//TOTAL_MEM_INFO, 'kB')) div (1024 * 1024)) - 3" /> <xsl:variable name="hugepages" select="round(number(substring-before(//board-data//TOTAL_MEM_INFO, 'kB')) div (1024 * 1024)) - 3" />
<xsl:variable name="maxcpus"> <xsl:variable name="maxcpus">
<xsl:choose> <xsl:choose>
@ -112,8 +112,8 @@
<xsl:template name="cpu_affinity"> <xsl:template name="cpu_affinity">
<xsl:for-each select="vm"> <xsl:for-each select="vm">
<xsl:choose> <xsl:choose>
<xsl:when test="acrn:is-sos-vm(vm_type)"> <xsl:when test="acrn:is-service-vm(vm_type)">
<xsl:value-of select="acrn:define('SERVICE_VM_CONFIG_CPU_AFFINITY', concat('(', acrn:string-join(//vm[acrn:is-sos-vm(vm_type)]/cpu_affinity/pcpu_id, '|', 'AFFINITY_CPU(', 'U)'),')'), '')" /> <xsl:value-of select="acrn:define('SERVICE_VM_CONFIG_CPU_AFFINITY', concat('(', acrn:string-join(//vm[acrn:is-service-vm(vm_type)]/cpu_affinity/pcpu_id, '|', 'AFFINITY_CPU(', 'U)'),')'), '')" />
</xsl:when> </xsl:when>
<xsl:otherwise> <xsl:otherwise>
<xsl:value-of select="acrn:define(concat('VM', @id, '_CONFIG_CPU_AFFINITY'), concat('(', acrn:string-join(cpu_affinity/pcpu_id, '|', 'AFFINITY_CPU(', 'U)'),')'), '')" /> <xsl:value-of select="acrn:define(concat('VM', @id, '_CONFIG_CPU_AFFINITY'), concat('(', acrn:string-join(cpu_affinity/pcpu_id, '|', 'AFFINITY_CPU(', 'U)'),')'), '')" />

View File

@ -33,8 +33,8 @@
<xsl:template match="config-data/acrn-config/vm"> <xsl:template match="config-data/acrn-config/vm">
<!-- Initializer of a acrn_vm_pci_dev_config instance --> <!-- Initializer of a acrn_vm_pci_dev_config instance -->
<xsl:choose> <xsl:choose>
<xsl:when test="acrn:is-sos-vm(vm_type)"> <xsl:when test="acrn:is-service-vm(vm_type)">
<xsl:value-of select="acrn:array-initializer('struct acrn_vm_pci_dev_config', 'sos_pci_devs', 'CONFIG_MAX_PCI_DEV_NUM')" /> <xsl:value-of select="acrn:array-initializer('struct acrn_vm_pci_dev_config', 'service_vm_pci_devs', 'CONFIG_MAX_PCI_DEV_NUM')" />
</xsl:when> </xsl:when>
<xsl:when test="acrn:pci-dev-num(@id)"> <xsl:when test="acrn:pci-dev-num(@id)">
<xsl:value-of select="acrn:array-initializer('struct acrn_vm_pci_dev_config', concat('vm', @id, '_pci_devs'), concat('VM', @id, '_CONFIG_PCI_DEV_NUM'))" /> <xsl:value-of select="acrn:array-initializer('struct acrn_vm_pci_dev_config', concat('vm', @id, '_pci_devs'), concat('VM', @id, '_CONFIG_PCI_DEV_NUM'))" />
@ -52,7 +52,7 @@
<xsl:apply-templates select="PTM" /> <xsl:apply-templates select="PTM" />
</xsl:if> </xsl:if>
<xsl:if test="acrn:is-sos-vm(vm_type) or acrn:pci-dev-num(@id)"> <xsl:if test="acrn:is-service-vm(vm_type) or acrn:pci-dev-num(@id)">
<xsl:value-of select="$end_of_array_initializer" /> <xsl:value-of select="$end_of_array_initializer" />
</xsl:if> </xsl:if>
</xsl:template> </xsl:template>

View File

@ -29,8 +29,8 @@
<!-- Declaration of pci_devs --> <!-- Declaration of pci_devs -->
<xsl:for-each select="vm"> <xsl:for-each select="vm">
<xsl:choose> <xsl:choose>
<xsl:when test="acrn:is-sos-vm(vm_type)"> <xsl:when test="acrn:is-service-vm(vm_type)">
<xsl:value-of select="acrn:extern('struct acrn_vm_pci_dev_config', 'sos_pci_devs', 'CONFIG_MAX_PCI_DEV_NUM')" /> <xsl:value-of select="acrn:extern('struct acrn_vm_pci_dev_config', 'service_vm_pci_devs', 'CONFIG_MAX_PCI_DEV_NUM')" />
</xsl:when> </xsl:when>
<xsl:when test="acrn:pci-dev-num(@id)"> <xsl:when test="acrn:pci-dev-num(@id)">
<xsl:value-of select="acrn:extern('struct acrn_vm_pci_dev_config', concat('vm', @id, '_pci_devs'), concat('VM', @id, '_CONFIG_PCI_DEV_NUM'))" /> <xsl:value-of select="acrn:extern('struct acrn_vm_pci_dev_config', concat('vm', @id, '_pci_devs'), concat('VM', @id, '_CONFIG_PCI_DEV_NUM'))" />
@ -85,7 +85,7 @@
<xsl:apply-templates select="vm_type" /> <xsl:apply-templates select="vm_type" />
<xsl:apply-templates select="name" /> <xsl:apply-templates select="name" />
<xsl:if test="acrn:is-sos-vm(vm_type)"> <xsl:if test="acrn:is-service-vm(vm_type)">
<xsl:value-of select="acrn:comment('Allow Service VM to reboot the system since it is the highest priority VM.')" /> <xsl:value-of select="acrn:comment('Allow Service VM to reboot the system since it is the highest priority VM.')" />
<xsl:value-of select="$newline" /> <xsl:value-of select="$newline" />
</xsl:if> </xsl:if>
@ -128,7 +128,7 @@
<xsl:template name="cpu_affinity"> <xsl:template name="cpu_affinity">
<xsl:choose> <xsl:choose>
<xsl:when test="acrn:is-sos-vm(vm_type)"> <xsl:when test="acrn:is-service-vm(vm_type)">
<xsl:value-of select="acrn:initializer('cpu_affinity', 'SERVICE_VM_CONFIG_CPU_AFFINITY')" /> <xsl:value-of select="acrn:initializer('cpu_affinity', 'SERVICE_VM_CONFIG_CPU_AFFINITY')" />
</xsl:when> </xsl:when>
<xsl:otherwise> <xsl:otherwise>
@ -177,7 +177,7 @@
<xsl:template match="memory"> <xsl:template match="memory">
<xsl:value-of select="acrn:initializer('memory', '{', true())" /> <xsl:value-of select="acrn:initializer('memory', '{', true())" />
<xsl:choose> <xsl:choose>
<xsl:when test="acrn:is-sos-vm(../vm_type)"> <xsl:when test="acrn:is-service-vm(../vm_type)">
<xsl:value-of select="acrn:initializer('start_hpa', concat(start_hpa, 'UL'))" /> <xsl:value-of select="acrn:initializer('start_hpa', concat(start_hpa, 'UL'))" />
</xsl:when> </xsl:when>
<xsl:otherwise> <xsl:otherwise>
@ -215,7 +215,7 @@
</xsl:if> </xsl:if>
<xsl:if test="normalize-space(bootargs)"> <xsl:if test="normalize-space(bootargs)">
<xsl:choose> <xsl:choose>
<xsl:when test="acrn:is-sos-vm(../vm_type)"> <xsl:when test="acrn:is-service-vm(../vm_type)">
<xsl:value-of select="acrn:initializer('bootargs', 'SERVICE_VM_OS_BOOTARGS')" /> <xsl:value-of select="acrn:initializer('bootargs', 'SERVICE_VM_OS_BOOTARGS')" />
</xsl:when> </xsl:when>
<xsl:when test="acrn:is-pre-launched-vm(../vm_type)"> <xsl:when test="acrn:is-pre-launched-vm(../vm_type)">
@ -257,7 +257,7 @@
<xsl:template name="pci_dev_num"> <xsl:template name="pci_dev_num">
<xsl:choose> <xsl:choose>
<xsl:when test="acrn:is-sos-vm(vm_type)"> <xsl:when test="acrn:is-service-vm(vm_type)">
<xsl:value-of select="acrn:initializer('pci_dev_num', concat(acrn:pci-dev-num(@id), 'U'))" /> <xsl:value-of select="acrn:initializer('pci_dev_num', concat(acrn:pci-dev-num(@id), 'U'))" />
</xsl:when> </xsl:when>
<xsl:otherwise> <xsl:otherwise>
@ -270,8 +270,8 @@
<xsl:template name="pci_devs"> <xsl:template name="pci_devs">
<xsl:choose> <xsl:choose>
<xsl:when test="acrn:is-sos-vm(vm_type)"> <xsl:when test="acrn:is-service-vm(vm_type)">
<xsl:value-of select="acrn:initializer('pci_devs', 'sos_pci_devs')" /> <xsl:value-of select="acrn:initializer('pci_devs', 'service_vm_pci_devs')" />
</xsl:when> </xsl:when>
<xsl:when test="acrn:pci-dev-num(@id)"> <xsl:when test="acrn:pci-dev-num(@id)">
<xsl:value-of select="acrn:initializer('pci_devs', concat('vm', @id, '_pci_devs'))" /> <xsl:value-of select="acrn:initializer('pci_devs', concat('vm', @id, '_pci_devs'))" />

View File

@ -33,15 +33,15 @@
<xsl:call-template name="vm_count" /> <xsl:call-template name="vm_count" />
<xsl:call-template name="dm_guest_flag" /> <xsl:call-template name="dm_guest_flag" />
<xsl:call-template name="pre_launched_vm_hpa" /> <xsl:call-template name="pre_launched_vm_hpa" />
<xsl:call-template name="sos_vm_bootarges" /> <xsl:call-template name="service_vm_bootarges" />
</xsl:template> </xsl:template>
<xsl:template name ="vm_count"> <xsl:template name ="vm_count">
<xsl:value-of select="acrn:comment('SERVICE_VM_NUM can only be 0 or 1; When SERVICE_VM_NUM is 1, MAX_POST_VM_NUM must be 0 too.')" /> <xsl:value-of select="acrn:comment('SERVICE_VM_NUM can only be 0 or 1; When SERVICE_VM_NUM is 1, MAX_POST_VM_NUM must be 0 too.')" />
<xsl:value-of select="$newline" /> <xsl:value-of select="$newline" />
<xsl:value-of select="acrn:define('PRE_VM_NUM', count(vm[acrn:is-pre-launched-vm(vm_type)]), 'U')" /> <xsl:value-of select="acrn:define('PRE_VM_NUM', count(vm[acrn:is-pre-launched-vm(vm_type)]), 'U')" />
<xsl:value-of select="acrn:define('SERVICE_VM_NUM', count(vm[acrn:is-sos-vm(vm_type)]), 'U')" /> <xsl:value-of select="acrn:define('SERVICE_VM_NUM', count(vm[acrn:is-service-vm(vm_type)]), 'U')" />
<xsl:value-of select="acrn:define('MAX_POST_VM_NUM', hv/CAPACITIES/MAX_VM_NUM - count(vm[acrn:is-pre-launched-vm(vm_type)]) - count(vm[acrn:is-sos-vm(vm_type)]) , 'U')" /> <xsl:value-of select="acrn:define('MAX_POST_VM_NUM', hv/CAPACITIES/MAX_VM_NUM - count(vm[acrn:is-pre-launched-vm(vm_type)]) - count(vm[acrn:is-service-vm(vm_type)]) , 'U')" />
<xsl:value-of select="acrn:define('CONFIG_MAX_VM_NUM', hv/CAPACITIES/MAX_VM_NUM , 'U')" /> <xsl:value-of select="acrn:define('CONFIG_MAX_VM_NUM', hv/CAPACITIES/MAX_VM_NUM , 'U')" />
</xsl:template> </xsl:template>
@ -58,7 +58,7 @@
</xsl:choose> </xsl:choose>
</xsl:template> </xsl:template>
<xsl:template name ="sos_vm_bootarges"> <xsl:template name ="service_vm_bootarges">
<xsl:if test="count(vm[vm_type='SERVICE_VM'])"> <xsl:if test="count(vm[vm_type='SERVICE_VM'])">
<xsl:value-of select="acrn:comment(concat('SERVICE_VM == VM', vm[vm_type='SERVICE_VM']/@id))" /> <xsl:value-of select="acrn:comment(concat('SERVICE_VM == VM', vm[vm_type='SERVICE_VM']/@id))" />
<xsl:value-of select="$newline" /> <xsl:value-of select="$newline" />

View File

@ -351,7 +351,7 @@ static char *setup_loop_dev(void)
{ {
/* Currently User VM image(/data/android/android.img) mounted by /* Currently User VM image(/data/android/android.img) mounted by
* launch_UOS.sh, we need mount its data partition to loop device * launch_user_vm.sh, we need mount its data partition to loop device
*/ */
char loop_dev_tmp[32]; char loop_dev_tmp[32];
int i; int i;

View File

@ -174,7 +174,7 @@ static int usercrashd_notify_completion(int usercrashd_socket)
static void print_usage(void) static void print_usage(void)
{ {
printf("usercrash - tool to dump crash info for the crashes in the "); printf("usercrash - tool to dump crash info for the crashes in the ");
printf("userspace on sos. It's the client role of usercrash.\n"); printf("userspace on Service VM. It's the client role of usercrash.\n");
printf("[Usage]\n"); printf("[Usage]\n");
printf("\t--coredump, usercrash_c <pid> <comm> <sig> "); printf("\t--coredump, usercrash_c <pid> <comm> <sig> ");
printf("(root role to run)\n"); printf("(root role to run)\n");

View File

@ -373,7 +373,7 @@ static void sig_handler(int sig)
static void print_usage(void) static void print_usage(void)
{ {
printf("usercrash - tool to dump crash info for the crashes in the "); printf("usercrash - tool to dump crash info for the crashes in the ");
printf("userspace on sos. It's the server role of usercrash.\n"); printf("userspace on Service VM. It's the server role of usercrash.\n");
printf("[Usage] usercrash_s (root role to run)\n"); printf("[Usage] usercrash_s (root role to run)\n");
printf("[Option]\n"); printf("[Option]\n");
printf("\t-h: print this usage message\n"); printf("\t-h: print this usage message\n");

View File

@ -111,8 +111,8 @@
"source":"acrn-hypervisor/devicemodel/samples/nuc/launch_hard_rt_vm.sh", "source":"acrn-hypervisor/devicemodel/samples/nuc/launch_hard_rt_vm.sh",
"target":"usr/share/acrn/samples/nuc" "target":"usr/share/acrn/samples/nuc"
}, },
"launch_uos.sh":{ "launch_user_vm.sh":{
"source":"acrn-hypervisor/devicemodel/samples/nuc/launch_uos.sh", "source":"acrn-hypervisor/devicemodel/samples/nuc/launch_user_vm.sh",
"target":"usr/share/acrn/samples/nuc" "target":"usr/share/acrn/samples/nuc"
}, },
"launch_vxworks.sh":{ "launch_vxworks.sh":{

View File

@ -174,7 +174,7 @@ def create_acrn_kernel_deb():
#control file description #control file description
listcontrol=['Package: acrn-kernel-package\n','version: %s \n'% datetime.date.today(),'Section: free \n','Priority: optional \n','Architecture: amd64 \n','Installed-Size: 66666 \n','Maintainer: Intel\n','Description: sos_kernel \n','\n'] listcontrol=['Package: acrn-kernel-package\n','version: %s \n'% datetime.date.today(),'Section: free \n','Priority: optional \n','Architecture: amd64 \n','Installed-Size: 66666 \n','Maintainer: Intel\n','Description: service_vm_kernel \n','\n']
with open('acrn_kernel_deb/DEBIAN/control','w',encoding='utf-8') as fr: with open('acrn_kernel_deb/DEBIAN/control','w',encoding='utf-8') as fr:
@ -226,7 +226,7 @@ def build_acrn_kernel(acrn_repo,acrn_version):
patch_full_name = patch_path + '/' + patch patch_full_name = patch_path + '/' + patch
add_cmd_list(cmd_list, 'git am %s/%s' % (patch_path, patch), hv_dir) add_cmd_list(cmd_list, 'git am %s/%s' % (patch_path, patch), hv_dir)
add_cmd_list(cmd_list, 'make clean', kernel_dir) add_cmd_list(cmd_list, 'make clean', kernel_dir)
add_cmd_list(cmd_list, 'cp kernel_config_uefi_sos .config', kernel_dir) add_cmd_list(cmd_list, 'cp kernel_config_service_vm .config', kernel_dir)
add_cmd_list(cmd_list, 'make olddefconfig', kernel_dir) add_cmd_list(cmd_list, 'make olddefconfig', kernel_dir)
cpu_cnt = multiprocessing.cpu_count() cpu_cnt = multiprocessing.cpu_count()
@ -361,7 +361,7 @@ def install_process():
if load_dict['build_acrn_kernel'] == 'true': if load_dict['build_acrn_kernel'] == 'true':
print('start build_acrn_kernel') print('start build_acrn_kernel')
build_acrn_kernel(load_dict['sos_kernel_repo'],load_dict['kernel_release_version']) build_acrn_kernel(load_dict['service_vm_kernel_repo'],load_dict['kernel_release_version'])
if load_dict['acrn_deb_package'] == 'true': if load_dict['acrn_deb_package'] == 'true':
print('start create acrn_deb_package deb') print('start create acrn_deb_package deb')

View File

@ -91,11 +91,11 @@ enum msgid {
/* DM handled message event types */ /* DM handled message event types */
enum dm_msgid { enum dm_msgid {
DM_STOP = MSG_MAX + 1, /* Stop this UOS */ DM_STOP = MSG_MAX + 1, /* Stop this User VM */
DM_SUSPEND, /* Suspend this UOS from running state */ DM_SUSPEND, /* Suspend this User VM from running state */
DM_RESUME, /* Resume this UOS from suspend state */ DM_RESUME, /* Resume this User VM from suspend state */
DM_QUERY, /* Ask power state of this UOS */ DM_QUERY, /* Ask power state of this User VM */
DM_BLKRESCAN, /* Rescan virtio-blk device for any changes in UOS */ DM_BLKRESCAN, /* Rescan virtio-blk device for any changes in User VM */
DM_MAX, DM_MAX,
}; };
@ -118,8 +118,8 @@ enum acrnd_msgid {
/* Acrnd handled message req/ack pairs */ /* Acrnd handled message req/ack pairs */
/* SOS-LCS handled message event types */ /* Service-VM-LCS handled message event types */
enum sos_lcs_msgid { enum service_vm_lcs_msgid {
WAKEUP_REASON = ACRND_MAX + 1, /* Acrnd/Acrnctl request wakeup reason */ WAKEUP_REASON = ACRND_MAX + 1, /* Acrnd/Acrnctl request wakeup reason */
RTC_TIMER, /* Acrnd request to setup RTC timer */ RTC_TIMER, /* Acrnd request to setup RTC timer */
SUSPEND, SUSPEND,

View File

@ -202,7 +202,7 @@ static int acrnctl_do_add(int argc, char *argv[])
/* /*
* If there's "-C" parameter in acrnctl add command * If there's "-C" parameter in acrnctl add command
* check if the SoS support runC container at first, then * check if the Service VM support runC container at first, then
* strip "-C" and set the flag. * strip "-C" and set the flag.
*/ */
if (strncmp(argv[i], "-C", 2) == 0) { if (strncmp(argv[i], "-C", 2) == 0) {
@ -470,7 +470,7 @@ static inline int del_runC(char *argv)
char cmd_out[PATH_LEN * 2]; char cmd_out[PATH_LEN * 2];
char runc_path[PATH_LEN]; char runc_path[PATH_LEN];
/* The configuration added by launch_uos script */ /* The configuration added by launch_user_vm script */
if (snprintf(runc_path, sizeof(runc_path), "%s/runc/%s", if (snprintf(runc_path, sizeof(runc_path), "%s/runc/%s",
ACRN_CONF_PATH_ADD, argv) >= sizeof(runc_path)) { ACRN_CONF_PATH_ADD, argv) >= sizeof(runc_path)) {
printf("ERROR: runC path %s is truncated\n", runc_path); printf("ERROR: runC path %s is truncated\n", runc_path);

View File

@ -126,7 +126,7 @@ static void try_do_works(void)
} }
static void acrnd_run_vm(char *name); static void acrnd_run_vm(char *name);
unsigned get_sos_wakeup_reason(void); unsigned get_service_vm_wakeup_reason(void);
/* Timer callback to run/resume VM. /* Timer callback to run/resume VM.
* Will be called with work_mutex hold * Will be called with work_mutex hold
@ -269,7 +269,7 @@ static int active_all_vms(void)
break; break;
case VM_SUSPENDED: case VM_SUSPENDED:
if (platform_has_hw_ioc) { if (platform_has_hw_ioc) {
reason = get_sos_wakeup_reason(); reason = get_service_vm_wakeup_reason();
} }
ret += resume_vm(vm->name, reason); ret += resume_vm(vm->name, reason);
break; break;
@ -315,7 +315,7 @@ static int wakeup_suspended_vms(unsigned wakeup_reason)
static int acrnd_fd = -1; static int acrnd_fd = -1;
unsigned get_sos_wakeup_reason(void) unsigned get_service_vm_wakeup_reason(void)
{ {
int client_fd, ret = 0; int client_fd, ret = 0;
struct mngr_msg req; struct mngr_msg req;
@ -376,7 +376,7 @@ static void handle_timer_req(struct mngr_msg *msg, int client_fd, void *param)
mngr_send_msg(client_fd, &ack, NULL, 0); mngr_send_msg(client_fd, &ack, NULL, 0);
} }
static int set_sos_timer(time_t due_time) static int set_service_vm_timer(time_t due_time)
{ {
int client_fd, ret; int client_fd, ret;
int retry = 1; int retry = 1;
@ -399,7 +399,7 @@ static int set_sos_timer(time_t due_time)
ret = ret =
mngr_send_msg(client_fd, &req, &ack, SOCK_TIMEOUT); mngr_send_msg(client_fd, &req, &ack, SOCK_TIMEOUT);
while (ret <= 0 && retry < 5) { while (ret <= 0 && retry < 5) {
printf("Fail to set sos wakeup timer(err:%d), retry %d...\n", printf("Fail to set Service VM wakeup timer(err:%d), retry %d...\n",
ret, retry++); ret, retry++);
goto RETRY; goto RETRY;
} }
@ -442,7 +442,7 @@ static int store_timer_list(void)
/* If any timer is stored /* If any timer is stored
* system must be awake at sys_wakeup */ * system must be awake at sys_wakeup */
if (sys_wakeup) { if (sys_wakeup) {
set_sos_timer(sys_wakeup); set_service_vm_timer(sys_wakeup);
} else { } else {
unlink(ACRN_CONF_TIMER_LIST); unlink(ACRN_CONF_TIMER_LIST);
} }
@ -515,7 +515,7 @@ static void* notify_stop_state(void *arg)
lcs_fd = mngr_open_un(SERVICE_VM_LCS_SOCK, MNGR_CLIENT); lcs_fd = mngr_open_un(SERVICE_VM_LCS_SOCK, MNGR_CLIENT);
if (lcs_fd < 0) { if (lcs_fd < 0) {
fprintf(stderr, "cannot open sos-lcs.socket\n"); fprintf(stderr, "cannot open service-vm-lcs.socket\n");
goto exit; goto exit;
} }
@ -594,9 +594,9 @@ void handle_acrnd_resume(struct mngr_msg *msg, int client_fd, void *param)
ack.timestamp = msg->timestamp; ack.timestamp = msg->timestamp;
ack.data.err = -1; ack.data.err = -1;
/* acrnd get wakeup_reason from sos lcs */ /* acrnd get wakeup_reason from Service VM lcs */
if (platform_has_hw_ioc) { if (platform_has_hw_ioc) {
wakeup_reason = get_sos_wakeup_reason(); wakeup_reason = get_service_vm_wakeup_reason();
} }
if (wakeup_reason & CBC_WK_RSN_RTC) { if (wakeup_reason & CBC_WK_RSN_RTC) {
@ -650,7 +650,7 @@ int init_vm(void)
/* init all User VMs, according wakeup_reason */ /* init all User VMs, according wakeup_reason */
if (platform_has_hw_ioc) { if (platform_has_hw_ioc) {
wakeup_reason = get_sos_wakeup_reason(); wakeup_reason = get_service_vm_wakeup_reason();
} }
if (wakeup_reason & CBC_WK_RSN_RTC) { if (wakeup_reason & CBC_WK_RSN_RTC) {