From b9f469437df56883f3ad764ba4719be8d63ff03f Mon Sep 17 00:00:00 2001 From: Vijay Dhanraj Date: Tue, 25 Feb 2020 15:14:45 -0800 Subject: [PATCH] acrn-config: Update common platform clos max on scenario and vm configuration This patch adds support for, 1. Providing list of max supported CLOS value that is common between all RDT resource to user when configuring scenario xml. 2. Validate and set the clos value in the vm_configuration file. Tracked-On: #3715 Signed-off-by: Vijay Dhanraj Acked-by: Victor Sun --- misc/acrn-config/scenario_config/scenario_item.py | 7 ++++--- misc/acrn-config/scenario_config/vm_configurations_c.py | 8 ++++++-- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/misc/acrn-config/scenario_config/scenario_item.py b/misc/acrn-config/scenario_config/scenario_item.py index 48f180711..137e338ec 100644 --- a/misc/acrn-config/scenario_config/scenario_item.py +++ b/misc/acrn-config/scenario_config/scenario_item.py @@ -47,9 +47,10 @@ class HwInfo: :return: clos support list """ self.clos_val = [] - (clos_support, clos_max) = board_cfg_lib.clos_info_parser(self.board_info) - if clos_support: - for i_cnt in range(clos_max): + (rdt_resources, rdt_res_clos_max, _) = board_cfg_lib.clos_info_parser(self.board_info) + if len(rdt_resources) != 0 and len(rdt_res_clos_max) != 0: + common_clos_max = min(rdt_res_clos_max) + for i_cnt in range(common_clos_max): self.clos_val.append(str(i_cnt)) return self.clos_val diff --git a/misc/acrn-config/scenario_config/vm_configurations_c.py b/misc/acrn-config/scenario_config/vm_configurations_c.py index 91e4ac276..bb1db00be 100644 --- a/misc/acrn-config/scenario_config/vm_configurations_c.py +++ b/misc/acrn-config/scenario_config/vm_configurations_c.py @@ -196,8 +196,12 @@ def clos_output(vm_info, i, config): :param config: it is the pointer which file write to :return: None """ - (cache_support, clos_max) = board_cfg_lib.clos_info_parser(scenario_cfg_lib.BOARD_INFO_FILE) - if cache_support != "False" and clos_max > 0 and i in vm_info.clos_set: + (rdt_res, rdt_res_clos_max, _) = board_cfg_lib.clos_info_parser(scenario_cfg_lib.BOARD_INFO_FILE) + if len(rdt_res_clos_max) != 0: + common_clos_max = min(rdt_res_clos_max) + else: + common_clos_max = 0 + if len(rdt_res) != 0 and common_clos_max !=0 and i in vm_info.clos_set: print("\t\t.clos = {0}U,".format(vm_info.clos_set[i]), file=config)