acrn-config: support generation of per vcpu clos configuraton

Added "vcpu_clos" to configuration XML, here is an example of VM2 with 2 vCPUs:
  <clos desc="Class of Service for Cache Allocation Technology. Please refer SDM 17.19.2 for details and use with caution.">
	<vcpu_clos>1</vcpu_clos>
	<vcpu_clos>0</vcpu_clos>
  </clos>

A macro will be generated in vm_configuration.h:
  #define VM2_VCPU_CLOS          {1U, 0U}

And the macro will be used in vm_configuration.c:
  struct acrn_vm_config vm_configs[CONFIG_MAX_VM_NUM] = {
	...
	{
		...
		.clos = VM2_VCPU_CLOS,
		...
	}
  }

Tracked-On: #4566
Signed-off-by: Yan, Like <like.yan@intel.com>
Reviewed-by: Victor Sun <victor.sun@intel.com>
This commit is contained in:
Yan, Like
2020-03-24 15:38:32 +08:00
committed by wenlingz
parent 2997c4b570
commit 0b384b7284
5 changed files with 79 additions and 9 deletions

View File

@@ -23,7 +23,7 @@ GUEST_FLAG = ["0UL", "GUEST_FLAG_SECURE_WORLD_ENABLED", "GUEST_FLAG_LAPIC_PASSTH
START_HPA_SIZE_LIST = ['0x20000000', '0x40000000', '0x80000000', 'CONFIG_SOS_RAM_SIZE']
MULTI_ITEM = ["guest_flag", "pcpu_id", "input", "block", "network"]
MULTI_ITEM = ["guest_flag", "pcpu_id", "vcpu_clos", "input", "block", "network"]
SIZE_K = 1024
SIZE_M = SIZE_K * 1024
@@ -36,6 +36,7 @@ class MultiItem():
def __init__(self):
self.guest_flag = []
self.pcpu_id = []
self.vcpu_clos = []
self.vir_input = []
self.vir_block = []
self.vir_console = []
@@ -378,6 +379,11 @@ def get_leaf_tag_val(config_file, branch_tag, tag_str=''):
tmp_cpus.append(leaf.text)
continue
# get vcpu_clos for vm
if leaf.tag == "vcpu_clos" and tag_str == "vcpu_clos":
tmp_cpus.append(leaf.text)
continue
# append guest flags for each vm
if tmp_flag and tag_str == "guest_flag":
tmp_tag.append(tmp_flag)
@@ -402,6 +408,10 @@ def get_leaf_value(tmp, tag_str, leaf):
if leaf.tag == "pcpu_id" and tag_str == "pcpu_id":
tmp.multi.pcpu_id.append(leaf.text)
# get vcpu_clos for vm
if leaf.tag == "vcpu_clos" and tag_str == "vcpu_clos":
tmp.multi.vcpu_clos.append(leaf.text)
# get virtio-input for vm
if leaf.tag == "input" and tag_str == "input":
tmp.multi.vir_input.append(leaf.text)
@@ -426,6 +436,10 @@ def get_sub_value(tmp, tag_str, vm_id):
if tmp.multi.pcpu_id and tag_str == "pcpu_id":
tmp.tag[vm_id] = tmp.multi.pcpu_id
# append cpus for vm
if tmp.multi.vcpu_clos and tag_str == "vcpu_clos":
tmp.tag[vm_id] = tmp.multi.vcpu_clos
# append virtio input for vm
if tmp.multi.vir_input and tag_str == "input":
tmp.tag[vm_id] = tmp.multi.vir_input