From 3780f67696f4b95efda0a2c3d8405ba85128632c Mon Sep 17 00:00:00 2001 From: Ayan Kumar Halder Date: Thu, 20 Jan 2022 11:11:42 +0000 Subject: Specify the memory and virtual cpu count for DOM0 Introduced the new config options :- DOM0_MEM - To specify the amount of memory (in MB) that is assigned to Dom0. DOM0_VCPUS - To specify the count of virtual CPUs for Dom0. These options are used to set XEN_CMD. Signed-off-by: Ayan Kumar Halder Reviewed-by: Stefano Stabellini Signed-off-by: Stefano Stabellini --- README.md | 8 ++++++++ config | 2 ++ scripts/uboot-script-gen | 18 +++++++++++++++++- 3 files changed, 27 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 4b37db7..1be989b 100644 --- a/README.md +++ b/README.md @@ -38,6 +38,8 @@ PASSTHROUGH_DTS_REPO="git@github.com:Xilinx/xen-passthrough-device-trees.git dev DOM0_KERNEL="Image-dom0" DOM0_CMD="console=hvc0 earlycon=xen earlyprintk=xen clk_ignore_unused" DOM0_RAMDISK="dom0-ramdisk.cpio" +DOM0_MEM=1024 +DOM0_VCPUS=1 NUM_DT_OVERLAY=1 DT_OVERLAY[0]="host_dt_overlay.dtbo" @@ -95,6 +97,12 @@ Where: - DOM0_KERNEL specifies the Dom0 kernel file to load. +- DOM0_MEM specifies the amount of memory for Dom0 VM in MB. The default + is 1024. This is only applicable when XEN_CMD is not specified. + +- DOM0_VCPUS specifies the number of VCPUs for Dom0. The default is 1. This is + only applicable when XEN_CMD is not specified. + - DOM0_CMD specifies the command line arguments for Dom0's Linux kernel. If "root=" isn't set, imagebuilder will try to determine it. If not set at all, the default one is used. diff --git a/config b/config index 274e636..d5a2ab7 100644 --- a/config +++ b/config @@ -4,6 +4,8 @@ MEMORY_END="0x80000000" DEVICE_TREE="mpsoc.dtb" XEN="xen" DOM0_KERNEL="Image-dom0" +DOM0_MEM=1024 +DOM0_VCPUS=1 DOM0_RAMDISK="dom0-ramdisk.cpio" NUM_DOMUS=2 diff --git a/scripts/uboot-script-gen b/scripts/uboot-script-gen index 71669a9..84faf6c 100755 --- a/scripts/uboot-script-gen +++ b/scripts/uboot-script-gen @@ -313,7 +313,23 @@ function xen_config() { if [ -z "$XEN_CMD" ] then - XEN_CMD="console=dtuart dtuart=serial0 dom0_mem=1G dom0_max_vcpus=1 bootscrub=0 vwfi=native sched=null" + if [ -z "$DOM0_MEM" ] + then + DOM0_MEM="1024" + fi + + if [ -z "$DOM0_VCPUS" ] + then + DOM0_VCPUS="1" + fi + + XEN_CMD="console=dtuart dtuart=serial0 dom0_mem=${DOM0_MEM}M dom0_max_vcpus=${DOM0_VCPUS} bootscrub=0 vwfi=native sched=null" + else + if [ "$DOM0_MEM" ] || [ "$DOM0_VCPUS" ] + then + echo "One can specify either XEN_CMD or (DOM0_MEM and/or DOM0_VCPUS)" + exit + fi fi if [ -z "$DOM0_CMD" ] -- cgit v1.2.3