Introduce qemu based Arm earlyprintk test and build jobs to cover this
feature in debug variant. The tests simply check for the presence of the
last message printed by the bootstrap code before entering the C world.

Signed-off-by: Michal Orzel <michal.or...@amd.com>
---
 automation/gitlab-ci/build.yaml                 | 17 +++++++++++++++++
 automation/gitlab-ci/test.yaml                  | 16 ++++++++++++++++
 automation/scripts/qemu-smoke-dom0less-arm32.sh |  7 +++++++
 automation/scripts/qemu-smoke-dom0less-arm64.sh |  5 +++++
 4 files changed, 45 insertions(+)

diff --git a/automation/gitlab-ci/build.yaml b/automation/gitlab-ci/build.yaml
index f3c934471f32..49d6265ad5b4 100644
--- a/automation/gitlab-ci/build.yaml
+++ b/automation/gitlab-ci/build.yaml
@@ -402,6 +402,15 @@ debian-bookworm-gcc-arm32-debug-staticmem:
       CONFIG_UNSUPPORTED=y
       CONFIG_STATIC_MEMORY=y
 
+debian-bookworm-gcc-arm32-debug-earlyprintk:
+  extends: .gcc-arm32-cross-build-debug
+  variables:
+    CONTAINER: debian:bookworm-arm64v8-arm32-gcc
+    HYPERVISOR_ONLY: y
+    EXTRA_XEN_CONFIG: |
+      CONFIG_EARLY_UART_CHOICE_PL011=y
+      CONFIG_EARLY_UART_BASE_ADDRESS=0x9000000
+
 # Arm builds
 
 debian-bookworm-gcc-arm64:
@@ -473,6 +482,14 @@ alpine-3.18-gcc-debug-arm64-boot-cpupools:
     EXTRA_XEN_CONFIG: |
       CONFIG_BOOT_TIME_CPUPOOLS=y
 
+alpine-3.18-gcc-debug-arm64-earlyprintk:
+  extends: .gcc-arm64-build-debug
+  variables:
+    CONTAINER: alpine:3.18-arm64v8
+    EXTRA_XEN_CONFIG: |
+      CONFIG_EARLY_UART_CHOICE_PL011=y
+      CONFIG_EARLY_UART_BASE_ADDRESS=0x9000000
+
 # RISC-V 64 cross-build
 .riscv-fixed-randconfig:
   variables: &riscv-fixed-randconfig
diff --git a/automation/gitlab-ci/test.yaml b/automation/gitlab-ci/test.yaml
index 55a7831ad292..1e5d86763f6c 100644
--- a/automation/gitlab-ci/test.yaml
+++ b/automation/gitlab-ci/test.yaml
@@ -287,6 +287,14 @@ qemu-smoke-dom0less-arm64-gcc-debug-boot-cpupools:
     - *arm64-test-needs
     - alpine-3.18-gcc-debug-arm64-boot-cpupools
 
+qemu-smoke-dom0less-arm64-gcc-debug-earlyprintk:
+  extends: .qemu-arm64
+  script:
+    - ./automation/scripts/qemu-smoke-dom0less-arm64.sh earlyprintk 2>&1 | tee 
${LOGFILE}
+  needs:
+    - *arm64-test-needs
+    - alpine-3.18-gcc-debug-arm64-earlyprintk
+
 qemu-xtf-dom0less-arm64-gcc-hyp-xen-version:
   extends: .qemu-arm64
   script:
@@ -359,6 +367,14 @@ qemu-smoke-dom0less-arm32-gcc-debug-without-dom0:
     - *arm32-test-needs
     - debian-bookworm-gcc-arm32-debug
 
+qemu-smoke-dom0less-arm32-gcc-debug-earlyprintk:
+  extends: .qemu-arm32
+  script:
+    - ./automation/scripts/qemu-smoke-dom0less-arm32.sh earlyprintk 2>&1 | tee 
${LOGFILE}
+  needs:
+    - *arm32-test-needs
+    - debian-bookworm-gcc-arm32-debug-earlyprintk
+
 qemu-alpine-x86_64-gcc:
   extends: .qemu-x86-64
   script:
diff --git a/automation/scripts/qemu-smoke-dom0less-arm32.sh 
b/automation/scripts/qemu-smoke-dom0less-arm32.sh
index e31b6b9014e1..1e2b939aadf7 100755
--- a/automation/scripts/qemu-smoke-dom0less-arm32.sh
+++ b/automation/scripts/qemu-smoke-dom0less-arm32.sh
@@ -53,6 +53,13 @@ echo \"${passed}\"
 "
 fi
 
+if [[ "${test_variant}" == "earlyprintk" ]]; then
+    # Clear dom0 prompt
+    dom0_prompt=""
+    # Last early printk message before entering C world
+    passed="\- Ready \-"
+fi
+
 # dom0/domU rootfs
 # We are using the same rootfs for dom0 and domU. The only difference is
 # that for the former, we set explictly rdinit to /bin/sh, whereas for the
diff --git a/automation/scripts/qemu-smoke-dom0less-arm64.sh 
b/automation/scripts/qemu-smoke-dom0less-arm64.sh
index e748b8ef1699..fc943a1a622c 100755
--- a/automation/scripts/qemu-smoke-dom0less-arm64.sh
+++ b/automation/scripts/qemu-smoke-dom0less-arm64.sh
@@ -61,6 +61,11 @@ fi
 "
 fi
 
+if [[ "${test_variant}" == "earlyprintk" ]]; then
+    # Last early printk message before entering C world
+    passed="\- Ready \-"
+fi
+
 # XXX QEMU looks for "efi-virtio.rom" even if it is unneeded
 curl -fsSLO https://github.com/qemu/qemu/raw/v5.2.0/pc-bios/efi-virtio.rom
 ./binaries/qemu-system-aarch64 \
-- 
2.25.1


Reply via email to