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 <vijay.dhanraj@intel.com>
Acked-by: Victor Sun <victor.sun@intel.com>
This commit is contained in:
Vijay Dhanraj 2020-02-25 15:14:45 -08:00 committed by wenlingz
parent cdac28e84d
commit b9f469437d
2 changed files with 10 additions and 5 deletions

View File

@ -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

View File

@ -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)