diff --git a/misc/acrn-config/library/scenario_cfg_lib.py b/misc/acrn-config/library/scenario_cfg_lib.py
index ce9592ee0..45e4b50a1 100644
--- a/misc/acrn-config/library/scenario_cfg_lib.py
+++ b/misc/acrn-config/library/scenario_cfg_lib.py
@@ -240,6 +240,7 @@ def vm_cpu_affinity_check(config_file, id_cpus_per_vm_dic, item):
else:
use_cpus.append(cpu)
+ sos_vm_cpus = []
pre_launch_cpus = []
post_launch_cpus = []
for vm_i, vm_type in common.VM_TYPES.items():
@@ -251,6 +252,9 @@ def vm_cpu_affinity_check(config_file, id_cpus_per_vm_dic, item):
elif VM_DB[vm_type]['load_type'] == "POST_LAUNCHED_VM":
cpus = [x for x in id_cpus_per_vm_dic[vm_i] if not None]
post_launch_cpus.extend(cpus)
+ elif VM_DB[vm_type]['load_type'] == "SOS_VM":
+ cpus = [x for x in id_cpus_per_vm_dic[vm_i] if not None]
+ sos_vm_cpus.extend(cpus)
# duplicate cpus assign the same VM check
cpus_vm_i = id_cpus_per_vm_dic[vm_i]
@@ -261,6 +265,10 @@ def vm_cpu_affinity_check(config_file, id_cpus_per_vm_dic, item):
return err_dic
if pre_launch_cpus:
+ if "SOS_VM" in common.VM_TYPES and not sos_vm_cpus:
+ key = "SOS VM cpu_affinity"
+ err_dic[key] = "Should assign CPU id for SOS VM"
+
for pcpu in pre_launch_cpus:
if pre_launch_cpus.count(pcpu) >= 2:
key = "Pre launched VM cpu_affinity"
@@ -475,6 +483,10 @@ def cpus_assignment(cpus_per_vm, index):
:return: cpu assignment string
"""
vm_cpu_bmp = {}
+ if "SOS_VM" == common.VM_TYPES[index]:
+ if index not in cpus_per_vm:
+ sos_extend_all_cpus = board_cfg_lib.get_processor_info()
+ cpus_per_vm[index] = sos_extend_all_cpus
for i in range(len(cpus_per_vm[index])):
if i == 0:
diff --git a/misc/acrn-config/scenario_config/vm_configurations_c.py b/misc/acrn-config/scenario_config/vm_configurations_c.py
index 8d8800c79..323dd4fb7 100644
--- a/misc/acrn-config/scenario_config/vm_configurations_c.py
+++ b/misc/acrn-config/scenario_config/vm_configurations_c.py
@@ -193,11 +193,11 @@ def cpu_affinity_output(vm_info, i, config):
:param i: the index of vm id
:param config: file pointor to store the information
"""
- if "SOS_VM" == scenario_cfg_lib.VM_DB[vm_info.load_vm[i]]['load_type']:
- return
- cpu_bits = vm_info.get_cpu_bitmap(i)
- print("\t\t.cpu_affinity = VM{}_CONFIG_CPU_AFFINITY,".format(i), file=config)
+ if "SOS_VM" == common.VM_TYPES[i]:
+ print("\t\t.cpu_affinity = SOS_VM_CONFIG_CPU_AFFINITY,", file=config)
+ else:
+ print("\t\t.cpu_affinity = VM{}_CONFIG_CPU_AFFINITY,".format(i), file=config)
def clos_output(scenario_items, i, config):
diff --git a/misc/acrn-config/scenario_config/vm_configurations_h.py b/misc/acrn-config/scenario_config/vm_configurations_h.py
index 091d3953f..a3c21e358 100644
--- a/misc/acrn-config/scenario_config/vm_configurations_h.py
+++ b/misc/acrn-config/scenario_config/vm_configurations_h.py
@@ -30,12 +30,15 @@ def cpu_affinity_output(vm_info, i, config):
:param i: the index of vm id
:param config: file pointor to store the information
"""
- if "SOS_VM" == scenario_cfg_lib.VM_DB[vm_info.load_vm[i]]['load_type']:
- return
cpu_bits = vm_info.get_cpu_bitmap(i)
- print("#define VM{0}_CONFIG_CPU_AFFINITY {1}".format(
- i, cpu_bits['cpu_map']), file=config)
+ if "SOS_VM" == common.VM_TYPES[i]:
+ print("", file=config)
+ print("#define SOS_VM_CONFIG_CPU_AFFINITY {0}".format(
+ cpu_bits['cpu_map']), file=config)
+ else:
+ print("#define VM{0}_CONFIG_CPU_AFFINITY {1}".format(
+ i, cpu_bits['cpu_map']), file=config)
def clos_config_output(scenario_items, i, config):
"""
@@ -120,8 +123,10 @@ def gen_sos_header(scenario_items, config):
print("\t\t\t\t\tSOS_IDLE\t\\", file=config)
print("\t\t\t\t\tSOS_BOOTARGS_DIFF", file=config)
+ vm_info = scenario_items['vm']
for vm_i,vm_type in common.VM_TYPES.items():
if vm_type == 'SOS_VM':
+ cpu_affinity_output(vm_info, vm_i, config)
clos_config_output(scenario_items, vm_i, config)
print("", file=config)
diff --git a/misc/vm_configs/xmls/config-xmls/apl-mrb/hybrid.xml b/misc/vm_configs/xmls/config-xmls/apl-mrb/hybrid.xml
index 64057d2a2..f05a5f29d 100644
--- a/misc/vm_configs/xmls/config-xmls/apl-mrb/hybrid.xml
+++ b/misc/vm_configs/xmls/config-xmls/apl-mrb/hybrid.xml
@@ -109,6 +109,11 @@
0
+
+ 0
+ 1
+ 2
+
0
diff --git a/misc/vm_configs/xmls/config-xmls/apl-up2/hybrid.xml b/misc/vm_configs/xmls/config-xmls/apl-up2/hybrid.xml
index 2f4ea64a0..3089cef1c 100644
--- a/misc/vm_configs/xmls/config-xmls/apl-up2/hybrid.xml
+++ b/misc/vm_configs/xmls/config-xmls/apl-up2/hybrid.xml
@@ -109,6 +109,11 @@
0
+
+ 0
+ 1
+ 2
+
0
diff --git a/misc/vm_configs/xmls/config-xmls/ehl-crb-b/hybrid.xml b/misc/vm_configs/xmls/config-xmls/ehl-crb-b/hybrid.xml
index bdc49c647..dcd770bae 100644
--- a/misc/vm_configs/xmls/config-xmls/ehl-crb-b/hybrid.xml
+++ b/misc/vm_configs/xmls/config-xmls/ehl-crb-b/hybrid.xml
@@ -117,6 +117,11 @@
0
+
+ 0
+ 1
+ 2
+
0
diff --git a/misc/vm_configs/xmls/config-xmls/generic/hybrid.xml b/misc/vm_configs/xmls/config-xmls/generic/hybrid.xml
index 21a9c6dac..b9ce81245 100644
--- a/misc/vm_configs/xmls/config-xmls/generic/hybrid.xml
+++ b/misc/vm_configs/xmls/config-xmls/generic/hybrid.xml
@@ -107,6 +107,11 @@
0
+
+ 0
+ 1
+ 2
+
0
diff --git a/misc/vm_configs/xmls/config-xmls/generic/hybrid_rt.xml b/misc/vm_configs/xmls/config-xmls/generic/hybrid_rt.xml
index 74becfa4e..d55a25c39 100644
--- a/misc/vm_configs/xmls/config-xmls/generic/hybrid_rt.xml
+++ b/misc/vm_configs/xmls/config-xmls/generic/hybrid_rt.xml
@@ -105,6 +105,10 @@
0
+
+ 0
+ 1
+
0
diff --git a/misc/vm_configs/xmls/config-xmls/nuc6cayh/hybrid.xml b/misc/vm_configs/xmls/config-xmls/nuc6cayh/hybrid.xml
index d1de3185e..89cfd5b64 100644
--- a/misc/vm_configs/xmls/config-xmls/nuc6cayh/hybrid.xml
+++ b/misc/vm_configs/xmls/config-xmls/nuc6cayh/hybrid.xml
@@ -109,6 +109,11 @@
0
+
+ 0
+ 1
+ 2
+
0
diff --git a/misc/vm_configs/xmls/config-xmls/nuc7i7dnb/hybrid.xml b/misc/vm_configs/xmls/config-xmls/nuc7i7dnb/hybrid.xml
index 7e01fcc1d..973642a61 100644
--- a/misc/vm_configs/xmls/config-xmls/nuc7i7dnb/hybrid.xml
+++ b/misc/vm_configs/xmls/config-xmls/nuc7i7dnb/hybrid.xml
@@ -105,6 +105,11 @@
0
+
+ 0
+ 1
+ 2
+
0
diff --git a/misc/vm_configs/xmls/config-xmls/template/SOS_VM.xml b/misc/vm_configs/xmls/config-xmls/template/SOS_VM.xml
index 314d2cbf0..625daef2e 100644
--- a/misc/vm_configs/xmls/config-xmls/template/SOS_VM.xml
+++ b/misc/vm_configs/xmls/config-xmls/template/SOS_VM.xml
@@ -5,6 +5,9 @@
+
+
+
0
diff --git a/misc/vm_configs/xmls/config-xmls/tgl-rvp/hybrid.xml b/misc/vm_configs/xmls/config-xmls/tgl-rvp/hybrid.xml
index 3daef9351..a3776400e 100644
--- a/misc/vm_configs/xmls/config-xmls/tgl-rvp/hybrid.xml
+++ b/misc/vm_configs/xmls/config-xmls/tgl-rvp/hybrid.xml
@@ -105,6 +105,11 @@
0
+
+ 0
+ 1
+ 2
+
0
diff --git a/misc/vm_configs/xmls/config-xmls/whl-ipc-i5/hybrid.xml b/misc/vm_configs/xmls/config-xmls/whl-ipc-i5/hybrid.xml
index ff2d721cf..36f200ba5 100644
--- a/misc/vm_configs/xmls/config-xmls/whl-ipc-i5/hybrid.xml
+++ b/misc/vm_configs/xmls/config-xmls/whl-ipc-i5/hybrid.xml
@@ -105,6 +105,11 @@
0
+
+ 0
+ 1
+ 2
+
0
diff --git a/misc/vm_configs/xmls/config-xmls/whl-ipc-i5/hybrid_rt.xml b/misc/vm_configs/xmls/config-xmls/whl-ipc-i5/hybrid_rt.xml
index 85fce0899..3f5f0e753 100644
--- a/misc/vm_configs/xmls/config-xmls/whl-ipc-i5/hybrid_rt.xml
+++ b/misc/vm_configs/xmls/config-xmls/whl-ipc-i5/hybrid_rt.xml
@@ -106,6 +106,10 @@
0
+
+ 0
+ 1
+
0
diff --git a/misc/vm_configs/xmls/config-xmls/whl-ipc-i7/hybrid.xml b/misc/vm_configs/xmls/config-xmls/whl-ipc-i7/hybrid.xml
index c9ace94f3..5bcd2650e 100644
--- a/misc/vm_configs/xmls/config-xmls/whl-ipc-i7/hybrid.xml
+++ b/misc/vm_configs/xmls/config-xmls/whl-ipc-i7/hybrid.xml
@@ -105,6 +105,11 @@
0
+
+ 0
+ 1
+ 2
+
0
diff --git a/misc/vm_configs/xmls/config-xmls/whl-ipc-i7/hybrid_rt.xml b/misc/vm_configs/xmls/config-xmls/whl-ipc-i7/hybrid_rt.xml
index 6658a5f56..a6651eecb 100644
--- a/misc/vm_configs/xmls/config-xmls/whl-ipc-i7/hybrid_rt.xml
+++ b/misc/vm_configs/xmls/config-xmls/whl-ipc-i7/hybrid_rt.xml
@@ -106,6 +106,10 @@
0
+
+ 0
+ 1
+
0