config_tools: update IVSHMEM_SHM_SIZE part for HV_RAM_SIZE calculation

add 2 * max (IVSHMEM_SHM_SIZE, 2M) in HV_RAM_SIZE calculation to
avoid ram overflow caused by additional memory usage for shared
memory alignment.

Tracked-On: #5955

Signed-off-by: Shuang Zheng <shuang.zheng@intel.com>
Reviewed-by: Victor Sun <victor.sun@intel.com>
This commit is contained in:
Shuang Zheng 2021-04-22 16:38:32 +00:00 committed by wenlingz
parent dc88c2e397
commit b96d23a68f
2 changed files with 2 additions and 2 deletions

View File

@ -81,7 +81,7 @@ def get_memory(hv_info, config):
except Exception as e: except Exception as e:
print(e) print(e)
hv_ram_size += total_shm_size hv_ram_size += 2 * max(total_shm_size, 0x200000)
if hv_ram_size > HV_RAM_SIZE_MAX: if hv_ram_size > HV_RAM_SIZE_MAX:
common.print_red("requested RAM size should be smaller then {}".format(HV_RAM_SIZE_MAX), err=True) common.print_red("requested RAM size should be smaller then {}".format(HV_RAM_SIZE_MAX), err=True)
err_dic["board config: total vm number error"] = \ err_dic["board config: total vm number error"] = \

View File

@ -40,7 +40,7 @@ def fn(board_etree, scenario_etree, allocation_etree):
total_shm_size += int_size total_shm_size += int_size
except Exception as e: except Exception as e:
print(e) print(e)
hv_ram_size += total_shm_size hv_ram_size += 2 * max(total_shm_size, 0x200000)
assert(hv_ram_size <= HV_RAM_SIZE_MAX) assert(hv_ram_size <= HV_RAM_SIZE_MAX)
# reseve 16M memory for hv sbuf, ramoops, etc. # reseve 16M memory for hv sbuf, ramoops, etc.