From 79acefaa73b79f5830096f702d5c7726e4afd05a Mon Sep 17 00:00:00 2001 From: Chenli Wei Date: Thu, 25 Aug 2022 07:15:27 +0800 Subject: [PATCH] misc: add assert to check the total memory size of User VMs The current code does not detect the memory applied by all VMs, if it exceeds the native memory, there will be an allocate failed and these VMs can't run. Tracked-On: #6690 Signed-off-by: Chenli Wei Reviewed-by: Junjie Mao junjie.mao@intel.com --- misc/config_tools/schema/checks/vm_memory.xsd | 14 ++++++++++++++ misc/config_tools/schema/datachecks.xsd | 1 + 2 files changed, 15 insertions(+) create mode 100644 misc/config_tools/schema/checks/vm_memory.xsd diff --git a/misc/config_tools/schema/checks/vm_memory.xsd b/misc/config_tools/schema/checks/vm_memory.xsd new file mode 100644 index 000000000..1e5827035 --- /dev/null +++ b/misc/config_tools/schema/checks/vm_memory.xsd @@ -0,0 +1,14 @@ + + + + + + + + The total memory size applied by all VMs large then the host memory ({(sum(/acrn-config//vm[load_order != 'SERVICE_VM']//memory/size) + sum(/acrn-config//vm[load_order != 'SERVICE_VM']//size_hpa)) * 1024 * 1024} > {sum(//memory/range[not(@id)]/@size)}). + + + + diff --git a/misc/config_tools/schema/datachecks.xsd b/misc/config_tools/schema/datachecks.xsd index a38944a0a..fa1697203 100644 --- a/misc/config_tools/schema/datachecks.xsd +++ b/misc/config_tools/schema/datachecks.xsd @@ -19,6 +19,7 @@ +