From cee5fbcee70b9496705282cc67789b8439677090 Mon Sep 17 00:00:00 2001 From: Daniel Rossier Date: Sat, 14 Nov 2026 15:15:04 +0100 Subject: [PATCH] bsp (virt64): expose EL2 on every AVZ machine of a chain without ATF Only the machine reading U-Boot off the card got virtualization=on under AVZ. The one handing U-Boot to QEMU with -kernel, kept for a position-independent U-Boot, was always a plain "virt,gic-version=2", so AVZ would fault on its first EL2 system-register access there. Both now take the machine from __virt64_machine(), as in so3. The deploy comment also says that __deploy_arm_common handles both boot shapes, which it does. --- .../recipes-bsp/bsp/files/bsp_virt64.inc | 25 ++++++++++++------- 1 file changed, 16 insertions(+), 9 deletions(-) diff --git a/build/meta-bsp/recipes-bsp/bsp/files/bsp_virt64.inc b/build/meta-bsp/recipes-bsp/bsp/files/bsp_virt64.inc index 12192d56c..e94a701c7 100644 --- a/build/meta-bsp/recipes-bsp/bsp/files/bsp_virt64.inc +++ b/build/meta-bsp/recipes-bsp/bsp/files/bsp_virt64.inc @@ -42,9 +42,21 @@ def __write_boot_conf(d, fs_dir, chain, machine, boot_opt): f.write("IB_QEMU_BOOT=\"%s\"\n" % boot_opt) +# The QEMU machine of a chain without ATF. AVZ is an EL2 hypervisor, so the +# machine has to expose EL2: without it AVZ faults on its first EL2 +# system-register access, which surfaces as a synchronous abort and a reset. +# +# hyp: IB_HYPERVISOR + +def __virt64_machine(hyp): + machine = "virt,gic-version=2" + if hyp == "avz": + machine += ",virtualization=on" + return machine + def __do_platform_deploy(d): - # Single-ITB bootm: the plain ${IB_PLATFORM}.itb (kernel + dtb + initrd) - # and uEnv.txt are copied onto p1 by __deploy_arm_common. + # Both shapes (two-ITB AVZ boot when the ITS ends in "_avz", single-ITB + # bootm otherwise) are handled generically by __deploy_arm_common. __deploy_arm_common(d) @@ -173,12 +185,7 @@ def __do_platform_boot_chain(d): if os.path.exists(flash_path): os.remove(flash_path) - machine = "virt,gic-version=2" - if hyp == "avz": - # AVZ is an EL2 hypervisor, so the machine has to expose EL2. - # Without it AVZ faults on its first EL2 system-register access, - # which surfaces as a synchronous abort and a reset. - machine += ",virtualization=on" + machine = __virt64_machine(hyp) machine += (",bootrom-drive=hd0,bootrom-offset=%d,bootrom-load=%s" % (offset, load)) @@ -194,7 +201,7 @@ def __do_platform_boot_chain(d): if os.path.exists(flash_path): os.remove(flash_path) - __write_boot_conf(d, fs_dir, chain, "virt,gic-version=2", + __write_boot_conf(d, fs_dir, chain, __virt64_machine(hyp), "-kernel u-boot/u-boot") return