From 52268f5cc289fa6d208fbd024bf42607f45b80fc Mon Sep 17 00:00:00 2001 From: Chenli Wei Date: Tue, 12 Apr 2022 19:42:34 +0800 Subject: [PATCH] config_tools: refine memory setting for HPAn 1. Update the data structure of vm/memory in scenario and schema files. The scenario will look like this. xxx xxx 2. Update xsl files to generate the related struct. Tracked-On: #6690 Signed-off-by: Chenli Wei Signed-off-by: Kunhui-Li Reviewed-by: Junjie Mao --- .../launch_config/launch_cfg_gen.py | 2 +- misc/config_tools/schema/VMtypes.xsd | 43 ++++++++++--------- misc/config_tools/schema/config.xsd | 6 +-- .../xforms/vm_configurations.c.xsl | 31 +++++++------ .../xforms/vm_configurations.h.xsl | 12 ------ 5 files changed, 44 insertions(+), 50 deletions(-) diff --git a/misc/config_tools/launch_config/launch_cfg_gen.py b/misc/config_tools/launch_config/launch_cfg_gen.py index b688b7473..0dbd4c986 100755 --- a/misc/config_tools/launch_config/launch_cfg_gen.py +++ b/misc/config_tools/launch_config/launch_cfg_gen.py @@ -211,7 +211,7 @@ def generate_for_one_vm(board_etree, hv_scenario_etree, vm_scenario_etree, vm_id if lapic_ids: script.add_dynamic_dm_parameter("add_cpus", f"{' '.join([str(x) for x in sorted(lapic_ids)])}") - script.add_plain_dm_parameter(f"-m {eval_xpath(vm_scenario_etree, './/memory/whole/text()')}M") + script.add_plain_dm_parameter(f"-m {eval_xpath(vm_scenario_etree, './/memory/size/text()')}M") if eval_xpath(vm_scenario_etree, "//SSRAM_ENABLED") == "y" and \ eval_xpath(vm_scenario_etree, ".//vm_type/text()") == "RTVM": diff --git a/misc/config_tools/schema/VMtypes.xsd b/misc/config_tools/schema/VMtypes.xsd index b3122ae44..674ba6551 100644 --- a/misc/config_tools/schema/VMtypes.xsd +++ b/misc/config_tools/schema/VMtypes.xsd @@ -100,31 +100,32 @@ CLOSID 0 and the second is mapped to virtual CLOSID 1, etc. + + + + + Specify the starting address for non-contiguous allocation. + + + + + Specify the physical memory size for non-contiguous allocation in megabytes. +The size is a subset of the VM's total memory size specified on the Basic tab. + + + + + - - - Specify the physical memory size allocated to this VM in megabytes. + + + Specify the physical memory size allocated to this VM in megabytes. - - - The starting physical address in host for the VM. - - - - - The memory size in bytes for the VM. Default value is ``0x200000000``. - - - - - Start of second HPA for non-contiguous allocations in host for the VM. - - - - - Memory size of second HPA for non-contiguous allocations in Bytes for the VM. + + + Specify Physical memory information for Prelaunched VM diff --git a/misc/config_tools/schema/config.xsd b/misc/config_tools/schema/config.xsd index 642dc516e..3d4884e46 100644 --- a/misc/config_tools/schema/config.xsd +++ b/misc/config_tools/schema/config.xsd @@ -358,9 +358,9 @@ Refer SDM 17.19.2 for details, and use with caution. Specify the Intel Software Guard Extensions (SGX) enclave page cache (EPC) section settings. - - - Specify memory information for Service and User VMs. + + + Specify memory information for User VMs. diff --git a/misc/config_tools/xforms/vm_configurations.c.xsl b/misc/config_tools/xforms/vm_configurations.c.xsl index 6ba2360cb..7a4dcb5d8 100644 --- a/misc/config_tools/xforms/vm_configurations.c.xsl +++ b/misc/config_tools/xforms/vm_configurations.c.xsl @@ -28,6 +28,7 @@ + @@ -39,7 +40,6 @@ - @@ -49,6 +49,17 @@ + + + + + + + + + + }; + @@ -99,7 +110,9 @@ - + + + @@ -185,18 +198,10 @@ + - - - - - - - - - - - + + }, diff --git a/misc/config_tools/xforms/vm_configurations.h.xsl b/misc/config_tools/xforms/vm_configurations.h.xsl index 5db755349..b596ef692 100644 --- a/misc/config_tools/xforms/vm_configurations.h.xsl +++ b/misc/config_tools/xforms/vm_configurations.h.xsl @@ -31,7 +31,6 @@ - @@ -52,15 +51,4 @@ - - - - - - - - - - -