diff --git a/misc/config_tools/acpi_gen/asl_gen.py b/misc/config_tools/acpi_gen/asl_gen.py index 9b4c3861c..a5b25618f 100644 --- a/misc/config_tools/acpi_gen/asl_gen.py +++ b/misc/config_tools/acpi_gen/asl_gen.py @@ -807,7 +807,7 @@ def main(args): if mmio_dev_node is not None and mmio_dev_node.text.strip() == 'y': dict_passthru_devices[vm_id].append(mmio_dev_node.tag) dict_pcpu_list[vm_id] = [] - for pcpu_id in vm.findall('cpu_affinity/pcpu_id'): + for pcpu_id in vm.findall('cpu_affinity//pcpu_id'): if pcpu_id is not None and pcpu_id.text.strip() in pcpu_list: dict_pcpu_list[vm_id].append(int(pcpu_id.text)) diff --git a/misc/config_tools/data/cfl-k700-i7/hybrid_launch_2user_vm.xml b/misc/config_tools/data/cfl-k700-i7/hybrid_launch_2user_vm.xml index 2168e8e3e..61b3f047e 100644 --- a/misc/config_tools/data/cfl-k700-i7/hybrid_launch_2user_vm.xml +++ b/misc/config_tools/data/cfl-k700-i7/hybrid_launch_2user_vm.xml @@ -69,7 +69,9 @@ STANDARD_VM SAFETY_VM0 - 3 + + 3 + 0 @@ -102,9 +104,15 @@ STANDARD_VM ACRN_Service_VM - 0 - 1 - 2 + + 0 + + + 1 + + + 2 + 0 @@ -129,7 +137,9 @@ STANDARD_VM POST_STD_VM1 - 2 + + 2 + 0 @@ -161,7 +171,9 @@ STANDARD_VM POST_STD_VM2 - 2 + + 2 + 0 diff --git a/misc/config_tools/data/cfl-k700-i7/hybrid_rt.xml b/misc/config_tools/data/cfl-k700-i7/hybrid_rt.xml index 84d5d70f7..f1043049c 100644 --- a/misc/config_tools/data/cfl-k700-i7/hybrid_rt.xml +++ b/misc/config_tools/data/cfl-k700-i7/hybrid_rt.xml @@ -78,8 +78,14 @@ PRE_RT_VM0 y - 6 - 7 + + 6 + y + + + 7 + y + 0 @@ -118,12 +124,24 @@ STANDARD_VM ACRN_Service_VM - 0 - 1 - 2 - 3 - 4 - 5 + + 0 + + + 1 + + + 2 + + + 3 + + + 4 + + + 5 + 0 @@ -149,9 +167,15 @@ STANDARD_VM POST_STD_VM1 - 1 - 2 - 3 + + 1 + + + 2 + + + 3 + 0 @@ -166,8 +190,12 @@ STANDARD_VM POST_STD_VM2 - 4 - 5 + + 4 + + + 5 + 0 diff --git a/misc/config_tools/data/cfl-k700-i7/partitioned.xml b/misc/config_tools/data/cfl-k700-i7/partitioned.xml index e043df07b..549231e66 100644 --- a/misc/config_tools/data/cfl-k700-i7/partitioned.xml +++ b/misc/config_tools/data/cfl-k700-i7/partitioned.xml @@ -69,8 +69,12 @@ STANDARD_VM PRE_STD_VM0 - 0 - 2 + + 0 + + + 2 + 0 @@ -107,8 +111,12 @@ STANDARD_VM PRE_STD_VM1 - 1 - 3 + + 1 + + + 3 + 0 diff --git a/misc/config_tools/data/cfl-k700-i7/shared_launch_6user_vm.xml b/misc/config_tools/data/cfl-k700-i7/shared_launch_6user_vm.xml index 04a9d9de9..683616965 100644 --- a/misc/config_tools/data/cfl-k700-i7/shared_launch_6user_vm.xml +++ b/misc/config_tools/data/cfl-k700-i7/shared_launch_6user_vm.xml @@ -81,8 +81,12 @@ STANDARD_VM POST_STD_VM1 - 0 - 1 + + 0 + + + 1 + 0 @@ -116,8 +120,14 @@ POST_RT_VM1 y - 2 - 3 + + 2 + y + + + 3 + y + 0 @@ -150,8 +160,12 @@ STANDARD_VM POST_STD_VM2 - 0 - 1 + + 0 + + + 1 + 0 @@ -184,8 +198,12 @@ STANDARD_VM POST_STD_VM3 - 0 - 1 + + 0 + + + 1 + 0 @@ -218,8 +236,12 @@ STANDARD_VM POST_STD_VM4 - 0 - 1 + + 0 + + + 1 + 0 @@ -252,8 +274,12 @@ STANDARD_VM POST_STD_VM5 - 0 - 1 + + 0 + + + 1 + 0 diff --git a/misc/config_tools/data/generic_board/hybrid_launch_2user_vm.xml b/misc/config_tools/data/generic_board/hybrid_launch_2user_vm.xml index 3931100c1..3796e80b7 100644 --- a/misc/config_tools/data/generic_board/hybrid_launch_2user_vm.xml +++ b/misc/config_tools/data/generic_board/hybrid_launch_2user_vm.xml @@ -69,7 +69,9 @@ STANDARD_VM SAFETY_VM0 - 3 + + 3 + 0 @@ -103,9 +105,15 @@ STANDARD_VM ACRN_Service_VM - 0 - 1 - 2 + + 0 + + + 1 + + + 2 + 0 @@ -129,7 +137,9 @@ STANDARD_VM POST_STD_VM1 - 2 + + 2 + 0 @@ -161,7 +171,9 @@ STANDARD_VM POST_STD_VM2 - 2 + + 2 + 0 diff --git a/misc/config_tools/data/generic_board/hybrid_rt.xml b/misc/config_tools/data/generic_board/hybrid_rt.xml index 85789c875..ad23e1cff 100644 --- a/misc/config_tools/data/generic_board/hybrid_rt.xml +++ b/misc/config_tools/data/generic_board/hybrid_rt.xml @@ -91,8 +91,14 @@ PRE_RT_VM0 y - 2 - 3 + + 2 + y + + + 3 + y + 0 @@ -128,8 +134,12 @@ STANDARD_VM ACRN_Service_VM - 0 - 1 + + 0 + + + 1 + 0 @@ -152,8 +162,12 @@ STANDARD_VM POST_STD_VM1 - 0 - 1 + + 0 + + + 1 + 0 @@ -167,7 +181,9 @@ STANDARD_VM POST_STD_VM2 - 1 + + 1 + 0 diff --git a/misc/config_tools/data/generic_board/partitioned.xml b/misc/config_tools/data/generic_board/partitioned.xml index b23f5982f..d9638d70e 100644 --- a/misc/config_tools/data/generic_board/partitioned.xml +++ b/misc/config_tools/data/generic_board/partitioned.xml @@ -69,8 +69,12 @@ STANDARD_VM PRE_STD_VM0 - 0 - 2 + + 0 + + + 2 + 0 @@ -107,8 +111,12 @@ STANDARD_VM PRE_STD_VM1 - 1 - 3 + + 1 + + + 3 + 0 diff --git a/misc/config_tools/data/generic_board/shared_launch_6user_vm.xml b/misc/config_tools/data/generic_board/shared_launch_6user_vm.xml index 16226a6b5..6fa5b600f 100644 --- a/misc/config_tools/data/generic_board/shared_launch_6user_vm.xml +++ b/misc/config_tools/data/generic_board/shared_launch_6user_vm.xml @@ -89,8 +89,12 @@ STANDARD_VM POST_STD_VM1 - 0 - 1 + + 0 + + + 1 + 0 @@ -124,8 +128,14 @@ POST_RT_VM1 y - 2 - 3 + + 2 + y + + + 3 + y + 0 @@ -158,8 +168,12 @@ STANDARD_VM POST_STD_VM2 - 0 - 1 + + 0 + + + 1 + 0 @@ -192,8 +206,12 @@ STANDARD_VM POST_STD_VM3 - 0 - 1 + + 0 + + + 1 + 0 @@ -226,8 +244,12 @@ STANDARD_VM POST_STD_VM4 - 0 - 1 + + 0 + + + 1 + 0 @@ -260,8 +282,12 @@ STANDARD_VM POST_STD_VM5 - 0 - 1 + + 0 + + + 1 + 0 diff --git a/misc/config_tools/data/nuc11tnbi5/hybrid_launch_2user_vm.xml b/misc/config_tools/data/nuc11tnbi5/hybrid_launch_2user_vm.xml index 387e7a474..08ac293fe 100644 --- a/misc/config_tools/data/nuc11tnbi5/hybrid_launch_2user_vm.xml +++ b/misc/config_tools/data/nuc11tnbi5/hybrid_launch_2user_vm.xml @@ -69,7 +69,9 @@ STANDARD_VM SAFETY_VM0 - 3 + + 3 + 0 @@ -103,9 +105,15 @@ STANDARD_VM ACRN_Service_VM - 0 - 1 - 2 + + 0 + + + 1 + + + 2 + 0 @@ -129,7 +137,9 @@ STANDARD_VM POST_STD_VM1 - 2 + + 2 + 0 @@ -161,7 +171,9 @@ STANDARD_VM POST_STD_VM2 - 2 + + 2 + 0 diff --git a/misc/config_tools/data/nuc11tnbi5/partitioned.xml b/misc/config_tools/data/nuc11tnbi5/partitioned.xml index a5b238f10..275c2703b 100644 --- a/misc/config_tools/data/nuc11tnbi5/partitioned.xml +++ b/misc/config_tools/data/nuc11tnbi5/partitioned.xml @@ -69,8 +69,12 @@ STANDARD_VM PRE_STD_VM0 - 0 - 2 + + 0 + + + 2 + 0 @@ -107,8 +111,12 @@ STANDARD_VM PRE_STD_VM1 - 1 - 3 + + 1 + + + 3 + 0 diff --git a/misc/config_tools/data/nuc11tnbi5/shared_launch_6user_vm.xml b/misc/config_tools/data/nuc11tnbi5/shared_launch_6user_vm.xml index e577a87ef..8be36e0af 100644 --- a/misc/config_tools/data/nuc11tnbi5/shared_launch_6user_vm.xml +++ b/misc/config_tools/data/nuc11tnbi5/shared_launch_6user_vm.xml @@ -101,8 +101,12 @@ STANDARD_VM POST_STD_VM1 - 0 - 1 + + 0 + + + 1 + 0 @@ -136,8 +140,14 @@ POST_RT_VM1 y - 2 - 3 + + 2 + y + + + 3 + y + 0 @@ -170,8 +180,12 @@ STANDARD_VM POST_STD_VM2 - 0 - 1 + + 0 + + + 1 + 0 @@ -204,8 +218,12 @@ STANDARD_VM POST_STD_VM3 - 0 - 1 + + 0 + + + 1 + 0 @@ -238,8 +256,12 @@ STANDARD_VM POST_STD_VM4 - 0 - 1 + + 0 + + + 1 + 0 @@ -272,8 +294,12 @@ STANDARD_VM POST_STD_VM5 - 0 - 1 + + 0 + + + 1 + 0 diff --git a/misc/config_tools/data/qemu/shared.xml b/misc/config_tools/data/qemu/shared.xml index ba6561153..d490e9d34 100644 --- a/misc/config_tools/data/qemu/shared.xml +++ b/misc/config_tools/data/qemu/shared.xml @@ -81,7 +81,9 @@ STANDARD_VM POST_STD_VM1 - 1 + + 1 + 0 diff --git a/misc/config_tools/data/tgl-vecow-spc-7100-Corei7/hybrid.xml b/misc/config_tools/data/tgl-vecow-spc-7100-Corei7/hybrid.xml index f88267d1a..24cade1fc 100644 --- a/misc/config_tools/data/tgl-vecow-spc-7100-Corei7/hybrid.xml +++ b/misc/config_tools/data/tgl-vecow-spc-7100-Corei7/hybrid.xml @@ -69,7 +69,9 @@ STANDARD_VM SAFETY_VM0 - 3 + + 3 + 0 @@ -103,9 +105,15 @@ STANDARD_VM ACRN_Service_VM - 0 - 1 - 2 + + 0 + + + 1 + + + 2 + 0 @@ -130,7 +138,9 @@ STANDARD_VM POST_STD_VM1 - 2 + + 2 + 0 @@ -143,7 +153,9 @@ STANDARD_VM POST_STD_VM2 - 2 + + 2 + 0 diff --git a/misc/config_tools/data/tgl-vecow-spc-7100-Corei7/partitioned.xml b/misc/config_tools/data/tgl-vecow-spc-7100-Corei7/partitioned.xml index 5d56726cd..2a140acce 100644 --- a/misc/config_tools/data/tgl-vecow-spc-7100-Corei7/partitioned.xml +++ b/misc/config_tools/data/tgl-vecow-spc-7100-Corei7/partitioned.xml @@ -69,8 +69,12 @@ STANDARD_VM PRE_STD_VM0 - 0 - 2 + + 0 + + + 2 + 0 @@ -107,8 +111,12 @@ STANDARD_VM PRE_STD_VM1 - 1 - 3 + + 1 + + + 3 + 0 diff --git a/misc/config_tools/data/tgl-vecow-spc-7100-Corei7/shared_launch_2user_vm.xml b/misc/config_tools/data/tgl-vecow-spc-7100-Corei7/shared_launch_2user_vm.xml index ceb6cde17..94ada0c2f 100644 --- a/misc/config_tools/data/tgl-vecow-spc-7100-Corei7/shared_launch_2user_vm.xml +++ b/misc/config_tools/data/tgl-vecow-spc-7100-Corei7/shared_launch_2user_vm.xml @@ -102,8 +102,12 @@ STANDARD_VM POST_STD_VM1 - 0 - 1 + + 0 + + + 1 + 0 @@ -141,8 +145,14 @@ POST_RT_VM1 y - 2 - 3 + + 2 + y + + + 3 + y + 0 diff --git a/misc/config_tools/data/whl-ipc-i5/hybrid.xml b/misc/config_tools/data/whl-ipc-i5/hybrid.xml index e66914ddb..bb8664049 100644 --- a/misc/config_tools/data/whl-ipc-i5/hybrid.xml +++ b/misc/config_tools/data/whl-ipc-i5/hybrid.xml @@ -61,7 +61,9 @@ STANDARD_VM SAFETY_VM0 - 3 + + 3 + 0 @@ -93,9 +95,15 @@ STANDARD_VM ACRN_Service_VM - 0 - 1 - 2 + + 0 + + + 1 + + + 2 + 0 @@ -119,7 +127,9 @@ STANDARD_VM POST_STD_VM1 - 2 + + 2 + 0 diff --git a/misc/config_tools/data/whl-ipc-i5/hybrid_rt_launch_1user_vm_waag.xml b/misc/config_tools/data/whl-ipc-i5/hybrid_rt_launch_1user_vm_waag.xml index cd85b8bb7..789e0fbf1 100644 --- a/misc/config_tools/data/whl-ipc-i5/hybrid_rt_launch_1user_vm_waag.xml +++ b/misc/config_tools/data/whl-ipc-i5/hybrid_rt_launch_1user_vm_waag.xml @@ -78,8 +78,14 @@ PRE_RT_VM0 y - 2 - 3 + + 2 + y + + + 3 + y + 0 @@ -118,8 +124,12 @@ STANDARD_VM ACRN_Service_VM - 0 - 1 + + 0 + + + 1 + 0 @@ -142,8 +152,12 @@ STANDARD_VM POST_STD_VM1 - 0 - 1 + + 0 + + + 1 + 0 @@ -177,7 +191,9 @@ STANDARD_VM POST_STD_VM2 - 1 + + 1 + 0 diff --git a/misc/config_tools/data/whl-ipc-i5/partitioned.xml b/misc/config_tools/data/whl-ipc-i5/partitioned.xml index b95dd75c4..9a2c769f1 100644 --- a/misc/config_tools/data/whl-ipc-i5/partitioned.xml +++ b/misc/config_tools/data/whl-ipc-i5/partitioned.xml @@ -61,8 +61,12 @@ STANDARD_VM PRE_STD_VM0 - 0 - 2 + + 0 + + + 2 + 0 @@ -101,8 +105,12 @@ STANDARD_VM PRE_STD_VM1 - 1 - 3 + + 1 + + + 3 + 0 diff --git a/misc/config_tools/data/whl-ipc-i5/shared_launch_1user_vm_hardrt.xml b/misc/config_tools/data/whl-ipc-i5/shared_launch_1user_vm_hardrt.xml index 733b9d541..c6e011776 100644 --- a/misc/config_tools/data/whl-ipc-i5/shared_launch_1user_vm_hardrt.xml +++ b/misc/config_tools/data/whl-ipc-i5/shared_launch_1user_vm_hardrt.xml @@ -81,8 +81,12 @@ STANDARD_VM POST_STD_VM1 - 0 - 1 + + 0 + + + 1 + 0 @@ -96,8 +100,14 @@ POST_STD_VM1 y - 2 - 3 + + 2 + y + + + 3 + y + 0 @@ -130,8 +140,12 @@ STANDARD_VM POST_STD_VM2 - 0 - 1 + + 0 + + + 1 + 0 @@ -145,8 +159,12 @@ STANDARD_VM POST_STD_VM3 - 0 - 1 + + 0 + + + 1 + 0 @@ -160,8 +178,12 @@ STANDARD_VM POST_STD_VM4 - 0 - 1 + + 0 + + + 1 + 0 @@ -175,8 +197,12 @@ STANDARD_VM POST_STD_VM5 - 0 - 1 + + 0 + + + 1 + 0 diff --git a/misc/config_tools/data/whl-ipc-i5/shared_launch_1user_vm_vxworks.xml b/misc/config_tools/data/whl-ipc-i5/shared_launch_1user_vm_vxworks.xml index eee307358..6a4cb1145 100644 --- a/misc/config_tools/data/whl-ipc-i5/shared_launch_1user_vm_vxworks.xml +++ b/misc/config_tools/data/whl-ipc-i5/shared_launch_1user_vm_vxworks.xml @@ -82,8 +82,14 @@ POST_STD_VM1 y - 0 - 1 + + 0 + y + + + 1 + y + 0 @@ -113,8 +119,14 @@ RTVM POST_RT_VM1 - 2 - 3 + + 2 + y + + + 3 + y + 0 @@ -128,8 +140,12 @@ STANDARD_VM POST_STD_VM2 - 0 - 1 + + 0 + + + 1 + 0 @@ -143,8 +159,12 @@ STANDARD_VM POST_STD_VM3 - 0 - 1 + + 0 + + + 1 + 0 @@ -158,8 +178,12 @@ STANDARD_VM POST_STD_VM4 - 0 - 1 + + 0 + + + 1 + 0 @@ -173,8 +197,12 @@ STANDARD_VM POST_STD_VM5 - 0 - 1 + + 0 + + + 1 + 0 diff --git a/misc/config_tools/data/whl-ipc-i5/shared_launch_1user_vm_waag.xml b/misc/config_tools/data/whl-ipc-i5/shared_launch_1user_vm_waag.xml index 790c7cdc9..42c2196c2 100644 --- a/misc/config_tools/data/whl-ipc-i5/shared_launch_1user_vm_waag.xml +++ b/misc/config_tools/data/whl-ipc-i5/shared_launch_1user_vm_waag.xml @@ -81,8 +81,12 @@ STANDARD_VM POST_STD_VM1 - 0 - 1 + + 0 + + + 1 + 0 @@ -116,8 +120,14 @@ RTVM POST_RT_VM1 - 2 - 3 + + 2 + y + + + 3 + y + 0 @@ -131,8 +141,12 @@ STANDARD_VM POST_STD_VM2 - 0 - 1 + + 0 + + + 1 + 0 @@ -146,8 +160,12 @@ STANDARD_VM POST_STD_VM3 - 0 - 1 + + 0 + + + 1 + 0 @@ -161,8 +179,12 @@ STANDARD_VM POST_STD_VM4 - 0 - 1 + + 0 + + + 1 + 0 @@ -176,8 +198,12 @@ STANDARD_VM POST_STD_VM5 - 0 - 1 + + 0 + + + 1 + 0 diff --git a/misc/config_tools/data/whl-ipc-i5/shared_launch_2user_vm.xml b/misc/config_tools/data/whl-ipc-i5/shared_launch_2user_vm.xml index 54a500009..683c93b1b 100644 --- a/misc/config_tools/data/whl-ipc-i5/shared_launch_2user_vm.xml +++ b/misc/config_tools/data/whl-ipc-i5/shared_launch_2user_vm.xml @@ -81,8 +81,12 @@ STANDARD_VM POST_STD_VM1 - 0 - 1 + + 0 + + + 1 + 0 @@ -117,8 +121,14 @@ POST_RT_VM1 y - 2 - 3 + + 2 + y + + + 3 + y + 0 @@ -151,8 +161,12 @@ STANDARD_VM POST_STD_VM2 - 0 - 1 + + 0 + + + 1 + 0 @@ -166,8 +180,12 @@ STANDARD_VM POST_STD_VM3 - 0 - 1 + + 0 + + + 1 + 0 @@ -181,8 +199,12 @@ STANDARD_VM POST_STD_VM4 - 0 - 1 + + 0 + + + 1 + 0 @@ -196,8 +218,12 @@ STANDARD_VM POST_STD_VM5 - 0 - 1 + + 0 + + + 1 + 0 diff --git a/misc/config_tools/data/whl-ipc-i5/shared_launch_6user_vm.xml b/misc/config_tools/data/whl-ipc-i5/shared_launch_6user_vm.xml index efa6a08e7..80ca0ecb4 100644 --- a/misc/config_tools/data/whl-ipc-i5/shared_launch_6user_vm.xml +++ b/misc/config_tools/data/whl-ipc-i5/shared_launch_6user_vm.xml @@ -81,8 +81,12 @@ STANDARD_VM POST_STD_VM1 - 0 - 1 + + 0 + + + 1 + 0 @@ -117,8 +121,14 @@ POST_RT_VM1 y - 2 - 3 + + 2 + y + + + 3 + y + 0 @@ -151,8 +161,12 @@ STANDARD_VM POST_STD_VM2 - 0 - 1 + + 0 + + + 1 + 0 @@ -179,8 +193,12 @@ STANDARD_VM POST_STD_VM3 - 0 - 1 + + 0 + + + 1 + 0 @@ -207,8 +225,12 @@ STANDARD_VM POST_STD_VM4 - 0 - 1 + + 0 + + + 1 + 0 @@ -235,8 +257,12 @@ STANDARD_VM POST_STD_VM5 - 0 - 1 + + 0 + + + 1 + 0 diff --git a/misc/config_tools/launch_config/launch_cfg_gen.py b/misc/config_tools/launch_config/launch_cfg_gen.py index 3c8f56c85..94bbb3eb0 100755 --- a/misc/config_tools/launch_config/launch_cfg_gen.py +++ b/misc/config_tools/launch_config/launch_cfg_gen.py @@ -206,7 +206,7 @@ def generate_for_one_vm(board_etree, hv_scenario_etree, vm_scenario_etree, vm_id ### # CPU and memory resources ### - cpus = set(eval_xpath_all(vm_scenario_etree, ".//cpu_affinity/pcpu_id[text() != '']/text()")) + cpus = set(eval_xpath_all(vm_scenario_etree, ".//cpu_affinity//pcpu_id[text() != '']/text()")) lapic_ids = cpu_id_to_lapic_id(board_etree, vm_name, cpus) if lapic_ids: script.add_dynamic_dm_parameter("add_cpus", f"{' '.join([str(x) for x in sorted(lapic_ids)])}") diff --git a/misc/config_tools/scenario_config/upgrader.py b/misc/config_tools/scenario_config/upgrader.py index 1bbd22de4..904777150 100755 --- a/misc/config_tools/scenario_config/upgrader.py +++ b/misc/config_tools/scenario_config/upgrader.py @@ -498,6 +498,29 @@ class ScenarioUpgrader(ScenarioTransformer): return False + def move_pcpu(self, xsd_element_node, xml_parent_node, new_nodes): + vm_type = self.get_node(xml_parent_node, "parent::vm/vm_type/text()") + + pcpus = self.get_from_old_launch_data(xml_parent_node, "cpu_affinity/pcpu_id[text() != '']") + if not pcpus: + pcpus = self.get_from_old_data(xml_parent_node, "cpu_affinity/pcpu_id[text() != '']") + + if pcpus: + for n in pcpus: + new_node = etree.Element(xsd_element_node.get("name")) + etree.SubElement(new_node, "pcpu_id").text = n.text + if vm_type == "RTVM": + etree.SubElement(new_node, "real_time_vcpu").text = "y" + new_nodes.append(new_node) + self.old_data_nodes.discard(n) + else: + for n in self.get_from_old_data(xml_parent_node, "cpu_affinity/pcpu"): + new_nodes.append(n) + for child in n.iter(): + self.old_data_nodes.discard(child) + + return False + def move_os_type(self, xsd_element_node, xml_parent_node, new_nodes): old_os_type_nodes = self.get_from_old_launch_data(xml_parent_node, ".//user_vm_type") @@ -627,6 +650,7 @@ class ScenarioUpgrader(ScenarioTransformer): data_movers = { "vm/name": partialmethod(move_data_from_either_xml, "name", "vm_name"), + "pcpu": move_pcpu, "pcpu_id": partialmethod(move_data_from_either_xml, "cpu_affinity/pcpu_id[text() != '']", "cpu_affinity/pcpu_id[text() != '']"), "pci_dev": partialmethod(move_data_from_both_xmls, ".//pci_devs/pci_dev[text()]", "passthrough_devices/*[text()] | sriov/*[text()]"), "PTM": partialmethod(move_data_from_either_xml, ".//PTM", "enable_ptm"), @@ -670,7 +694,12 @@ class ScenarioUpgrader(ScenarioTransformer): def add_missing_nodes(self, xsd_element_node, xml_parent_node, xml_anchor_node): new_nodes = [] def call_mover(mover): - if isinstance(mover, partialmethod): + if isinstance(mover, list): + ret = False + for fn in mover: + ret = call_mover(fn) + return ret + elif isinstance(mover, partialmethod): return mover.__get__(self, type(self))(xsd_element_node, xml_parent_node, new_nodes) else: return mover(self, xsd_element_node, xml_parent_node, new_nodes) diff --git a/misc/config_tools/schema/VMtypes.xsd b/misc/config_tools/schema/VMtypes.xsd index 8c2ec68e9..b3122ae44 100644 --- a/misc/config_tools/schema/VMtypes.xsd +++ b/misc/config_tools/schema/VMtypes.xsd @@ -43,8 +43,24 @@ + + + + ID of the pCPU that this VM's vCPU is allowed to pin to. + + + + + Whether this vCPU is used for real-time-critical workloads. + + + + + + - + A pCPU that this VM's vCPU is allowed to pin to. diff --git a/misc/config_tools/schema/checks/cpu_assignment.xsd b/misc/config_tools/schema/checks/cpu_assignment.xsd index ed29971bf..c7f7d2168 100644 --- a/misc/config_tools/schema/checks/cpu_assignment.xsd +++ b/misc/config_tools/schema/checks/cpu_assignment.xsd @@ -5,30 +5,30 @@ xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:acrn="https://projectacrn.org"> - + The physical CPU {$cpu} allocated to VM "{$cpu/ancestor::vm/name}" does not exist on the target board. Remove this CPU from the CPU affinity setting. + count(distinct-values($vm//cpu_affinity//pcpu_id)) = count($vm//cpu_affinity//pcpu_id)"> - VM "{$vm/name}" repeats a physical CPU affinity assignment: {$vm//cpu_affinity/pcpu_id}. Remove the duplicates. + VM "{$vm/name}" repeats a physical CPU affinity assignment: {$vm//cpu_affinity//pcpu_id}. Remove the duplicates. - - - Physical CPU {$pcpu} is assigned to pre-launched real-time VM (RTVM) "{$pcpu/ancestor::vm/name}" and thus cannot be shared among multiple VMs. Look for, and probably remove, any affinity assignments to {$pcpu} in this VM's settings: {//vm[cpu_affinity/pcpu_id = $pcpu]/name}. + + + Physical CPU {$pcpu} is assigned to pre-launched real-time VM (RTVM) "{$pcpu/ancestor::vm/name}" and thus cannot be shared among multiple VMs. Look for, and probably remove, any affinity assignments to {$pcpu} in this VM's settings: {//vm[cpu_affinity//pcpu_id = $pcpu]/name}. + count(distinct-values(processors//thread[cpu_id = $vm//cpu_affinity//pcpu_id]/core_type)) <= 1"> - The physical CPUs allocated to the VM "{$vm/name}" have both performance cores {processors//thread[cpu_id = $vm//cpu_affinity/pcpu_id and core_type = 'Core']/cpu_id} and efficient cores {processors//thread[cpu_id = $vm//cpu_affinity/pcpu_id and core_type = 'Atom']/cpu_id}, which is unsupported. Remove either all performance or all efficient cores from the CPU affinity. + The physical CPUs allocated to the VM "{$vm/name}" have both performance cores {processors//thread[cpu_id = $vm//cpu_affinity//pcpu_id and core_type = 'Core']/cpu_id} and efficient cores {processors//thread[cpu_id = $vm//cpu_affinity//pcpu_id and core_type = 'Atom']/cpu_id}, which is unsupported. Remove either all performance or all efficient cores from the CPU affinity. diff --git a/misc/config_tools/schema/config.xsd b/misc/config_tools/schema/config.xsd index fe0651c98..ecd105629 100644 --- a/misc/config_tools/schema/config.xsd +++ b/misc/config_tools/schema/config.xsd @@ -342,7 +342,7 @@ Refer to :ref:`vuart_config` for detailed vUART settings. Specify TPM2 FIXUP for VM. - + Select a subset of physical CPUs that this VM can use. More than one can be selected. diff --git a/misc/config_tools/static_allocators/cpu_affinity.py b/misc/config_tools/static_allocators/cpu_affinity.py index 8f4cf1113..ff80eb98d 100644 --- a/misc/config_tools/static_allocators/cpu_affinity.py +++ b/misc/config_tools/static_allocators/cpu_affinity.py @@ -13,11 +13,11 @@ def sos_cpu_affinity(etree): if common.get_node("//vm[load_order = 'SERVICE_VM']", etree) is None: return None - if common.get_node("//vm[load_order = 'SERVICE_VM' and count(cpu_affinity/pcpu_id)]", etree) is not None: + if common.get_node("//vm[load_order = 'SERVICE_VM' and count(cpu_affinity//pcpu_id)]", etree) is not None: return None sos_extend_all_cpus = board_cfg_lib.get_processor_info() - pre_all_cpus = etree.xpath("//vm[load_order = 'PRE_LAUNCHED_VM']/cpu_affinity/pcpu_id/text()") + pre_all_cpus = etree.xpath("//vm[load_order = 'PRE_LAUNCHED_VM']/cpu_affinity//pcpu_id/text()") cpus_for_sos = list(set(sos_extend_all_cpus) - set(pre_all_cpus)) return sorted(cpus_for_sos) diff --git a/misc/config_tools/xforms/misc_cfg.h.xsl b/misc/config_tools/xforms/misc_cfg.h.xsl index 39a7b7ae9..48faa8a39 100644 --- a/misc/config_tools/xforms/misc_cfg.h.xsl +++ b/misc/config_tools/xforms/misc_cfg.h.xsl @@ -80,7 +80,7 @@ - + @@ -105,10 +105,10 @@ - + - +