meta-virtualization/classes/qemuboot-xen-defaults.bbclass
Christopher Clark 19347a7c4e qemuboot, xen-image-minimal: enable runqemu for qemuarm64 Xen images
The Xen hypervisor built for Arm 64-bit targets can be launched with
runqemu by providing a Device Tree binary and configuration for Qemu,
which enables interactive testing of Xen images.

Add qemuboot-xen-dtb.bbclass to add a new bitbake task for generating
the dtb file by using lopper on a device tree produced by Qemu.

Add qemuboot-xen-defaults.bbclass to supply working default parameters
for the qemuarm64 machine and general support for qemuboot for Xen,
and adjust the defaults as needed to boot successfully in testing.

Development aided by this script by Stewart Hildebrand of DornerWorks:
https://gist.github.com/stewdk/110f43e0cc1d905fc6ed4c7e10d8d35e

Signed-off-by: Christopher Clark <christopher.clark@starlab.io>
Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com>
2021-07-29 10:55:56 -04:00

31 lines
1.2 KiB
Plaintext

# Set defaults for booting Xen images with qemuboot
# Xen and Dom0 command line options
QB_XEN_CMDLINE_EXTRA ??= "dom0_mem=192M"
QB_XEN_DOM0_BOOTARGS ??= \
"console=hvc0 earlyprintk clk_ignore_unused root=/dev/vda"
# Launch with one initial domain, dom0, with one boot module, the kernel
DOM0_KERNEL ??= "${DEPLOY_DIR_IMAGE}/${KERNEL_IMAGETYPE}"
DOM0_KERNEL_LOAD_ADDR ??= "0x45000000"
QB_XEN_DOMAIN_MODULES ??= "${DOM0_KERNEL}:${DOM0_KERNEL_LOAD_ADDR}:multiboot,kernel"
# Qemuboot for 64-bit Arm uses the QB_DEFAULT_KERNEL method to load Xen
# and the device loader option for the dom0 kernel:
QB_OPT_APPEND_append_aarch64 = " \
-device loader,file=${DOM0_KERNEL},addr=${DOM0_KERNEL_LOAD_ADDR} \
"
QB_DEFAULT_KERNEL_aarch64 = "xen-${MACHINE}"
# 64-bit Arm: gic version 3
QB_MACHINE_aarch64 = "-machine virt,gic-version=3 -machine virtualization=true"
# Increase the default qemu memory allocation to allow for the hypervisor.
# Use a weak assignment to allow for change of default and override elsewhere.
QB_MEM_VALUE ??= "512"
QB_MEM = "-m ${QB_MEM_VALUE}"
# 64-bit Arm: qemuboot with a device tree binary
QB_DTB_aarch64 = "${IMAGE_NAME}.qemuboot.dtb"
QB_DTB_LINK_aarch64 = "${IMAGE_LINK_NAME}.qemuboot.dtb"