diff --git a/config/docker/qemu.jinja2 b/config/docker/qemu.jinja2 index 7263644269..336bfa09cb 100644 --- a/config/docker/qemu.jinja2 +++ b/config/docker/qemu.jinja2 @@ -20,6 +20,7 @@ RUN apt-get update && \ qemu-system-s390x \ qemu-system-sparc \ qemu-system-x86 \ + qemu-efi-aarch64 \ qemu-utils RUN mkdir -p /etc/qemu && echo allow all > /etc/qemu/bridge.conf diff --git a/config/runtime/README.md b/config/runtime/README.md index f268708d20..b776263952 100644 --- a/config/runtime/README.md +++ b/config/runtime/README.md @@ -37,3 +37,33 @@ The selected image must provide the platform's `qemu-system-` binary and be accessible to the LAVA worker. This parameter selects the boot action's container image; it is separate from the job's top-level `image` setting for its runtime environment. + +## ARM64 QEMU ACPI boot + +Set `qemu_arm64_acpi: true` in a LAVA job's `params` to boot an existing +ARM64 QEMU platform with UEFI and ACPI: + +```yaml +jobs: + baseline-arm64-qualcomm: + template: baseline.jinja2 + kind: job + kcidb_test_suite: boot + params: + rootfs_ref: buildroot-baseline + qemu_arm64_acpi: true +``` + +The flag applies only to platforms with `boot_method: qemu` and `arch: arm64`. +It appends `-bios /usr/share/qemu-efi-aarch64/QEMU_EFI.fd` to the generated +LAVA context's `extra_options` and adds `acpi=force` to QEMU's kernel command +line. It does not modify the shared platform configuration. Omitted or +false flags preserve the existing boot behavior. + +Deploy the updated core templates together with the pipeline configuration. +The QEMU container must contain the firmware at that path; rebuild the image +with the updated QEMU recipe, which installs `qemu-efi-aarch64`, or use a +compatible image via `qemu_docker_image`. The kernel must enable `CONFIG_ACPI`, +`CONFIG_EFI`, and `CONFIG_EFI_STUB`. The pipeline baseline test checks for a +readable `/sys/firmware/acpi/tables/DSDT` when this mode is active, so a boot +without usable ACPI tables does not pass that check. diff --git a/config/runtime/base/lava.jinja2 b/config/runtime/base/lava.jinja2 index e372b21249..63743b02c9 100644 --- a/config/runtime/base/lava.jinja2 +++ b/config/runtime/base/lava.jinja2 @@ -11,7 +11,6 @@ # * timeout # * modules # * kernel image name -# * UEFI binaries for QEMU etc. # * rootfs URL job_name: "[{{ instanceid|default('KernelCI AKS')}}] {{ node.id }} {{ node.name }} {{ node.data.kernel_revision.describe }}" @@ -22,10 +21,17 @@ visibility: public priority: {{ priority | default('10') }} -{% if platform_config.context or extra_kernel_args %} +{% set qemu_acpi_enabled = (qemu_arm64_acpi | default(false)) and + platform_config.boot_method == 'qemu' and platform_config.arch == 'arm64' %} +{% set lava_context = dict(platform_config.context or {}) %} +{% if qemu_acpi_enabled %} + {% set _ = lava_context.update(extra_options=(lava_context.get('extra_options') or []) + + ['-bios', '/usr/share/qemu-efi-aarch64/QEMU_EFI.fd']) %} +{% endif %} +{% if lava_context or extra_kernel_args %} context: - {% if platform_config.context %} - {% for key, value in platform_config.context.items() %} + {% if lava_context %} + {% for key, value in lava_context.items() %} {{ key }}: {{ value }} {% endfor %} {% endif %} diff --git a/config/runtime/boot/qemu.jinja2 b/config/runtime/boot/qemu.jinja2 index 8146658aff..9aec072eec 100644 --- a/config/runtime/boot/qemu.jinja2 +++ b/config/runtime/boot/qemu.jinja2 @@ -3,7 +3,7 @@ images: kernel: image_arg: -kernel {kernel} -append "console={{ console_dev }},115200 root=/dev/ram0 debug - verbose console_msg_format=syslog earlycon" + verbose console_msg_format=syslog earlycon{{ ' acpi=force' if qemu_acpi_enabled else '' }}" url: '{{ node.artifacts.kernel }}' ramdisk: image_arg: -initrd {ramdisk}