From patchwork Sat Apr 16 00:17:00 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefano Stabellini X-Patchwork-Id: 12815528 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 49CA2C433F5 for ; Sat, 16 Apr 2022 00:17:18 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.305999.521179 (Exim 4.92) (envelope-from ) id 1nfW7g-0005ap-2d; Sat, 16 Apr 2022 00:17:08 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 305999.521179; Sat, 16 Apr 2022 00:17:08 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1nfW7f-0005ah-Uy; Sat, 16 Apr 2022 00:17:07 +0000 Received: by outflank-mailman (input) for mailman id 305999; Sat, 16 Apr 2022 00:17:06 +0000 Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254] helo=se1-gles-sth1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1nfW7e-0005ZY-JX for xen-devel@lists.xenproject.org; Sat, 16 Apr 2022 00:17:06 +0000 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id 8bc253b9-bd1a-11ec-a405-831a346695d4; Sat, 16 Apr 2022 02:17:05 +0200 (CEST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id CF7DCB82E4A; Sat, 16 Apr 2022 00:17:04 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 31FAAC385A5; Sat, 16 Apr 2022 00:17:03 +0000 (UTC) X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 8bc253b9-bd1a-11ec-a405-831a346695d4 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1650068223; bh=6fcuGmN0VOLiEsFwZuvE42PfLHtwz8AS00f3BuXsHLc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=pmApBdSJcHbWbnfh+wsXmuRYSnhYIeiPQPRc4utM1Ay1wZAcwlg9eARU4nGFie76I PsvlRrYXaf4UdX0165uOp7ChN1y2AwXvQpPFnJwUiDXxu5C6dQf81pDwXHKfvAGA4z T6BIWl9KhXAJyfQ8hRWTCh9gVxCIlbCX97jbX/IwuR6uQJdn4iaxUYWfsVgB5+u864 g6G3UOO4ec7D0Iqt8BMPw8/DxIoZROyDWTdd4CJrInXjC+69/ilbCUcjV58zvS3v5y wQxHd8egnwz8ohRMB9SdkYv4k3IKUD6ZEpUCLWwEc0pVFu7REztgesJJxPbhrUL+n5 7XbL0a/A47Uug== From: Stefano Stabellini To: xen-devel@lists.xenproject.org Cc: sstabellini@kernel.org, cardoe@cardoe.com, wl@xen.org, andrew.cooper3@citrix.com, anthony.perard@citrix.com, bertrand.marquis@arm.com, michal.orzel@arm.com, Stefano Stabellini Subject: [PATCH v5 1/2] gitlab-ci: add qemu-system-arm to the existing tests-artifacts container Date: Fri, 15 Apr 2022 17:17:00 -0700 Message-Id: <20220416001701.1301324-1-sstabellini@kernel.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: References: MIME-Version: 1.0 From: Stefano Stabellini Add qemu-system-arm to the existing test-artifacts qemu container (which doesn't get build for every iteration but only updated once in a while.) With qemu-system-arm available, we'll be able to run ARM32 tests. This patch also bumps the QEMU version to v6.0.0 for both arm32 and arm64 (the test-artifacts container is one, shared for both). Signed-off-by: Stefano Stabellini Reviewed-by: Anthony PERARD --- automation/gitlab-ci/build.yaml | 14 ++++++++++++-- automation/gitlab-ci/test.yaml | 4 ++-- ...arm64v8.dockerfile => 6.0.0-arm64v8.dockerfile} | 5 +++-- 3 files changed, 17 insertions(+), 6 deletions(-) rename automation/tests-artifacts/qemu-system-aarch64/{5.2.0-arm64v8.dockerfile => 6.0.0-arm64v8.dockerfile} (95%) diff --git a/automation/gitlab-ci/build.yaml b/automation/gitlab-ci/build.yaml index cc36428cf5..72f2a317ac 100644 --- a/automation/gitlab-ci/build.yaml +++ b/automation/gitlab-ci/build.yaml @@ -591,9 +591,9 @@ kernel-5.9.9-arm64-export: tags: - arm64 -qemu-system-aarch64-5.2.0-arm64-export: +qemu-system-aarch64-6.0.0-arm64-export: stage: build - image: registry.gitlab.com/xen-project/xen/tests-artifacts/qemu-system-aarch64:5.2.0-arm64v8 + image: registry.gitlab.com/xen-project/xen/tests-artifacts/qemu-system-aarch64:6.0.0-arm64v8 script: - mkdir binaries && cp /qemu-system-aarch64 binaries/qemu-system-aarch64 artifacts: @@ -602,6 +602,16 @@ qemu-system-aarch64-5.2.0-arm64-export: tags: - arm64 +qemu-system-aarch64-6.0.0-arm32-export: + stage: build + image: registry.gitlab.com/xen-project/xen/tests-artifacts/qemu-system-aarch64:6.0.0-arm64v8 + script: + - mkdir binaries && cp /qemu-system-arm binaries/qemu-system-arm + artifacts: + paths: + - binaries/qemu-system-arm + tags: + - arm64 # x86_64 test artifacts diff --git a/automation/gitlab-ci/test.yaml b/automation/gitlab-ci/test.yaml index 47e8704df3..ec2a2e1607 100644 --- a/automation/gitlab-ci/test.yaml +++ b/automation/gitlab-ci/test.yaml @@ -33,7 +33,7 @@ qemu-alpine-arm64-gcc: - alpine-3.12-gcc-arm64 - alpine-3.12-arm64-rootfs-export - kernel-5.9.9-arm64-export - - qemu-system-aarch64-5.2.0-arm64-export + - qemu-system-aarch64-6.0.0-arm64-export artifacts: paths: - smoke.serial @@ -81,7 +81,7 @@ qemu-smoke-arm64-gcc: dependencies: - debian-unstable-gcc-arm64 - kernel-5.9.9-arm64-export - - qemu-system-aarch64-5.2.0-arm64-export + - qemu-system-aarch64-6.0.0-arm64-export artifacts: paths: - smoke.serial diff --git a/automation/tests-artifacts/qemu-system-aarch64/5.2.0-arm64v8.dockerfile b/automation/tests-artifacts/qemu-system-aarch64/6.0.0-arm64v8.dockerfile similarity index 95% rename from automation/tests-artifacts/qemu-system-aarch64/5.2.0-arm64v8.dockerfile rename to automation/tests-artifacts/qemu-system-aarch64/6.0.0-arm64v8.dockerfile index e105a1c636..793432d40b 100644 --- a/automation/tests-artifacts/qemu-system-aarch64/5.2.0-arm64v8.dockerfile +++ b/automation/tests-artifacts/qemu-system-aarch64/6.0.0-arm64v8.dockerfile @@ -3,7 +3,7 @@ LABEL maintainer.name="The Xen Project" \ maintainer.email="xen-devel@lists.xenproject.org" ENV DEBIAN_FRONTEND=noninteractive -ENV QEMU_VERSION=5.2.0 +ENV QEMU_VERSION=6.0.0 ENV USER root RUN mkdir /build @@ -25,7 +25,7 @@ RUN apt-get update && \ tar xvJf qemu-"$QEMU_VERSION".tar.xz && \ cd qemu-"$QEMU_VERSION" && \ ./configure \ - --target-list=aarch64-softmmu \ + --target-list=arm-softmmu,aarch64-softmmu \ --enable-system \ --disable-blobs \ --disable-bsd-user \ @@ -68,6 +68,7 @@ RUN apt-get update && \ && \ make -j$(nproc) && \ cp ./build/qemu-system-aarch64 / && \ + cp ./build/qemu-system-arm / && \ cd /build && \ rm -rf qemu-"$QEMU_VERSION"* && \ apt-get autoremove -y && \ From patchwork Sat Apr 16 00:17:01 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefano Stabellini X-Patchwork-Id: 12815529 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id ADED3C433FE for ; Sat, 16 Apr 2022 00:17:19 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.306000.521190 (Exim 4.92) (envelope-from ) id 1nfW7h-0005rj-AW; Sat, 16 Apr 2022 00:17:09 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 306000.521190; Sat, 16 Apr 2022 00:17:09 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1nfW7h-0005ra-6i; Sat, 16 Apr 2022 00:17:09 +0000 Received: by outflank-mailman (input) for mailman id 306000; Sat, 16 Apr 2022 00:17:07 +0000 Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254] helo=se1-gles-sth1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1nfW7f-0005ZY-Cb for xen-devel@lists.xenproject.org; Sat, 16 Apr 2022 00:17:07 +0000 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id 8b9d9499-bd1a-11ec-a405-831a346695d4; Sat, 16 Apr 2022 02:17:05 +0200 (CEST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id BB975622B5; Sat, 16 Apr 2022 00:17:04 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id C7EF4C385AA; Sat, 16 Apr 2022 00:17:03 +0000 (UTC) X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 8b9d9499-bd1a-11ec-a405-831a346695d4 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1650068224; bh=5Np3QJHz98DXqqQOyVt/bJUStMP1ux42too3httshOM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=GGk7FQPBX78Jy0zC06YkRYQgkHl9X/VVXm+j0zZ2rZe+BV+MmKI/biyTEhjWXfpOS Xndf4vO3MYl2m/j7zpMziN+kqMMAkiBTrTNef7CekW46i27Pl1sNIKyftQstAkHk81 e0aMUkbydtno06j0vP0kn9L6ETZDkn4JyHP5chGPegLutjvVXPskHYmmoM/XSjuBbG s7Kj1zo62eeNFxA4EwXEs722OxlHSkzSZ5E5yGhTyYxdmps3KlNKSE7H7HnaLyNP3l QaIYXH9DjB+J2f6tSMEo+mxgBeR9rfh0jIBbxwgj+wzMeqQymOP0z4EcQCBpKWeTfc 4EceshJB3s+2w== From: Stefano Stabellini To: xen-devel@lists.xenproject.org Cc: sstabellini@kernel.org, cardoe@cardoe.com, wl@xen.org, andrew.cooper3@citrix.com, anthony.perard@citrix.com, bertrand.marquis@arm.com, michal.orzel@arm.com, Stefano Stabellini Subject: [PATCH v5 2/2] gitlab-ci: add an ARM32 qemu-based smoke test Date: Fri, 15 Apr 2022 17:17:01 -0700 Message-Id: <20220416001701.1301324-2-sstabellini@kernel.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: References: MIME-Version: 1.0 Add a minimal ARM32 smoke test based on qemu-system-arm, as provided by the test-artifacts qemu container. The minimal test simply boots Xen (built from previous build stages) and Dom0. The test needs a working kernel and minimal initrd for dom0. Instead of building our own kernel and initrd, which would mean maintaining one or two more builting scripts under automation/, we borrow a kernel and initrd from distros. For the kernel we pick the Debian Bullseye kernel, which has everything we need already built-in. However, we cannot use the Debian Bullseye initrd because it is 22MB and the large size causes QEMU to core dump. Instead, use the tiny busybox-based rootfs provided by Alpine Linux, which is really minimal: just 2.5MB. Note that we cannot use the Alpine Linux kernel because that doesn't boot on Xen. Signed-off-by: Stefano Stabellini Signed-off-by: Stefano Stabellini Reviewed-by: Michal Orzel --- Changes in v5: - use "virt" machine in QEMU - remove init= option Changes in v4: - improve commit message - use Debian Bullseye kernel - use Alpine Linux initrd --- automation/gitlab-ci/test.yaml | 23 ++++++++ automation/scripts/qemu-smoke-arm32.sh | 81 ++++++++++++++++++++++++++ 2 files changed, 104 insertions(+) create mode 100755 automation/scripts/qemu-smoke-arm32.sh diff --git a/automation/gitlab-ci/test.yaml b/automation/gitlab-ci/test.yaml index ec2a2e1607..42cd725a12 100644 --- a/automation/gitlab-ci/test.yaml +++ b/automation/gitlab-ci/test.yaml @@ -95,6 +95,29 @@ qemu-smoke-arm64-gcc: - /^coverity-tested\/.*/ - /^stable-.*/ +qemu-smoke-arm32-gcc: + stage: test + image: registry.gitlab.com/xen-project/xen/${CONTAINER} + variables: + CONTAINER: debian:unstable-arm64v8 + script: + - ./automation/scripts/qemu-smoke-arm32.sh 2>&1 | tee qemu-smoke-arm32.log + dependencies: + - debian-unstable-gcc-arm32 + - qemu-system-aarch64-6.0.0-arm32-export + artifacts: + paths: + - smoke.serial + - '*.log' + when: always + tags: + - arm64 + except: + - master + - smoke + - /^coverity-tested\/.*/ + - /^stable-.*/ + qemu-smoke-x86-64-gcc: stage: test image: registry.gitlab.com/xen-project/xen/${CONTAINER} diff --git a/automation/scripts/qemu-smoke-arm32.sh b/automation/scripts/qemu-smoke-arm32.sh new file mode 100755 index 0000000000..15e6f46ce9 --- /dev/null +++ b/automation/scripts/qemu-smoke-arm32.sh @@ -0,0 +1,81 @@ +#!/bin/bash + +set -ex + +export DEBIAN_FRONTENT=noninteractive +apt-get -qy update +apt-get -qy install --no-install-recommends device-tree-compiler \ + curl \ + cpio + +cd binaries +# Use the kernel from Debian +curl --fail --silent --show-error --location --output vmlinuz http://http.us.debian.org/debian/dists/bullseye/main/installer-armhf/current/images/netboot/vmlinuz +# Use a tiny initrd based on busybox from Alpine Linux +curl --fail --silent --show-error --location --output initrd.tar.gz https://dl-cdn.alpinelinux.org/alpine/v3.15/releases/armhf/alpine-minirootfs-3.15.1-armhf.tar.gz + +mkdir rootfs +cd rootfs +tar xvzf ../initrd.tar.gz +find . | cpio -H newc -o | gzip > ../initrd.gz +cd .. + +kernel=`stat -L --printf="%s" vmlinuz` +initrd=`stat -L --printf="%s" initrd.gz` + +# For Xen, we need a couple of more node. Dump the DT from QEMU and add them +# 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 +./qemu-system-arm \ + -machine virt \ + -machine virtualization=true \ + -smp 4 \ + -m 1024 \ + -serial stdio \ + -monitor none \ + -display none \ + -machine dumpdtb=virt.dtb + +dtc -I dtb -O dts virt.dtb > virt.dts + +cat >> virt.dts << EOF +/ { + chosen { + #address-cells = <0x2>; + #size-cells = <0x2>; + stdout-path = "/pl011@9000000"; + xen,xen-bootargs = "console=dtuart dtuart=/pl011@9000000 dom0_mem=512M bootscrub=0"; + xen,dom0-bootargs = "console=tty0 console=hvc0 earlyprintk clk_ignore_unused root=/dev/ram0 rdinit=/bin/sh"; + dom0 { + compatible = "xen,linux-zimage", "xen,multiboot-module"; + reg = <0x0 0x1000000 0x0 $kernel>; + }; + dom0-ramdisk { + compatible = "xen,linux-initrd", "xen,multiboot-module"; + reg = <0x0 0x3200000 0x0 $initrd>; + }; + }; +}; +EOF +dtc -I dts -O dtb virt.dts > virt.dtb + +rm -f smoke.serial +set +e +timeout -k 1 240 \ +./qemu-system-arm \ + -machine virt-6.0 \ + -machine virtualization=true \ + -smp 4 \ + -m 1024 \ + -serial stdio \ + -monitor none \ + -display none \ + -dtb virt.dtb \ + -no-reboot \ + -kernel ./xen \ + -device loader,file=./vmlinuz,addr=0x1000000 \ + -device loader,file=./initrd.gz,addr=0x3200000 |& tee smoke.serial + +set -e +(grep -q "^/ #" smoke.serial) || exit 1 +exit 0