diff options
author | Christopher Clark <christopher.w.clark@gmail.com> | 2022-04-27 17:06:08 -0700 |
---|---|---|
committer | Bruce Ashfield <bruce.ashfield@gmail.com> | 2022-05-09 08:08:25 -0400 |
commit | 1c746a976830ebaf85c7c8c25612bea349b0a7c5 (patch) | |
tree | 1741629264022f4827da8db1a076a9c0dd927e4d /classes/qemuboot-xen-defaults.bbclass | |
parent | da1e54ca79f49c9c311fe5f74e192e743c4ece20 (diff) | |
download | meta-virtualization-1c746a976830ebaf85c7c8c25612bea349b0a7c5.tar.gz |
qemuboot, xen-image-minimal: enable runqemu for qemuarm Xen images
The Xen hypervisor built for Arm 32-bit targets can be launched with
runqemu by providing a u-boot script and configuration for Qemu, which
enables interactive testing of Xen images.
Add qemuboot-xen-u-boot.bbclass to add a new bitbake task for generating
the u-boot script. Since this increases the number of qemuboot-specific
classes that are inherited by the xen-image-minimal recipe, change the
inherit of all of these to only apply to qemu machines with the qemuall
override.
Update qemuboot-xen-defaults.bbclass to supply working default
parameters for the qemuarm machine needed to boot successfully in
testing. Also change all the arch-specific variable overrides into
narrower qemu platform overrides instead to avoid unnecessary
interactions with other Arm platform machines.
Signed-off-by: Christopher Clark <christopher.clark@starlab.io>
Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com>
Diffstat (limited to 'classes/qemuboot-xen-defaults.bbclass')
-rw-r--r-- | classes/qemuboot-xen-defaults.bbclass | 26 |
1 files changed, 21 insertions, 5 deletions
diff --git a/classes/qemuboot-xen-defaults.bbclass b/classes/qemuboot-xen-defaults.bbclass index c7e74c3e..62bbf8fd 100644 --- a/classes/qemuboot-xen-defaults.bbclass +++ b/classes/qemuboot-xen-defaults.bbclass | |||
@@ -10,21 +10,37 @@ DOM0_KERNEL ??= "${DEPLOY_DIR_IMAGE}/${KERNEL_IMAGETYPE}" | |||
10 | DOM0_KERNEL_LOAD_ADDR ??= "0x45000000" | 10 | DOM0_KERNEL_LOAD_ADDR ??= "0x45000000" |
11 | QB_XEN_DOMAIN_MODULES ??= "${DOM0_KERNEL}:${DOM0_KERNEL_LOAD_ADDR}:multiboot,kernel" | 11 | QB_XEN_DOMAIN_MODULES ??= "${DOM0_KERNEL}:${DOM0_KERNEL_LOAD_ADDR}:multiboot,kernel" |
12 | 12 | ||
13 | # Qemuboot for 32-bit Arm loads Xen via device loader parameter rather than | ||
14 | # kernel and boots using u-boot as bios | ||
15 | XEN_BINARY ??= "${DEPLOY_DIR_IMAGE}/xen-${MACHINE}" | ||
16 | QB_XEN_LOAD_ADDR ??= "0x46000000" | ||
17 | QB_OPT_APPEND:append:qemuarm = " \ | ||
18 | -device loader,file=${XEN_BINARY},addr=${QB_XEN_LOAD_ADDR},force-raw=on \ | ||
19 | -device loader,file=${DOM0_KERNEL},addr=${DOM0_KERNEL_LOAD_ADDR} \ | ||
20 | -bios ${DEPLOY_DIR_IMAGE}/u-boot.bin \ | ||
21 | " | ||
22 | QB_DEFAULT_KERNEL:qemuarm = "none" | ||
23 | |||
13 | # Qemuboot for 64-bit Arm uses the QB_DEFAULT_KERNEL method to load Xen | 24 | # Qemuboot for 64-bit Arm uses the QB_DEFAULT_KERNEL method to load Xen |
14 | # and the device loader option for the dom0 kernel: | 25 | # and the device loader option for the dom0 kernel: |
15 | QB_OPT_APPEND:append:aarch64 = " \ | 26 | QB_OPT_APPEND:append:qemuarm64 = " \ |
16 | -device loader,file=${DOM0_KERNEL},addr=${DOM0_KERNEL_LOAD_ADDR} \ | 27 | -device loader,file=${DOM0_KERNEL},addr=${DOM0_KERNEL_LOAD_ADDR} \ |
17 | " | 28 | " |
18 | QB_DEFAULT_KERNEL:aarch64 = "xen-${MACHINE}" | 29 | QB_DEFAULT_KERNEL:qemuarm64 = "xen-${MACHINE}" |
19 | 30 | ||
31 | # 32-bit Arm: gic version 2 | ||
32 | QB_MACHINE:qemuarm = "-machine virt -machine virtualization=true" | ||
20 | # 64-bit Arm: gic version 3 | 33 | # 64-bit Arm: gic version 3 |
21 | QB_MACHINE:aarch64 = "-machine virt,gic-version=3 -machine virtualization=true" | 34 | QB_MACHINE:qemuarm64 = "-machine virt,gic-version=3 -machine virtualization=true" |
22 | 35 | ||
23 | # Increase the default qemu memory allocation to allow for the hypervisor. | 36 | # Increase the default qemu memory allocation to allow for the hypervisor. |
24 | # Use a weak assignment to allow for change of default and override elsewhere. | 37 | # Use a weak assignment to allow for change of default and override elsewhere. |
25 | QB_MEM_VALUE ??= "512" | 38 | QB_MEM_VALUE ??= "512" |
26 | QB_MEM = "-m ${QB_MEM_VALUE}" | 39 | QB_MEM = "-m ${QB_MEM_VALUE}" |
27 | 40 | ||
41 | # 32-bit Arm: qemuboot with a u-boot script image | ||
42 | QB_XEN_U_BOOT_SCR:qemuarm = "boot.scr.uimg" | ||
43 | |||
28 | # 64-bit Arm: qemuboot with a device tree binary | 44 | # 64-bit Arm: qemuboot with a device tree binary |
29 | QB_DTB:aarch64 = "${IMAGE_NAME}.qemuboot.dtb" | 45 | QB_DTB:qemuarm64 = "${IMAGE_NAME}.qemuboot.dtb" |
30 | QB_DTB_LINK:aarch64 = "${IMAGE_LINK_NAME}.qemuboot.dtb" | 46 | QB_DTB_LINK:qemuarm64 = "${IMAGE_LINK_NAME}.qemuboot.dtb" |