mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2025-07-12 23:00:35 +00:00
acrn-config: fix build issue for mrb board
Add missing IVSHMEM tag in mrb board xml file to fix build issue Correct misspelled function name Use better error messages Tracked-On: #5221 Signed-off-by: dongshen <dongsheng.x.zhang@intel.com>
This commit is contained in:
parent
58a71b67ab
commit
678d8c1665
@ -30,10 +30,10 @@ def empty_check(val, prime_item, item, sub_item=''):
|
|||||||
if not val or val == None:
|
if not val or val == None:
|
||||||
if sub_item:
|
if sub_item:
|
||||||
key = 'hv,{},{},{}'.format(prime_item, item, sub_item)
|
key = 'hv,{},{},{}'.format(prime_item, item, sub_item)
|
||||||
ERR_LIST[key] = "{} should not empty".format(sub_item)
|
ERR_LIST[key] = "{} should not be empty".format(sub_item)
|
||||||
else:
|
else:
|
||||||
key = 'hv,{},{}'.format(prime_item, item)
|
key = 'hv,{},{}'.format(prime_item, item)
|
||||||
ERR_LIST[key] = "{} should not empty".format(item)
|
ERR_LIST[key] = "{} should not be empty".format(item)
|
||||||
return True
|
return True
|
||||||
|
|
||||||
return False
|
return False
|
||||||
|
@ -27,8 +27,10 @@ GEN_FILE = ["vm_configurations.h", "vm_configurations.c", "pci_dev.c", ".config"
|
|||||||
|
|
||||||
def get_scenario_item_values(board_info, scenario_info):
|
def get_scenario_item_values(board_info, scenario_info):
|
||||||
"""
|
"""
|
||||||
Get items which capable multi select for user
|
Glue code to provide user selectable options to config UI tool.
|
||||||
:param board_info: it is a file what contains board information for script to read from
|
Return a dictionary of key-value pairs containing features and corresponding lists of
|
||||||
|
user selectable values to the config UI tool.
|
||||||
|
:param board_info: file that contains board information
|
||||||
"""
|
"""
|
||||||
hv_cfg_lib.ERR_LIST = {}
|
hv_cfg_lib.ERR_LIST = {}
|
||||||
scenario_item_values = {}
|
scenario_item_values = {}
|
||||||
@ -41,7 +43,7 @@ def get_scenario_item_values(board_info, scenario_info):
|
|||||||
common.get_vm_num(scenario_info)
|
common.get_vm_num(scenario_info)
|
||||||
common.get_vm_types()
|
common.get_vm_types()
|
||||||
|
|
||||||
# pre scenario
|
# per scenario
|
||||||
guest_flags = copy.deepcopy(common.GUEST_FLAG)
|
guest_flags = copy.deepcopy(common.GUEST_FLAG)
|
||||||
guest_flags.remove('0UL')
|
guest_flags.remove('0UL')
|
||||||
scenario_item_values['vm,vm_type'] = scenario_cfg_lib.LOAD_VM_TYPE
|
scenario_item_values['vm,vm_type'] = scenario_cfg_lib.LOAD_VM_TYPE
|
||||||
@ -52,7 +54,7 @@ def get_scenario_item_values(board_info, scenario_info):
|
|||||||
scenario_item_values["vm,os_config,kern_type"] = scenario_cfg_lib.KERN_TYPE_LIST
|
scenario_item_values["vm,os_config,kern_type"] = scenario_cfg_lib.KERN_TYPE_LIST
|
||||||
scenario_item_values.update(scenario_cfg_lib.avl_vuart_ui_select(scenario_info))
|
scenario_item_values.update(scenario_cfg_lib.avl_vuart_ui_select(scenario_info))
|
||||||
|
|
||||||
# pre board_private
|
# board
|
||||||
(scenario_item_values["vm,board_private,rootfs"], num) = board_cfg_lib.get_rootfs(board_info)
|
(scenario_item_values["vm,board_private,rootfs"], num) = board_cfg_lib.get_rootfs(board_info)
|
||||||
|
|
||||||
scenario_item_values["hv,DEBUG_OPTIONS,RELEASE"] = hv_cfg_lib.N_Y
|
scenario_item_values["hv,DEBUG_OPTIONS,RELEASE"] = hv_cfg_lib.N_Y
|
||||||
@ -82,10 +84,10 @@ def get_scenario_item_values(board_info, scenario_info):
|
|||||||
|
|
||||||
def validate_scenario_setting(board_info, scenario_info):
|
def validate_scenario_setting(board_info, scenario_info):
|
||||||
"""
|
"""
|
||||||
This is validate the data setting from scenario xml
|
Validate settings in scenario xml
|
||||||
:param board_info: it is a file what contains board information for script to read from
|
:param board_info: board file
|
||||||
:param scenario_info: it is a file what user have already setting to
|
:param scenario_info: scenario file
|
||||||
:return: return a dictionary contain errors
|
:return: return a dictionary that contains errors
|
||||||
"""
|
"""
|
||||||
hv_cfg_lib.ERR_LIST = {}
|
hv_cfg_lib.ERR_LIST = {}
|
||||||
scenario_cfg_lib.ERR_LIST = {}
|
scenario_cfg_lib.ERR_LIST = {}
|
||||||
@ -111,8 +113,8 @@ def validate_scenario_setting(board_info, scenario_info):
|
|||||||
|
|
||||||
def main(args):
|
def main(args):
|
||||||
"""
|
"""
|
||||||
This is main function to start generate source code related with board
|
Generate board related source code
|
||||||
:param args: it is a command line args for the script
|
:param args: command line args
|
||||||
"""
|
"""
|
||||||
err_dic = {}
|
err_dic = {}
|
||||||
|
|
||||||
@ -139,13 +141,13 @@ def main(args):
|
|||||||
return err_dic
|
return err_dic
|
||||||
|
|
||||||
if common.VM_COUNT > common.MAX_VM_NUM:
|
if common.VM_COUNT > common.MAX_VM_NUM:
|
||||||
err_dic['vm count'] = "The vm count in config xml should be less or equal {}!".format(common.MAX_VM_NUM)
|
err_dic['vm count'] = "Number of VMs in scenario xml file should be no greater than {}!".format(common.MAX_VM_NUM)
|
||||||
return err_dic
|
return err_dic
|
||||||
|
|
||||||
# check if this is the scenario config which matched board info
|
# check if this is the scenario config which matches board info
|
||||||
(err_dic, status) = common.is_config_file_match()
|
(err_dic, status) = common.is_config_file_match()
|
||||||
if not status:
|
if not status:
|
||||||
err_dic['scenario config'] = "The board xml and scenario xml should be matched!"
|
err_dic['scenario config'] = "The board xml file does not match scenario xml file!"
|
||||||
return err_dic
|
return err_dic
|
||||||
|
|
||||||
if params['--out']:
|
if params['--out']:
|
||||||
@ -170,7 +172,7 @@ def main(args):
|
|||||||
get_scenario_item_values(params['--board'], params['--scenario'])
|
get_scenario_item_values(params['--board'], params['--scenario'])
|
||||||
(err_dic, scenario_items) = validate_scenario_setting(params['--board'], params['--scenario'])
|
(err_dic, scenario_items) = validate_scenario_setting(params['--board'], params['--scenario'])
|
||||||
if err_dic:
|
if err_dic:
|
||||||
common.print_red("Validate the scenario item failure", err=True)
|
common.print_red("Scenario xml file validation failed:", err=True)
|
||||||
return err_dic
|
return err_dic
|
||||||
|
|
||||||
# generate board defconfig
|
# generate board defconfig
|
||||||
@ -199,9 +201,9 @@ def main(args):
|
|||||||
pci_dev_c.generate_file(scenario_items['vm'], config)
|
pci_dev_c.generate_file(scenario_items['vm'], config)
|
||||||
|
|
||||||
if not err_dic:
|
if not err_dic:
|
||||||
print("Scenario configurations for {} is generated successfully.".format(scenario))
|
print("Scenario configuration files were created successfully.")
|
||||||
else:
|
else:
|
||||||
print("Scenario configurations for {} is generated failed.".format(scenario))
|
print("Failed to create scenario configuration files.")
|
||||||
|
|
||||||
return err_dic
|
return err_dic
|
||||||
|
|
||||||
|
@ -382,7 +382,7 @@ def gen_post_launch_vm(vm_type, vm_i, scenario_items, config):
|
|||||||
print("\t},", file=config)
|
print("\t},", file=config)
|
||||||
|
|
||||||
|
|
||||||
def pre_launch_definiation(vm_info, config):
|
def pre_launch_definition(vm_info, config):
|
||||||
|
|
||||||
for vm_i,vm_type in common.VM_TYPES.items():
|
for vm_i,vm_type in common.VM_TYPES.items():
|
||||||
if scenario_cfg_lib.VM_DB[vm_type]['load_type'] not in ["PRE_LAUNCHED_VM", "POST_LAUNCHED_VM"]:
|
if scenario_cfg_lib.VM_DB[vm_type]['load_type'] not in ["PRE_LAUNCHED_VM", "POST_LAUNCHED_VM"]:
|
||||||
@ -404,7 +404,7 @@ def generate_file(scenario_items, config):
|
|||||||
gen_source_header(config)
|
gen_source_header(config)
|
||||||
for vm_i,pci_dev_num in vm_info.cfg_pci.pci_dev_num.items():
|
for vm_i,pci_dev_num in vm_info.cfg_pci.pci_dev_num.items():
|
||||||
if pci_dev_num >= 2:
|
if pci_dev_num >= 2:
|
||||||
pre_launch_definiation(vm_info, config)
|
pre_launch_definition(vm_info, config)
|
||||||
break
|
break
|
||||||
|
|
||||||
print("struct acrn_vm_config vm_configs[CONFIG_MAX_VM_NUM] = {", file=config)
|
print("struct acrn_vm_config vm_configs[CONFIG_MAX_VM_NUM] = {", file=config)
|
||||||
|
@ -27,6 +27,10 @@
|
|||||||
<ACPI_PARSE_ENABLED desc="Enable ACPI runtime parsing.">y</ACPI_PARSE_ENABLED>
|
<ACPI_PARSE_ENABLED desc="Enable ACPI runtime parsing.">y</ACPI_PARSE_ENABLED>
|
||||||
<L1D_VMENTRY_ENABLED desc="Enable L1 cache flush before VM entry.">n</L1D_VMENTRY_ENABLED>
|
<L1D_VMENTRY_ENABLED desc="Enable L1 cache flush before VM entry.">n</L1D_VMENTRY_ENABLED>
|
||||||
<MCE_ON_PSC_DISABLED desc="Force to disable software workaround for Machine Check Error on Page Size Change.">n</MCE_ON_PSC_DISABLED>
|
<MCE_ON_PSC_DISABLED desc="Force to disable software workaround for Machine Check Error on Page Size Change.">n</MCE_ON_PSC_DISABLED>
|
||||||
|
<IVSHMEM desc="IVSHMEM configuration">
|
||||||
|
<IVSHMEM_ENABLED desc="Enable Share Memory between VMs by IVSHMEM.">n</IVSHMEM_ENABLED>
|
||||||
|
<IVSHMEM_REGION desc="the name, size, colon separated IDs of communication VMs of share memory region, separated by comma like this: hv:/shm_region_0, 0x200000, 0:2"></IVSHMEM_REGION>
|
||||||
|
</IVSHMEM>
|
||||||
</FEATURES>
|
</FEATURES>
|
||||||
|
|
||||||
<MEMORY>
|
<MEMORY>
|
||||||
|
Loading…
Reference in New Issue
Block a user