aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAyan Kumar Halder2022-01-20 11:11:42 +0000
committerStefano Stabellini2022-01-20 10:36:12 -0800
commit3780f67696f4b95efda0a2c3d8405ba85128632c (patch)
tree4c122fd2cfc8914ba60bcb003bb5657bb26e66fe
parent8f01717f27341e554fa39ed6f026a0d333fb4790 (diff)
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 <ayankuma@xilinx.com> Reviewed-by: Stefano Stabellini <sstabellini@kernel.org> Signed-off-by: Stefano Stabellini <stefano.stabellini@xilinx.com>
-rw-r--r--README.md8
-rw-r--r--config2
-rwxr-xr-xscripts/uboot-script-gen18
3 files changed, 27 insertions, 1 deletions
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" ]