All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/3] automation: build qemu-system-aarch64 and use it for tests
@ 2021-01-05 22:58 Stefano Stabellini
  2021-01-05 22:58 ` [PATCH 1/3] automation: add qemu-system-aarch64 to test-artifacts Stefano Stabellini
                   ` (3 more replies)
  0 siblings, 4 replies; 6+ messages in thread
From: Stefano Stabellini @ 2021-01-05 22:58 UTC (permalink / raw)
  To: andrew.cooper3, cardoe, wl; +Cc: sstabellini, xen-devel

Hi all,

Currently we are using Debian's qemu-system-aarch64 for our tests.
However, sometimes it crashes. See for instance
https://gitlab.com/xen-project/people/andyhhp/xen/-/jobs/939556527. It
is hard to debug and even harder to apply any fixes to it.

Instead, build our own QEMU as one of our test-artifacts, which are only
built once, then imported into each pipeline via phony jobs. Use the
provided qemu-system-aarch64 binary for our arm64 tests.


Stefano Stabellini (3):
      automation: add qemu-system-aarch64 to test-artifacts
      automation: add a job to import qemu-system-aarch64 into the pipeline
      automation: use test-artifacts/qemu-system-aarch64 instead of Debian's

 automation/gitlab-ci/build.yaml                    | 11 ++++
 automation/gitlab-ci/test.yaml                     |  2 +
 automation/scripts/qemu-alpine-arm64.sh            | 12 ++--
 automation/scripts/qemu-smoke-arm64.sh             | 15 ++---
 .../qemu-system-aarch64/5.2.0-arm64v8.dockerfile   | 75 ++++++++++++++++++++++
 5 files changed, 100 insertions(+), 15 deletions(-)
 create mode 100644 automation/tests-artifacts/qemu-system-aarch64/5.2.0-arm64v8.dockerfile


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH 1/3] automation: add qemu-system-aarch64 to test-artifacts
  2021-01-05 22:58 [PATCH 0/3] automation: build qemu-system-aarch64 and use it for tests Stefano Stabellini
@ 2021-01-05 22:58 ` Stefano Stabellini
  2021-01-05 22:58 ` [PATCH 2/3] automation: add a job to import qemu-system-aarch64 into the pipeline Stefano Stabellini
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 6+ messages in thread
From: Stefano Stabellini @ 2021-01-05 22:58 UTC (permalink / raw)
  To: andrew.cooper3, cardoe, wl; +Cc: sstabellini, xen-devel, Stefano Stabellini

Currently we are using Debian's qemu-system-aarch64 for our tests.
However, sometimes it crashes. It is hard to debug and even harder to
apply any fixes to it.

Instead, build our own QEMU as one of our test-artifacts, which are only
built once, then imported into each pipeline via phony jobs.

Signed-off-by: Stefano Stabellini <stefano.stabellini@xilinx.com>
---
 .../5.2.0-arm64v8.dockerfile                  | 75 +++++++++++++++++++
 1 file changed, 75 insertions(+)
 create mode 100644 automation/tests-artifacts/qemu-system-aarch64/5.2.0-arm64v8.dockerfile

diff --git a/automation/tests-artifacts/qemu-system-aarch64/5.2.0-arm64v8.dockerfile b/automation/tests-artifacts/qemu-system-aarch64/5.2.0-arm64v8.dockerfile
new file mode 100644
index 0000000000..e105a1c636
--- /dev/null
+++ b/automation/tests-artifacts/qemu-system-aarch64/5.2.0-arm64v8.dockerfile
@@ -0,0 +1,75 @@
+FROM arm64v8/debian:unstable
+LABEL maintainer.name="The Xen Project" \
+      maintainer.email="xen-devel@lists.xenproject.org"
+
+ENV DEBIAN_FRONTEND=noninteractive
+ENV QEMU_VERSION=5.2.0
+ENV USER root
+
+RUN mkdir /build
+WORKDIR /build
+
+# build depends
+RUN apt-get update && \
+    apt-get --quiet --yes install \
+        build-essential \
+        curl \
+        python3 \
+        ninja-build \
+        pkg-config \
+        libglib2.0-dev \
+        libpixman-1-dev \
+        && \
+    \
+    curl -fsSLO https://download.qemu.org/qemu-"$QEMU_VERSION".tar.xz && \
+    tar xvJf qemu-"$QEMU_VERSION".tar.xz && \
+    cd qemu-"$QEMU_VERSION" && \
+    ./configure                \
+        --target-list=aarch64-softmmu \
+        --enable-system        \
+        --disable-blobs        \
+        --disable-bsd-user     \
+        --disable-debug-info   \
+        --disable-glusterfs    \
+        --disable-gtk          \
+        --disable-guest-agent  \
+        --disable-linux-user   \
+        --disable-sdl          \
+        --disable-spice        \
+        --disable-tpm          \
+        --disable-vhost-net    \
+        --disable-vhost-scsi   \
+        --disable-vhost-user   \
+        --disable-vhost-vsock  \
+        --disable-virtfs       \
+        --disable-vnc          \
+        --disable-werror       \
+        --disable-xen          \
+        --disable-safe-stack   \
+        --disable-libssh       \
+        --disable-opengl       \
+        --disable-tools        \
+        --disable-virglrenderer  \
+        --disable-stack-protector  \
+        --disable-containers   \
+        --disable-replication  \
+        --disable-cloop        \
+        --disable-dmg          \
+        --disable-vvfat        \
+        --disable-vdi          \
+        --disable-parallels    \
+        --disable-qed          \
+        --disable-bochs        \
+        --disable-qom-cast-debug  \
+        --disable-vhost-vdpa   \
+        --disable-vhost-kernel \
+        --disable-qcow1        \
+        --disable-live-block-migration \
+    && \
+    make -j$(nproc) && \
+    cp ./build/qemu-system-aarch64 / && \
+    cd /build && \
+    rm -rf qemu-"$QEMU_VERSION"* && \
+    apt-get autoremove -y && \
+    apt-get clean && \
+    rm -rf /var/lib/apt/lists* /tmp/* /var/tmp/*
-- 
2.17.1



^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH 2/3] automation: add a job to import qemu-system-aarch64 into the pipeline
  2021-01-05 22:58 [PATCH 0/3] automation: build qemu-system-aarch64 and use it for tests Stefano Stabellini
  2021-01-05 22:58 ` [PATCH 1/3] automation: add qemu-system-aarch64 to test-artifacts Stefano Stabellini
@ 2021-01-05 22:58 ` Stefano Stabellini
  2021-01-05 22:58 ` [PATCH 3/3] automation: use test-artifacts/qemu-system-aarch64 instead of Debian's Stefano Stabellini
  2021-01-06 21:18 ` [PATCH 0/3] automation: build qemu-system-aarch64 and use it for tests Wei Liu
  3 siblings, 0 replies; 6+ messages in thread
From: Stefano Stabellini @ 2021-01-05 22:58 UTC (permalink / raw)
  To: andrew.cooper3, cardoe, wl; +Cc: sstabellini, xen-devel, Stefano Stabellini

In order to use the pre-built test-artifacts/qemu-system-aarch64 binary
for our tests, first we need to import it into the pipeline. Let's do
that the same way we did it for the kernel and Alpine Linux filesystem:
by creating a special job for it.

Signed-off-by: Stefano Stabellini <stefano.stabellini@xilinx.com>
---
 automation/gitlab-ci/build.yaml | 11 +++++++++++
 automation/gitlab-ci/test.yaml  |  2 ++
 2 files changed, 13 insertions(+)

diff --git a/automation/gitlab-ci/build.yaml b/automation/gitlab-ci/build.yaml
index e5246828f8..db68dd0b69 100644
--- a/automation/gitlab-ci/build.yaml
+++ b/automation/gitlab-ci/build.yaml
@@ -494,3 +494,14 @@ kernel-5.9.9-arm64-export:
   tags:
     - arm64
 
+qemu-system-aarch64-5.2.0-arm64-export:
+  stage: build
+  image: registry.gitlab.com/xen-project/xen/tests-artifacts/qemu-system-aarch64:5.2.0-arm64v8
+  script:
+    - mkdir binaries && cp /qemu-system-aarch64 binaries/qemu-system-aarch64
+  artifacts:
+    paths:
+      - binaries/qemu-system-aarch64
+  tags:
+    - arm64
+
diff --git a/automation/gitlab-ci/test.yaml b/automation/gitlab-ci/test.yaml
index 9448651187..91a10febbf 100644
--- a/automation/gitlab-ci/test.yaml
+++ b/automation/gitlab-ci/test.yaml
@@ -33,6 +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
   artifacts:
     paths:
       - smoke.serial
@@ -56,6 +57,7 @@ qemu-smoke-arm64-gcc:
   dependencies:
     - debian-unstable-gcc-arm64
     - kernel-5.9.9-arm64-export
+    - qemu-system-aarch64-5.2.0-arm64-export
   artifacts:
     paths:
       - smoke.serial
-- 
2.17.1



^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH 3/3] automation: use test-artifacts/qemu-system-aarch64 instead of Debian's
  2021-01-05 22:58 [PATCH 0/3] automation: build qemu-system-aarch64 and use it for tests Stefano Stabellini
  2021-01-05 22:58 ` [PATCH 1/3] automation: add qemu-system-aarch64 to test-artifacts Stefano Stabellini
  2021-01-05 22:58 ` [PATCH 2/3] automation: add a job to import qemu-system-aarch64 into the pipeline Stefano Stabellini
@ 2021-01-05 22:58 ` Stefano Stabellini
  2021-01-06 21:18 ` [PATCH 0/3] automation: build qemu-system-aarch64 and use it for tests Wei Liu
  3 siblings, 0 replies; 6+ messages in thread
From: Stefano Stabellini @ 2021-01-05 22:58 UTC (permalink / raw)
  To: andrew.cooper3, cardoe, wl; +Cc: sstabellini, xen-devel, Stefano Stabellini

Instead apt-get'ing Debian's qemu-system-aarch64, simply use the
provided QEMU binary under binaries.

Signed-off-by: Stefano Stabellini <stefano.stabellini@xilinx.com>
---
 automation/scripts/qemu-alpine-arm64.sh | 12 +++++-------
 automation/scripts/qemu-smoke-arm64.sh  | 15 +++++++--------
 2 files changed, 12 insertions(+), 15 deletions(-)

diff --git a/automation/scripts/qemu-alpine-arm64.sh b/automation/scripts/qemu-alpine-arm64.sh
index b43a654270..e2240f9ab4 100755
--- a/automation/scripts/qemu-alpine-arm64.sh
+++ b/automation/scripts/qemu-alpine-arm64.sh
@@ -3,8 +3,7 @@
 set -ex
 
 apt-get -qy update
-apt-get -qy install --no-install-recommends qemu-system-aarch64 \
-                                            u-boot-qemu \
+apt-get -qy install --no-install-recommends u-boot-qemu \
                                             u-boot-tools \
                                             device-tree-compiler \
                                             cpio \
@@ -69,10 +68,9 @@ echo "rc_verbose=yes" >> etc/rc.conf
 find . |cpio -H newc -o|gzip > ../xen-rootfs.cpio.gz
 cd ../..
 
-# XXX Silly workaround to get the following QEMU command to work
-# QEMU looks for "efi-virtio.rom" even if it is unneeded
-cp /usr/share/qemu/pvh.bin /usr/share/qemu/efi-virtio.rom
-qemu-system-aarch64 \
+# XXX QEMU looks for "efi-virtio.rom" even if it is unneeded
+curl -fsSLO curl -fsSLO https://github.com/qemu/qemu/raw/v5.2.0/pc-bios/efi-virtio.rom
+./binaries/qemu-system-aarch64 \
    -machine virtualization=true \
    -cpu cortex-a57 -machine type=virt \
    -m 1024 -display none \
@@ -107,7 +105,7 @@ rm -f smoke.serial
 set +e
 echo "  virtio scan; dhcp; tftpb 0x40000000 boot.scr; source 0x40000000"| \
 timeout -k 1 720 \
-qemu-system-aarch64 \
+./binaries/qemu-system-aarch64 \
     -machine virtualization=true \
     -cpu cortex-a57 -machine type=virt \
     -m 2048 -monitor none -serial stdio \
diff --git a/automation/scripts/qemu-smoke-arm64.sh b/automation/scripts/qemu-smoke-arm64.sh
index bdef0717ad..53086a5ac7 100755
--- a/automation/scripts/qemu-smoke-arm64.sh
+++ b/automation/scripts/qemu-smoke-arm64.sh
@@ -5,17 +5,16 @@ set -ex
 # Install QEMU
 export DEBIAN_FRONTENT=noninteractive
 apt-get -qy update
-apt-get -qy install --no-install-recommends qemu-system-aarch64 \
-                                            u-boot-qemu \
+apt-get -qy install --no-install-recommends u-boot-qemu \
                                             u-boot-tools \
                                             device-tree-compiler \
                                             busybox-static \
-                                            cpio
+                                            cpio \
+                                            curl
 
-# XXX Silly workaround to get the following QEMU command to work
-# QEMU looks for "efi-virtio.rom" even if it is unneeded
-cp /usr/share/qemu/pvh.bin /usr/share/qemu/efi-virtio.rom
-qemu-system-aarch64 \
+# 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 \
    -machine virtualization=true \
    -cpu cortex-a57 -machine type=virt \
    -m 1024 -display none \
@@ -79,7 +78,7 @@ rm -f smoke.serial
 set +e
 echo "  virtio scan; dhcp; tftpb 0x40000000 boot.scr; source 0x40000000"| \
 timeout -k 1 240 \
-qemu-system-aarch64 \
+./binaries/qemu-system-aarch64 \
     -machine virtualization=true \
     -cpu cortex-a57 -machine type=virt \
     -m 1024 -monitor none -serial stdio \
-- 
2.17.1



^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH 0/3] automation: build qemu-system-aarch64 and use it for tests
  2021-01-05 22:58 [PATCH 0/3] automation: build qemu-system-aarch64 and use it for tests Stefano Stabellini
                   ` (2 preceding siblings ...)
  2021-01-05 22:58 ` [PATCH 3/3] automation: use test-artifacts/qemu-system-aarch64 instead of Debian's Stefano Stabellini
@ 2021-01-06 21:18 ` Wei Liu
  2021-01-06 21:23   ` Stefano Stabellini
  3 siblings, 1 reply; 6+ messages in thread
From: Wei Liu @ 2021-01-06 21:18 UTC (permalink / raw)
  To: Stefano Stabellini; +Cc: andrew.cooper3, cardoe, wl, xen-devel

On Tue, Jan 05, 2021 at 02:58:38PM -0800, Stefano Stabellini wrote:
> Hi all,
> 
> Currently we are using Debian's qemu-system-aarch64 for our tests.
> However, sometimes it crashes. See for instance
> https://gitlab.com/xen-project/people/andyhhp/xen/-/jobs/939556527. It
> is hard to debug and even harder to apply any fixes to it.
> 
> Instead, build our own QEMU as one of our test-artifacts, which are only
> built once, then imported into each pipeline via phony jobs. Use the
> provided qemu-system-aarch64 binary for our arm64 tests.
> 
> 
> Stefano Stabellini (3):
>       automation: add qemu-system-aarch64 to test-artifacts
>       automation: add a job to import qemu-system-aarch64 into the pipeline
>       automation: use test-artifacts/qemu-system-aarch64 instead of Debian's

Acked-by: Wei Liu <wl@xen.org>

I do wonder if there is a way to not build QEMU during every pipeline
run though...


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 0/3] automation: build qemu-system-aarch64 and use it for tests
  2021-01-06 21:18 ` [PATCH 0/3] automation: build qemu-system-aarch64 and use it for tests Wei Liu
@ 2021-01-06 21:23   ` Stefano Stabellini
  0 siblings, 0 replies; 6+ messages in thread
From: Stefano Stabellini @ 2021-01-06 21:23 UTC (permalink / raw)
  To: Wei Liu; +Cc: Stefano Stabellini, andrew.cooper3, cardoe, xen-devel

On Wed, 6 Jan 2021, Wei Liu wrote:
> On Tue, Jan 05, 2021 at 02:58:38PM -0800, Stefano Stabellini wrote:
> > Hi all,
> > 
> > Currently we are using Debian's qemu-system-aarch64 for our tests.
> > However, sometimes it crashes. See for instance
> > https://gitlab.com/xen-project/people/andyhhp/xen/-/jobs/939556527. It
> > is hard to debug and even harder to apply any fixes to it.
> > 
> > Instead, build our own QEMU as one of our test-artifacts, which are only
> > built once, then imported into each pipeline via phony jobs. Use the
> > provided qemu-system-aarch64 binary for our arm64 tests.
> > 
> > 
> > Stefano Stabellini (3):
> >       automation: add qemu-system-aarch64 to test-artifacts
> >       automation: add a job to import qemu-system-aarch64 into the pipeline
> >       automation: use test-artifacts/qemu-system-aarch64 instead of Debian's
> 
> Acked-by: Wei Liu <wl@xen.org>
> 
> I do wonder if there is a way to not build QEMU during every pipeline
> run though...

It does not build QEMU every pipeline! It only imports it into the
pipeline by copying the QEMU binary from a container. The container with
the QEMU binary is not built every time. We could build it once a month
or so like the build containers.


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2021-01-06 21:24 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-05 22:58 [PATCH 0/3] automation: build qemu-system-aarch64 and use it for tests Stefano Stabellini
2021-01-05 22:58 ` [PATCH 1/3] automation: add qemu-system-aarch64 to test-artifacts Stefano Stabellini
2021-01-05 22:58 ` [PATCH 2/3] automation: add a job to import qemu-system-aarch64 into the pipeline Stefano Stabellini
2021-01-05 22:58 ` [PATCH 3/3] automation: use test-artifacts/qemu-system-aarch64 instead of Debian's Stefano Stabellini
2021-01-06 21:18 ` [PATCH 0/3] automation: build qemu-system-aarch64 and use it for tests Wei Liu
2021-01-06 21:23   ` Stefano Stabellini

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.