Xen-Devel Archive mirror
 help / color / mirror / Atom feed
* [PATCH 00/12] automation: Add build and test for Linux stubdomain
@ 2024-05-16 13:58 Marek Marczykowski-Górecki
  2024-05-16 13:58 ` [PATCH 01/12] automation: include domU kernel messages in the console output log Marek Marczykowski-Górecki
                   ` (11 more replies)
  0 siblings, 12 replies; 22+ messages in thread
From: Marek Marczykowski-Górecki @ 2024-05-16 13:58 UTC (permalink / raw
  To: xen-devel; +Cc: Marek Marczykowski-Górecki

Initial patches can be applied independently but all are needed before the
"automation: Add linux stubdom build and smoke test" patch.
And later "libxl: Allow stubdomain to control interupts of PCI device" and
"automation: update kernel for x86 tests" is needed before PCI passthrough
test (but both can be committed earlier as they don't depend on others).

See the "automation: Add linux stubdom build and smoke test" patch description
for more details.

Note the Alpine version bump requires rebuilding containers, but so does the
actual test patch (extra dependencies), so it probably makes sense to do it at
the same time.

Marek Marczykowski-Górecki (12):
  automation: include domU kernel messages in the console output log
  automation: update fedora build to F39
  automation: switch to alpine:3.19
  automation: increase verbosity of starting a domain
  automation: prevent grub unpacking initramfs
  RFC: automation: Add linux stubdom build and smoke test
  libxl: Allow stubdomain to control interupts of PCI device
  automation: update kernel for x86 tests
  WIP: automation: temporarily add 'testlab' tag to stubdomain build
  automation: stubdom test with PCI passthrough
  automation: stubdom test with boot from CDROM
  [DO NOT MERGE] switch to my containers fork

 automation/build/alpine/3.18-arm64v8.dockerfile           |  49 +--
 automation/build/alpine/3.18.dockerfile                   |  51 +--
 automation/build/alpine/3.19-arm64v8.dockerfile           |  52 ++-
 automation/build/alpine/3.19.dockerfile                   |  60 +++-
 automation/build/fedora/29.dockerfile                     |  46 +--
 automation/build/fedora/39.dockerfile                     |  46 ++-
 automation/gitlab-ci/build.yaml                           |  85 ++--
 automation/gitlab-ci/test.yaml                            |  87 ++--
 automation/scripts/build                                  |  12 +-
 automation/scripts/containerize                           |   4 +-
 automation/scripts/qemu-alpine-x86_64.sh                  |   2 +-
 automation/scripts/qemu-smoke-dom0-arm32.sh               |   2 +-
 automation/scripts/qemu-smoke-dom0-arm64.sh               |   2 +-
 automation/scripts/qubes-x86-64.sh                        | 153 ++++++-
 automation/tests-artifacts/alpine/3.18-arm64v8.dockerfile |  65 +---
 automation/tests-artifacts/alpine/3.18.dockerfile         |  66 +---
 automation/tests-artifacts/alpine/3.19-arm64v8.dockerfile |  65 +++-
 automation/tests-artifacts/alpine/3.19.dockerfile         |  72 +++-
 automation/tests-artifacts/kernel/6.1.19.dockerfile       |  40 +--
 automation/tests-artifacts/kernel/6.1.90.dockerfile       |  40 ++-
 tools/libs/light/libxl_pci.c                              |   8 +-
 21 files changed, 614 insertions(+), 393 deletions(-)
 delete mode 100644 automation/build/alpine/3.18-arm64v8.dockerfile
 delete mode 100644 automation/build/alpine/3.18.dockerfile
 create mode 100644 automation/build/alpine/3.19-arm64v8.dockerfile
 create mode 100644 automation/build/alpine/3.19.dockerfile
 delete mode 100644 automation/build/fedora/29.dockerfile
 create mode 100644 automation/build/fedora/39.dockerfile
 delete mode 100644 automation/tests-artifacts/alpine/3.18-arm64v8.dockerfile
 delete mode 100644 automation/tests-artifacts/alpine/3.18.dockerfile
 create mode 100644 automation/tests-artifacts/alpine/3.19-arm64v8.dockerfile
 create mode 100644 automation/tests-artifacts/alpine/3.19.dockerfile
 delete mode 100644 automation/tests-artifacts/kernel/6.1.19.dockerfile
 create mode 100644 automation/tests-artifacts/kernel/6.1.90.dockerfile

base-commit: 319a5125ca2649e6eb95670b4d721260025c187d
-- 
git-series 0.9.1


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

* [PATCH 01/12] automation: include domU kernel messages in the console output log
  2024-05-16 13:58 [PATCH 00/12] automation: Add build and test for Linux stubdomain Marek Marczykowski-Górecki
@ 2024-05-16 13:58 ` Marek Marczykowski-Górecki
  2024-05-17 20:57   ` Stefano Stabellini
  2024-05-16 13:58 ` [PATCH 02/12] automation: update fedora build to F39 Marek Marczykowski-Górecki
                   ` (10 subsequent siblings)
  11 siblings, 1 reply; 22+ messages in thread
From: Marek Marczykowski-Górecki @ 2024-05-16 13:58 UTC (permalink / raw
  To: xen-devel
  Cc: Marek Marczykowski-Górecki, Doug Goldstein,
	Stefano Stabellini

Signed-off-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
---
 automation/scripts/qubes-x86-64.sh | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/automation/scripts/qubes-x86-64.sh b/automation/scripts/qubes-x86-64.sh
index d81ed7b931cf..4beeff17d31b 100755
--- a/automation/scripts/qubes-x86-64.sh
+++ b/automation/scripts/qubes-x86-64.sh
@@ -131,6 +131,8 @@ mkdir sys
 rm var/run
 echo "#!/bin/sh
 
+echo 8 > /proc/sys/kernel/printk
+
 ${domU_check}
 " > etc/local.d/xen.start
 chmod +x etc/local.d/xen.start
-- 
git-series 0.9.1


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

* [PATCH 02/12] automation: update fedora build to F39
  2024-05-16 13:58 [PATCH 00/12] automation: Add build and test for Linux stubdomain Marek Marczykowski-Górecki
  2024-05-16 13:58 ` [PATCH 01/12] automation: include domU kernel messages in the console output log Marek Marczykowski-Górecki
@ 2024-05-16 13:58 ` Marek Marczykowski-Górecki
  2024-05-17 20:57   ` Stefano Stabellini
  2024-05-16 13:58 ` [PATCH 03/12] automation: switch to alpine:3.19 Marek Marczykowski-Górecki
                   ` (9 subsequent siblings)
  11 siblings, 1 reply; 22+ messages in thread
From: Marek Marczykowski-Górecki @ 2024-05-16 13:58 UTC (permalink / raw
  To: xen-devel
  Cc: Marek Marczykowski-Górecki, Doug Goldstein,
	Stefano Stabellini

Fedora 29 is long EOL

Signed-off-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
---
 automation/build/fedora/29.dockerfile | 46 +----------------------------
 automation/build/fedora/39.dockerfile | 46 ++++++++++++++++++++++++++++-
 automation/gitlab-ci/build.yaml       |  4 +-
 3 files changed, 48 insertions(+), 48 deletions(-)
 delete mode 100644 automation/build/fedora/29.dockerfile
 create mode 100644 automation/build/fedora/39.dockerfile

diff --git a/automation/build/fedora/29.dockerfile b/automation/build/fedora/29.dockerfile
deleted file mode 100644
index f473ae13e7c1..000000000000
--- a/automation/build/fedora/29.dockerfile
+++ /dev/null
@@ -1,46 +0,0 @@
-FROM --platform=linux/amd64 fedora:29
-LABEL maintainer.name="The Xen Project" \
-      maintainer.email="xen-devel@lists.xenproject.org"
-
-# install Xen depends
-RUN dnf -y install \
-        clang \
-        gcc \
-        gcc-c++ \
-        ncurses-devel \
-        zlib-devel \
-        openssl-devel \
-        python-devel \
-        python3-devel \
-        libuuid-devel \
-        pkgconfig \
-        flex \
-        bison \
-        libaio-devel \
-        glib2-devel \
-        yajl-devel \
-        pixman-devel \
-        glibc-devel \
-        make \
-        binutils \
-        git \
-        wget \
-        acpica-tools \
-        python-markdown \
-        patch \
-        checkpolicy \
-        dev86 \
-        xz-devel \
-        bzip2 \
-        nasm \
-        ocaml \
-        ocaml-findlib \
-        golang \
-        # QEMU
-        ninja-build \
-    && dnf clean all && \
-    rm -rf /var/cache/dnf
-
-RUN useradd --create-home user
-USER user
-WORKDIR /build
diff --git a/automation/build/fedora/39.dockerfile b/automation/build/fedora/39.dockerfile
new file mode 100644
index 000000000000..054f73444060
--- /dev/null
+++ b/automation/build/fedora/39.dockerfile
@@ -0,0 +1,46 @@
+FROM --platform=linux/amd64 fedora:39
+LABEL maintainer.name="The Xen Project" \
+      maintainer.email="xen-devel@lists.xenproject.org"
+
+# install Xen depends
+RUN dnf -y install \
+        clang \
+        gcc \
+        gcc-c++ \
+        ncurses-devel \
+        zlib-devel \
+        openssl-devel \
+        python-devel \
+        python3-devel \
+        libuuid-devel \
+        pkgconfig \
+        flex \
+        bison \
+        libaio-devel \
+        glib2-devel \
+        yajl-devel \
+        pixman-devel \
+        glibc-devel \
+        make \
+        binutils \
+        git \
+        wget \
+        acpica-tools \
+        python-markdown \
+        patch \
+        checkpolicy \
+        dev86 \
+        xz-devel \
+        bzip2 \
+        nasm \
+        ocaml \
+        ocaml-findlib \
+        golang \
+        # QEMU
+        ninja-build \
+    && dnf clean all && \
+    rm -rf /var/cache/dnf
+
+RUN useradd --create-home user
+USER user
+WORKDIR /build
diff --git a/automation/gitlab-ci/build.yaml b/automation/gitlab-ci/build.yaml
index 49d6265ad5b4..69665ec5b11f 100644
--- a/automation/gitlab-ci/build.yaml
+++ b/automation/gitlab-ci/build.yaml
@@ -691,12 +691,12 @@ debian-bookworm-32-gcc-debug:
 fedora-gcc:
   extends: .gcc-x86-64-build
   variables:
-    CONTAINER: fedora:29
+    CONTAINER: fedora:39
 
 fedora-gcc-debug:
   extends: .gcc-x86-64-build-debug
   variables:
-    CONTAINER: fedora:29
+    CONTAINER: fedora:39
 
 # Ubuntu Trusty's Clang is 3.4 while Xen requires 3.5
 
-- 
git-series 0.9.1


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

* [PATCH 03/12] automation: switch to alpine:3.19
  2024-05-16 13:58 [PATCH 00/12] automation: Add build and test for Linux stubdomain Marek Marczykowski-Górecki
  2024-05-16 13:58 ` [PATCH 01/12] automation: include domU kernel messages in the console output log Marek Marczykowski-Górecki
  2024-05-16 13:58 ` [PATCH 02/12] automation: update fedora build to F39 Marek Marczykowski-Górecki
@ 2024-05-16 13:58 ` Marek Marczykowski-Górecki
  2024-05-17 21:58   ` Stefano Stabellini
  2024-05-16 13:58 ` [PATCH 04/12] automation: increase verbosity of starting a domain Marek Marczykowski-Górecki
                   ` (8 subsequent siblings)
  11 siblings, 1 reply; 22+ messages in thread
From: Marek Marczykowski-Górecki @ 2024-05-16 13:58 UTC (permalink / raw
  To: xen-devel
  Cc: Marek Marczykowski-Górecki, Doug Goldstein,
	Stefano Stabellini

Alpine 3.19 is needed for upcoming stubdomain tests, as linux stubdomain
build requires dracut-core package (dracut-install tool specifically)
which isn't available in 3.18. While technically it will be needed only
in the x86_64 builds, switch Alpine version everywhere for uniformity.
Note this bumps kernel version requirement on docker runners -
dracut-install uses faccessat2() syscall which was introduced in Linux
5.8.

Signed-off-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
---
 automation/build/alpine/3.18-arm64v8.dockerfile           | 49 +------
 automation/build/alpine/3.18.dockerfile                   | 51 +------
 automation/build/alpine/3.19-arm64v8.dockerfile           | 49 ++++++-
 automation/build/alpine/3.19.dockerfile                   | 51 ++++++-
 automation/gitlab-ci/build.yaml                           | 56 +++----
 automation/gitlab-ci/test.yaml                            | 52 +++---
 automation/scripts/containerize                           |  4 +-
 automation/tests-artifacts/alpine/3.18-arm64v8.dockerfile | 65 +--------
 automation/tests-artifacts/alpine/3.18.dockerfile         | 66 +--------
 automation/tests-artifacts/alpine/3.19-arm64v8.dockerfile | 65 ++++++++-
 automation/tests-artifacts/alpine/3.19.dockerfile         | 67 ++++++++-
 11 files changed, 288 insertions(+), 287 deletions(-)
 delete mode 100644 automation/build/alpine/3.18-arm64v8.dockerfile
 delete mode 100644 automation/build/alpine/3.18.dockerfile
 create mode 100644 automation/build/alpine/3.19-arm64v8.dockerfile
 create mode 100644 automation/build/alpine/3.19.dockerfile
 delete mode 100644 automation/tests-artifacts/alpine/3.18-arm64v8.dockerfile
 delete mode 100644 automation/tests-artifacts/alpine/3.18.dockerfile
 create mode 100644 automation/tests-artifacts/alpine/3.19-arm64v8.dockerfile
 create mode 100644 automation/tests-artifacts/alpine/3.19.dockerfile

diff --git a/automation/build/alpine/3.18-arm64v8.dockerfile b/automation/build/alpine/3.18-arm64v8.dockerfile
deleted file mode 100644
index 91e90220240f..000000000000
--- a/automation/build/alpine/3.18-arm64v8.dockerfile
+++ /dev/null
@@ -1,49 +0,0 @@
-FROM --platform=linux/arm64/v8 alpine:3.18
-LABEL maintainer.name="The Xen Project" \
-      maintainer.email="xen-devel@lists.xenproject.org"
-
-ENV USER root
-
-RUN mkdir /build
-WORKDIR /build
-
-# build depends
-RUN apk --no-cache add \
-  \
-  # xen build deps
-  argp-standalone \
-  autoconf \
-  bash \
-  bison \
-  curl \
-  dev86 \
-  dtc-dev \
-  flex \
-  gcc \
-  git \
-  iasl \
-  libaio-dev \
-  libfdt \
-  linux-headers \
-  make \
-  musl-dev  \
-  ncurses-dev \
-  ocaml \
-  ocaml-findlib \
-  patch  \
-  python3-dev \
-  py3-setuptools \
-  texinfo \
-  util-linux-dev \
-  xz-dev \
-  yajl-dev \
-  zlib-dev \
-  \
-  # qemu build deps
-  glib-dev \
-  libattr \
-  libcap-ng-dev \
-  pixman-dev \
-  # qubes test deps
-  openssh-client \
-  fakeroot \
diff --git a/automation/build/alpine/3.18.dockerfile b/automation/build/alpine/3.18.dockerfile
deleted file mode 100644
index 8d5dac05b01f..000000000000
--- a/automation/build/alpine/3.18.dockerfile
+++ /dev/null
@@ -1,51 +0,0 @@
-FROM --platform=linux/amd64 alpine:3.18
-LABEL maintainer.name="The Xen Project" \
-      maintainer.email="xen-devel@lists.xenproject.org"
-
-ENV USER root
-
-RUN mkdir /build
-WORKDIR /build
-
-# build depends
-RUN apk --no-cache add \
-  \
-  # xen build deps
-  argp-standalone \
-  autoconf \
-  bash \
-  bison \
-  clang \
-  curl \
-  dev86 \
-  flex \
-  g++ \
-  gcc \
-  git \
-  grep \
-  iasl \
-  libaio-dev \
-  libc6-compat \
-  linux-headers \
-  make \
-  musl-dev  \
-  ncurses-dev \
-  ocaml \
-  ocaml-findlib \
-  patch  \
-  python3-dev \
-  py3-setuptools \
-  texinfo \
-  util-linux-dev \
-  xz-dev \
-  yajl-dev \
-  zlib-dev \
-  \
-  # qemu build deps
-  glib-dev \
-  libattr \
-  libcap-ng-dev \
-  ninja \
-  pixman-dev \
-  # livepatch-tools deps
-  elfutils-dev \
diff --git a/automation/build/alpine/3.19-arm64v8.dockerfile b/automation/build/alpine/3.19-arm64v8.dockerfile
new file mode 100644
index 000000000000..158cf465a9ff
--- /dev/null
+++ b/automation/build/alpine/3.19-arm64v8.dockerfile
@@ -0,0 +1,49 @@
+FROM --platform=linux/arm64/v8 alpine:3.19
+LABEL maintainer.name="The Xen Project" \
+      maintainer.email="xen-devel@lists.xenproject.org"
+
+ENV USER root
+
+RUN mkdir /build
+WORKDIR /build
+
+# build depends
+RUN apk --no-cache add \
+  \
+  # xen build deps
+  argp-standalone \
+  autoconf \
+  bash \
+  bison \
+  curl \
+  dev86 \
+  dtc-dev \
+  flex \
+  gcc \
+  git \
+  iasl \
+  libaio-dev \
+  libfdt \
+  linux-headers \
+  make \
+  musl-dev  \
+  ncurses-dev \
+  ocaml \
+  ocaml-findlib \
+  patch  \
+  python3-dev \
+  py3-setuptools \
+  texinfo \
+  util-linux-dev \
+  xz-dev \
+  yajl-dev \
+  zlib-dev \
+  \
+  # qemu build deps
+  glib-dev \
+  libattr \
+  libcap-ng-dev \
+  pixman-dev \
+  # qubes test deps
+  openssh-client \
+  fakeroot \
diff --git a/automation/build/alpine/3.19.dockerfile b/automation/build/alpine/3.19.dockerfile
new file mode 100644
index 000000000000..0be6d7c85fe7
--- /dev/null
+++ b/automation/build/alpine/3.19.dockerfile
@@ -0,0 +1,51 @@
+FROM --platform=linux/amd64 alpine:3.19
+LABEL maintainer.name="The Xen Project" \
+      maintainer.email="xen-devel@lists.xenproject.org"
+
+ENV USER root
+
+RUN mkdir /build
+WORKDIR /build
+
+# build depends
+RUN apk --no-cache add \
+  \
+  # xen build deps
+  argp-standalone \
+  autoconf \
+  bash \
+  bison \
+  clang \
+  curl \
+  dev86 \
+  flex \
+  g++ \
+  gcc \
+  git \
+  grep \
+  iasl \
+  libaio-dev \
+  libc6-compat \
+  linux-headers \
+  make \
+  musl-dev  \
+  ncurses-dev \
+  ocaml \
+  ocaml-findlib \
+  patch  \
+  python3-dev \
+  py3-setuptools \
+  texinfo \
+  util-linux-dev \
+  xz-dev \
+  yajl-dev \
+  zlib-dev \
+  \
+  # qemu build deps
+  glib-dev \
+  libattr \
+  libcap-ng-dev \
+  ninja \
+  pixman-dev \
+  # livepatch-tools deps
+  elfutils-dev \
diff --git a/automation/gitlab-ci/build.yaml b/automation/gitlab-ci/build.yaml
index 69665ec5b11f..b186289bbd82 100644
--- a/automation/gitlab-ci/build.yaml
+++ b/automation/gitlab-ci/build.yaml
@@ -258,9 +258,9 @@
 
 # Arm test artifacts
 
-alpine-3.18-arm64-rootfs-export:
+alpine-3.19-arm64-rootfs-export:
   extends: .test-jobs-artifact-common
-  image: registry.gitlab.com/xen-project/xen/tests-artifacts/alpine:3.18-arm64v8
+  image: registry.gitlab.com/xen-project/xen/tests-artifacts/alpine:3.19-arm64v8
   script:
     - mkdir binaries && cp /initrd.tar.gz binaries/initrd.tar.gz
   artifacts:
@@ -318,9 +318,9 @@ qemu-system-ppc64-8.1.0-ppc64-export:
 
 # x86_64 test artifacts
 
-alpine-3.18-rootfs-export:
+alpine-3.19-rootfs-export:
   extends: .test-jobs-artifact-common
-  image: registry.gitlab.com/xen-project/xen/tests-artifacts/alpine:3.18
+  image: registry.gitlab.com/xen-project/xen/tests-artifacts/alpine:3.19
   script:
     - mkdir binaries && cp /initrd.tar.gz binaries/initrd.tar.gz
   artifacts:
@@ -344,15 +344,15 @@ kernel-6.1.19-export:
 
 # Build jobs needed for tests
 
-alpine-3.18-gcc:
+alpine-3.19-gcc:
   extends: .gcc-x86-64-build
   variables:
-    CONTAINER: alpine:3.18
+    CONTAINER: alpine:3.19
 
-alpine-3.18-gcc-debug:
+alpine-3.19-gcc-debug:
   extends: .gcc-x86-64-build-debug
   variables:
-    CONTAINER: alpine:3.18
+    CONTAINER: alpine:3.19
 
 debian-stretch-gcc-debug:
   extends: .gcc-x86-64-build-debug
@@ -435,57 +435,57 @@ debian-bookworm-gcc-debug-arm64-randconfig:
     CONTAINER: debian:bookworm-arm64v8
     RANDCONFIG: y
 
-alpine-3.18-gcc-arm64:
+alpine-3.19-gcc-arm64:
   extends: .gcc-arm64-build
   variables:
-    CONTAINER: alpine:3.18-arm64v8
+    CONTAINER: alpine:3.19-arm64v8
 
-alpine-3.18-gcc-debug-arm64:
+alpine-3.19-gcc-debug-arm64:
   extends: .gcc-arm64-build-debug
   variables:
-    CONTAINER: alpine:3.18-arm64v8
+    CONTAINER: alpine:3.19-arm64v8
 
-alpine-3.18-gcc-arm64-randconfig:
+alpine-3.19-gcc-arm64-randconfig:
   extends: .gcc-arm64-build
   variables:
-    CONTAINER: alpine:3.18-arm64v8
+    CONTAINER: alpine:3.19-arm64v8
     RANDCONFIG: y
 
-alpine-3.18-gcc-debug-arm64-randconfig:
+alpine-3.19-gcc-debug-arm64-randconfig:
   extends: .gcc-arm64-build-debug
   variables:
-    CONTAINER: alpine:3.18-arm64v8
+    CONTAINER: alpine:3.19-arm64v8
     RANDCONFIG: y
 
-alpine-3.18-gcc-debug-arm64-staticmem:
+alpine-3.19-gcc-debug-arm64-staticmem:
   extends: .gcc-arm64-build-debug
   variables:
-    CONTAINER: alpine:3.18-arm64v8
+    CONTAINER: alpine:3.19-arm64v8
     EXTRA_XEN_CONFIG: |
       CONFIG_EXPERT=y
       CONFIG_UNSUPPORTED=y
       CONFIG_STATIC_MEMORY=y
 
-alpine-3.18-gcc-debug-arm64-static-shared-mem:
+alpine-3.19-gcc-debug-arm64-static-shared-mem:
   extends: .gcc-arm64-build-debug
   variables:
-    CONTAINER: alpine:3.18-arm64v8
+    CONTAINER: alpine:3.19-arm64v8
     EXTRA_XEN_CONFIG: |
       CONFIG_UNSUPPORTED=y
       CONFIG_STATIC_MEMORY=y
       CONFIG_STATIC_SHM=y
 
-alpine-3.18-gcc-debug-arm64-boot-cpupools:
+alpine-3.19-gcc-debug-arm64-boot-cpupools:
   extends: .gcc-arm64-build-debug
   variables:
-    CONTAINER: alpine:3.18-arm64v8
+    CONTAINER: alpine:3.19-arm64v8
     EXTRA_XEN_CONFIG: |
       CONFIG_BOOT_TIME_CPUPOOLS=y
 
-alpine-3.18-gcc-debug-arm64-earlyprintk:
+alpine-3.19-gcc-debug-arm64-earlyprintk:
   extends: .gcc-arm64-build-debug
   variables:
-    CONTAINER: alpine:3.18-arm64v8
+    CONTAINER: alpine:3.19-arm64v8
     EXTRA_XEN_CONFIG: |
       CONFIG_EARLY_UART_CHOICE_PL011=y
       CONFIG_EARLY_UART_BASE_ADDRESS=0x9000000
@@ -588,15 +588,15 @@ debian-bookworm-gcc-arm64-cppcheck:
 
 # Build jobs not needed for tests
 
-alpine-3.18-clang:
+alpine-3.19-clang:
   extends: .clang-x86-64-build
   variables:
-    CONTAINER: alpine:3.18
+    CONTAINER: alpine:3.19
 
-alpine-3.18-clang-debug:
+alpine-3.19-clang-debug:
   extends: .clang-x86-64-build-debug
   variables:
-    CONTAINER: alpine:3.18
+    CONTAINER: alpine:3.19
 
 archlinux-gcc:
   extends: .gcc-x86-64-build
diff --git a/automation/gitlab-ci/test.yaml b/automation/gitlab-ci/test.yaml
index ad249fa0a5d9..f62d426a8d34 100644
--- a/automation/gitlab-ci/test.yaml
+++ b/automation/gitlab-ci/test.yaml
@@ -3,7 +3,7 @@
   image: registry.gitlab.com/xen-project/xen/${CONTAINER}
 
 .arm64-test-needs: &arm64-test-needs
-  - alpine-3.18-arm64-rootfs-export
+  - alpine-3.19-arm64-rootfs-export
   - kernel-5.19-arm64-export
   - qemu-system-aarch64-6.0.0-arm64-export
 
@@ -11,7 +11,7 @@
   - qemu-system-aarch64-6.0.0-arm32-export
 
 .x86-64-test-needs: &x86-64-test-needs
-  - alpine-3.18-rootfs-export
+  - alpine-3.19-rootfs-export
   - kernel-6.1.19-export
 
 .qemu-arm64:
@@ -100,7 +100,7 @@
   extends: .test-jobs-common
   variables:
     # the test controller runs on RPi4
-    CONTAINER: alpine:3.18-arm64v8
+    CONTAINER: alpine:3.19-arm64v8
     LOGFILE: smoke-test.log
     PCIDEV: "03:00.0"
     PCIDEV_INTR: "MSI-X"
@@ -149,7 +149,7 @@ xilinx-smoke-dom0less-arm64-gcc:
     - ./automation/scripts/xilinx-smoke-dom0less-arm64.sh 2>&1 | tee ${LOGFILE}
   needs:
     - *arm64-test-needs
-    - alpine-3.18-gcc-arm64
+    - alpine-3.19-gcc-arm64
 
 xilinx-smoke-dom0less-arm64-gcc-gem-passthrough:
   extends: .xilinx-arm64
@@ -157,7 +157,7 @@ xilinx-smoke-dom0less-arm64-gcc-gem-passthrough:
     - ./automation/scripts/xilinx-smoke-dom0less-arm64.sh gem-passthrough 2>&1 | tee ${LOGFILE}
   needs:
     - *arm64-test-needs
-    - alpine-3.18-gcc-arm64
+    - alpine-3.19-gcc-arm64
 
 adl-smoke-x86-64-gcc-debug:
   extends: .adl-x86-64
@@ -165,7 +165,7 @@ adl-smoke-x86-64-gcc-debug:
     - ./automation/scripts/qubes-x86-64.sh 2>&1 | tee ${LOGFILE}
   needs:
     - *x86-64-test-needs
-    - alpine-3.18-gcc-debug
+    - alpine-3.19-gcc-debug
 
 adl-smoke-x86-64-dom0pvh-gcc-debug:
   extends: .adl-x86-64
@@ -173,7 +173,7 @@ adl-smoke-x86-64-dom0pvh-gcc-debug:
     - ./automation/scripts/qubes-x86-64.sh dom0pvh 2>&1 | tee ${LOGFILE}
   needs:
     - *x86-64-test-needs
-    - alpine-3.18-gcc-debug
+    - alpine-3.19-gcc-debug
 
 adl-suspend-x86-64-gcc-debug:
   extends: .adl-x86-64
@@ -181,7 +181,7 @@ adl-suspend-x86-64-gcc-debug:
     - ./automation/scripts/qubes-x86-64.sh s3 2>&1 | tee ${LOGFILE}
   needs:
     - *x86-64-test-needs
-    - alpine-3.18-gcc-debug
+    - alpine-3.19-gcc-debug
 
 adl-pci-pv-x86-64-gcc-debug:
   extends: .adl-x86-64
@@ -189,7 +189,7 @@ adl-pci-pv-x86-64-gcc-debug:
     - ./automation/scripts/qubes-x86-64.sh pci-pv 2>&1 | tee ${LOGFILE}
   needs:
     - *x86-64-test-needs
-    - alpine-3.18-gcc-debug
+    - alpine-3.19-gcc-debug
 
 adl-pci-hvm-x86-64-gcc-debug:
   extends: .adl-x86-64
@@ -197,7 +197,7 @@ adl-pci-hvm-x86-64-gcc-debug:
     - ./automation/scripts/qubes-x86-64.sh pci-hvm 2>&1 | tee ${LOGFILE}
   needs:
     - *x86-64-test-needs
-    - alpine-3.18-gcc-debug
+    - alpine-3.19-gcc-debug
 
 zen3p-smoke-x86-64-gcc-debug:
   extends: .zen3p-x86-64
@@ -205,7 +205,7 @@ zen3p-smoke-x86-64-gcc-debug:
     - ./automation/scripts/qubes-x86-64.sh 2>&1 | tee ${LOGFILE}
   needs:
     - *x86-64-test-needs
-    - alpine-3.18-gcc-debug
+    - alpine-3.19-gcc-debug
 
 zen3p-smoke-x86-64-dom0pvh-gcc-debug:
   extends: .zen3p-x86-64
@@ -213,7 +213,7 @@ zen3p-smoke-x86-64-dom0pvh-gcc-debug:
     - ./automation/scripts/qubes-x86-64.sh dom0pvh 2>&1 | tee ${LOGFILE}
   needs:
     - *x86-64-test-needs
-    - alpine-3.18-gcc-debug
+    - alpine-3.19-gcc-debug
 
 zen3p-pci-hvm-x86-64-gcc-debug:
   extends: .zen3p-x86-64
@@ -221,7 +221,7 @@ zen3p-pci-hvm-x86-64-gcc-debug:
     - ./automation/scripts/qubes-x86-64.sh pci-hvm 2>&1 | tee ${LOGFILE}
   needs:
     - *x86-64-test-needs
-    - alpine-3.18-gcc-debug
+    - alpine-3.19-gcc-debug
 
 qemu-smoke-dom0-arm64-gcc:
   extends: .qemu-arm64
@@ -229,7 +229,7 @@ qemu-smoke-dom0-arm64-gcc:
     - ./automation/scripts/qemu-smoke-dom0-arm64.sh 2>&1 | tee ${LOGFILE}
   needs:
     - *arm64-test-needs
-    - alpine-3.18-gcc-arm64
+    - alpine-3.19-gcc-arm64
 
 qemu-smoke-dom0-arm64-gcc-debug:
   extends: .qemu-arm64
@@ -237,7 +237,7 @@ qemu-smoke-dom0-arm64-gcc-debug:
     - ./automation/scripts/qemu-smoke-dom0-arm64.sh 2>&1 | tee ${LOGFILE}
   needs:
     - *arm64-test-needs
-    - alpine-3.18-gcc-debug-arm64
+    - alpine-3.19-gcc-debug-arm64
 
 qemu-smoke-dom0less-arm64-gcc:
   extends: .qemu-arm64
@@ -245,7 +245,7 @@ qemu-smoke-dom0less-arm64-gcc:
     - ./automation/scripts/qemu-smoke-dom0less-arm64.sh 2>&1 | tee ${LOGFILE}
   needs:
     - *arm64-test-needs
-    - alpine-3.18-gcc-arm64
+    - alpine-3.19-gcc-arm64
 
 qemu-smoke-dom0less-arm64-gcc-debug:
   extends: .qemu-arm64
@@ -253,7 +253,7 @@ qemu-smoke-dom0less-arm64-gcc-debug:
     - ./automation/scripts/qemu-smoke-dom0less-arm64.sh 2>&1 | tee ${LOGFILE}
   needs:
     - *arm64-test-needs
-    - alpine-3.18-gcc-debug-arm64
+    - alpine-3.19-gcc-debug-arm64
 
 qemu-smoke-dom0less-arm64-gcc-debug-gicv3:
   extends: .qemu-arm64
@@ -261,7 +261,7 @@ qemu-smoke-dom0less-arm64-gcc-debug-gicv3:
     - ./automation/scripts/qemu-smoke-dom0less-arm64.sh gicv3 2>&1 | tee ${LOGFILE}
   needs:
     - *arm64-test-needs
-    - alpine-3.18-gcc-debug-arm64
+    - alpine-3.19-gcc-debug-arm64
 
 qemu-smoke-dom0less-arm64-gcc-debug-staticmem:
   extends: .qemu-arm64
@@ -269,7 +269,7 @@ qemu-smoke-dom0less-arm64-gcc-debug-staticmem:
     - ./automation/scripts/qemu-smoke-dom0less-arm64.sh static-mem 2>&1 | tee ${LOGFILE}
   needs:
     - *arm64-test-needs
-    - alpine-3.18-gcc-debug-arm64-staticmem
+    - alpine-3.19-gcc-debug-arm64-staticmem
 
 qemu-smoke-dom0less-arm64-gcc-debug-staticheap:
  extends: .qemu-arm64
@@ -277,7 +277,7 @@ qemu-smoke-dom0less-arm64-gcc-debug-staticheap:
    - ./automation/scripts/qemu-smoke-dom0less-arm64.sh static-heap 2>&1 | tee ${LOGFILE}
  needs:
    - *arm64-test-needs
-   - alpine-3.18-gcc-debug-arm64
+   - alpine-3.19-gcc-debug-arm64
 
 qemu-smoke-dom0less-arm64-gcc-debug-static-shared-mem:
   extends: .qemu-arm64
@@ -285,7 +285,7 @@ qemu-smoke-dom0less-arm64-gcc-debug-static-shared-mem:
     - ./automation/scripts/qemu-smoke-dom0less-arm64.sh static-shared-mem 2>&1 | tee ${LOGFILE}
   needs:
     - *arm64-test-needs
-    - alpine-3.18-gcc-debug-arm64-static-shared-mem
+    - alpine-3.19-gcc-debug-arm64-static-shared-mem
 
 qemu-smoke-dom0less-arm64-gcc-debug-boot-cpupools:
   extends: .qemu-arm64
@@ -293,7 +293,7 @@ qemu-smoke-dom0less-arm64-gcc-debug-boot-cpupools:
     - ./automation/scripts/qemu-smoke-dom0less-arm64.sh boot-cpupools 2>&1 | tee ${LOGFILE}
   needs:
     - *arm64-test-needs
-    - alpine-3.18-gcc-debug-arm64-boot-cpupools
+    - alpine-3.19-gcc-debug-arm64-boot-cpupools
 
 qemu-smoke-dom0less-arm64-gcc-debug-earlyprintk:
   extends: .qemu-arm64
@@ -301,14 +301,14 @@ qemu-smoke-dom0less-arm64-gcc-debug-earlyprintk:
     - ./automation/scripts/qemu-smoke-dom0less-arm64.sh earlyprintk 2>&1 | tee ${LOGFILE}
   needs:
     - *arm64-test-needs
-    - alpine-3.18-gcc-debug-arm64-earlyprintk
+    - alpine-3.19-gcc-debug-arm64-earlyprintk
 
 qemu-xtf-dom0less-arm64-gcc-hyp-xen-version:
   extends: .qemu-arm64
   script:
     - ./automation/scripts/qemu-xtf-dom0less-arm64.sh hyp-xen-version 2>&1 | tee ${LOGFILE}
   needs:
-    - alpine-3.18-gcc-arm64
+    - alpine-3.19-gcc-arm64
     - qemu-system-aarch64-6.0.0-arm64-export
 
 qemu-xtf-dom0less-arm64-gcc-debug-hyp-xen-version:
@@ -316,7 +316,7 @@ qemu-xtf-dom0less-arm64-gcc-debug-hyp-xen-version:
   script:
     - ./automation/scripts/qemu-xtf-dom0less-arm64.sh hyp-xen-version 2>&1 | tee ${LOGFILE}
   needs:
-    - alpine-3.18-gcc-debug-arm64
+    - alpine-3.19-gcc-debug-arm64
     - qemu-system-aarch64-6.0.0-arm64-export
 
 qemu-smoke-dom0-arm32-gcc:
@@ -389,7 +389,7 @@ qemu-alpine-x86_64-gcc:
     - ./automation/scripts/qemu-alpine-x86_64.sh 2>&1 | tee ${LOGFILE}
   needs:
     - *x86-64-test-needs
-    - alpine-3.18-gcc
+    - alpine-3.19-gcc
 
 qemu-smoke-x86-64-gcc:
   extends: .qemu-x86-64
diff --git a/automation/scripts/containerize b/automation/scripts/containerize
index acdef1b54813..ae82e727b0b6 100755
--- a/automation/scripts/containerize
+++ b/automation/scripts/containerize
@@ -24,8 +24,8 @@ die() {
 #
 BASE="registry.gitlab.com/xen-project/xen"
 case "_${CONTAINER}" in
-    _alpine) CONTAINER="${BASE}/alpine:3.18" ;;
-    _alpine-arm64v8) CONTAINER="${BASE}/alpine:3.18-arm64v8" ;;
+    _alpine) CONTAINER="${BASE}/alpine:3.19" ;;
+    _alpine-arm64v8) CONTAINER="${BASE}/alpine:3.19-arm64v8" ;;
     _archlinux|_arch) CONTAINER="${BASE}/archlinux:current" ;;
     _riscv64) CONTAINER="${BASE}/archlinux:current-riscv64" ;;
     _centos7) CONTAINER="${BASE}/centos:7" ;;
diff --git a/automation/tests-artifacts/alpine/3.18-arm64v8.dockerfile b/automation/tests-artifacts/alpine/3.18-arm64v8.dockerfile
deleted file mode 100644
index 0e5ae7f2b4d8..000000000000
--- a/automation/tests-artifacts/alpine/3.18-arm64v8.dockerfile
+++ /dev/null
@@ -1,65 +0,0 @@
-FROM --platform=linux/arm64/v8 alpine:3.18
-LABEL maintainer.name="The Xen Project" \
-      maintainer.email="xen-devel@lists.xenproject.org"
-
-ENV USER root
-
-RUN mkdir /build
-WORKDIR /build
-
-RUN \
-  # apk
-  apk update && \
-  \
-  # xen runtime deps
-  apk add musl && \
-  apk add openrc && \
-  apk add busybox && \
-  apk add sudo && \
-  apk add dbus && \
-  apk add bash && \
-  apk add python3 && \
-  apk add zlib && \
-  apk add ncurses && \
-  apk add yajl && \
-  apk add libaio && \
-  apk add xz && \
-  apk add util-linux && \
-  apk add argp-standalone && \
-  apk add libfdt && \
-  apk add glib && \
-  apk add pixman && \
-  apk add curl && \
-  apk add udev && \
-  \
-  # Xen
-  cd / && \
-  # Minimal ramdisk environment in case of cpio output
-  rc-update add udev && \
-  rc-update add udev-trigger && \
-  rc-update add udev-settle && \
-  rc-update add networking sysinit && \
-  rc-update add loopback sysinit && \
-  rc-update add bootmisc boot && \
-  rc-update add devfs sysinit && \
-  rc-update add dmesg sysinit && \
-  rc-update add hostname boot && \
-  rc-update add hwclock boot && \
-  rc-update add hwdrivers sysinit && \
-  rc-update add killprocs shutdown && \
-  rc-update add modloop sysinit && \
-  rc-update add modules boot && \
-  rc-update add mount-ro shutdown && \
-  rc-update add savecache shutdown && \
-  rc-update add sysctl boot && \
-  rc-update add local default && \
-  cp -a /sbin/init /init && \
-  echo "ttyS0" >> /etc/securetty && \
-  echo "hvc0" >> /etc/securetty && \
-  echo "ttyS0::respawn:/sbin/getty -L ttyS0 115200 vt100" >> /etc/inittab && \
-  echo "hvc0::respawn:/sbin/getty -L hvc0 115200 vt100" >> /etc/inittab && \
-  passwd -d "root" root && \
-  \
-  # Create rootfs
-  cd / && \
-  tar cvzf /initrd.tar.gz bin dev etc home init lib mnt opt root sbin usr var
diff --git a/automation/tests-artifacts/alpine/3.18.dockerfile b/automation/tests-artifacts/alpine/3.18.dockerfile
deleted file mode 100644
index 9cde6c9ad4da..000000000000
--- a/automation/tests-artifacts/alpine/3.18.dockerfile
+++ /dev/null
@@ -1,66 +0,0 @@
-FROM --platform=linux/amd64 alpine:3.18
-LABEL maintainer.name="The Xen Project" \
-      maintainer.email="xen-devel@lists.xenproject.org"
-
-ENV USER root
-
-RUN mkdir /build
-WORKDIR /build
-
-RUN \
-  # apk
-  apk update && \
-  \
-  # xen runtime deps
-  apk add musl && \
-  apk add libgcc && \
-  apk add openrc && \
-  apk add busybox && \
-  apk add sudo && \
-  apk add dbus && \
-  apk add bash && \
-  apk add python3 && \
-  apk add zlib && \
-  apk add ncurses && \
-  apk add yajl && \
-  apk add libaio && \
-  apk add xz && \
-  apk add util-linux && \
-  apk add argp-standalone && \
-  apk add libfdt && \
-  apk add glib && \
-  apk add pixman && \
-  apk add curl && \
-  apk add udev && \
-  apk add pciutils && \
-  apk add libelf && \
-  \
-  # Xen
-  cd / && \
-  # Minimal ramdisk environment in case of cpio output
-  rc-update add udev && \
-  rc-update add udev-trigger && \
-  rc-update add udev-settle && \
-  rc-update add loopback sysinit && \
-  rc-update add bootmisc boot && \
-  rc-update add devfs sysinit && \
-  rc-update add dmesg sysinit && \
-  rc-update add hostname boot && \
-  rc-update add hwclock boot && \
-  rc-update add hwdrivers sysinit && \
-  rc-update add modules boot && \
-  rc-update add killprocs shutdown && \
-  rc-update add mount-ro shutdown && \
-  rc-update add savecache shutdown && \
-  rc-update add local default && \
-  cp -a /sbin/init /init && \
-  echo "ttyS0" >> /etc/securetty && \
-  echo "hvc0" >> /etc/securetty && \
-  echo "ttyS0::respawn:/sbin/getty -L ttyS0 115200 vt100" >> /etc/inittab && \
-  echo "hvc0::respawn:/sbin/getty -L hvc0 115200 vt100" >> /etc/inittab && \
-  echo > /etc/modules && \
-  passwd -d "root" root && \
-  \
-  # Create rootfs
-  cd / && \
-  tar cvzf /initrd.tar.gz bin dev etc home init lib mnt opt root sbin usr var
diff --git a/automation/tests-artifacts/alpine/3.19-arm64v8.dockerfile b/automation/tests-artifacts/alpine/3.19-arm64v8.dockerfile
new file mode 100644
index 000000000000..68a5831bca72
--- /dev/null
+++ b/automation/tests-artifacts/alpine/3.19-arm64v8.dockerfile
@@ -0,0 +1,65 @@
+FROM --platform=linux/arm64/v8 alpine:3.19
+LABEL maintainer.name="The Xen Project" \
+      maintainer.email="xen-devel@lists.xenproject.org"
+
+ENV USER root
+
+RUN mkdir /build
+WORKDIR /build
+
+RUN \
+  # apk
+  apk update && \
+  \
+  # xen runtime deps
+  apk add musl && \
+  apk add openrc && \
+  apk add busybox && \
+  apk add sudo && \
+  apk add dbus && \
+  apk add bash && \
+  apk add python3 && \
+  apk add zlib && \
+  apk add ncurses && \
+  apk add yajl && \
+  apk add libaio && \
+  apk add xz && \
+  apk add util-linux && \
+  apk add argp-standalone && \
+  apk add libfdt && \
+  apk add glib && \
+  apk add pixman && \
+  apk add curl && \
+  apk add udev && \
+  \
+  # Xen
+  cd / && \
+  # Minimal ramdisk environment in case of cpio output
+  rc-update add udev && \
+  rc-update add udev-trigger && \
+  rc-update add udev-settle && \
+  rc-update add networking sysinit && \
+  rc-update add loopback sysinit && \
+  rc-update add bootmisc boot && \
+  rc-update add devfs sysinit && \
+  rc-update add dmesg sysinit && \
+  rc-update add hostname boot && \
+  rc-update add hwclock boot && \
+  rc-update add hwdrivers sysinit && \
+  rc-update add killprocs shutdown && \
+  rc-update add modloop sysinit && \
+  rc-update add modules boot && \
+  rc-update add mount-ro shutdown && \
+  rc-update add savecache shutdown && \
+  rc-update add sysctl boot && \
+  rc-update add local default && \
+  cp -a /sbin/init /init && \
+  echo "ttyS0" >> /etc/securetty && \
+  echo "hvc0" >> /etc/securetty && \
+  echo "ttyS0::respawn:/sbin/getty -L ttyS0 115200 vt100" >> /etc/inittab && \
+  echo "hvc0::respawn:/sbin/getty -L hvc0 115200 vt100" >> /etc/inittab && \
+  passwd -d "root" root && \
+  \
+  # Create rootfs
+  cd / && \
+  tar cvzf /initrd.tar.gz bin dev etc home init lib mnt opt root sbin usr var
diff --git a/automation/tests-artifacts/alpine/3.19.dockerfile b/automation/tests-artifacts/alpine/3.19.dockerfile
new file mode 100644
index 000000000000..6d665daedfa4
--- /dev/null
+++ b/automation/tests-artifacts/alpine/3.19.dockerfile
@@ -0,0 +1,67 @@
+FROM --platform=linux/amd64 alpine:3.19
+LABEL maintainer.name="The Xen Project" \
+      maintainer.email="xen-devel@lists.xenproject.org"
+
+ENV USER root
+
+RUN mkdir /build
+WORKDIR /build
+
+RUN \
+  # apk
+  apk update && \
+  \
+  # xen runtime deps
+  apk add musl && \
+  apk add libgcc && \
+  apk add openrc && \
+  apk add busybox && \
+  apk add sudo && \
+  apk add dbus && \
+  apk add bash && \
+  apk add python3 && \
+  apk add zlib && \
+  apk add ncurses && \
+  apk add yajl && \
+  apk add libaio && \
+  apk add xz && \
+  apk add util-linux && \
+  apk add argp-standalone && \
+  apk add libfdt && \
+  apk add glib && \
+  apk add pixman && \
+  apk add curl && \
+  apk add udev && \
+  apk add pciutils && \
+  apk add libelf && \
+  apk add libdw && \
+  \
+  # Xen
+  cd / && \
+  # Minimal ramdisk environment in case of cpio output
+  rc-update add udev && \
+  rc-update add udev-trigger && \
+  rc-update add udev-settle && \
+  rc-update add loopback sysinit && \
+  rc-update add bootmisc boot && \
+  rc-update add devfs sysinit && \
+  rc-update add dmesg sysinit && \
+  rc-update add hostname boot && \
+  rc-update add hwclock boot && \
+  rc-update add hwdrivers sysinit && \
+  rc-update add modules boot && \
+  rc-update add killprocs shutdown && \
+  rc-update add mount-ro shutdown && \
+  rc-update add savecache shutdown && \
+  rc-update add local default && \
+  cp -a /sbin/init /init && \
+  echo "ttyS0" >> /etc/securetty && \
+  echo "hvc0" >> /etc/securetty && \
+  echo "ttyS0::respawn:/sbin/getty -L ttyS0 115200 vt100" >> /etc/inittab && \
+  echo "hvc0::respawn:/sbin/getty -L hvc0 115200 vt100" >> /etc/inittab && \
+  echo > /etc/modules && \
+  passwd -d "root" root && \
+  \
+  # Create rootfs
+  cd / && \
+  tar cvzf /initrd.tar.gz bin dev etc home init lib mnt opt root sbin usr var
-- 
git-series 0.9.1


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

* [PATCH 04/12] automation: increase verbosity of starting a domain
  2024-05-16 13:58 [PATCH 00/12] automation: Add build and test for Linux stubdomain Marek Marczykowski-Górecki
                   ` (2 preceding siblings ...)
  2024-05-16 13:58 ` [PATCH 03/12] automation: switch to alpine:3.19 Marek Marczykowski-Górecki
@ 2024-05-16 13:58 ` Marek Marczykowski-Górecki
  2024-05-17 21:50   ` Stefano Stabellini
  2024-05-16 13:58 ` [PATCH 05/12] automation: prevent grub unpacking initramfs Marek Marczykowski-Górecki
                   ` (7 subsequent siblings)
  11 siblings, 1 reply; 22+ messages in thread
From: Marek Marczykowski-Górecki @ 2024-05-16 13:58 UTC (permalink / raw
  To: xen-devel
  Cc: Marek Marczykowski-Górecki, Doug Goldstein,
	Stefano Stabellini

And start collecting qemu log earlier, so it isn't lost in case of a
timeout during domain startup.

Signed-off-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
---
 automation/scripts/qemu-alpine-x86_64.sh    | 2 +-
 automation/scripts/qemu-smoke-dom0-arm32.sh | 2 +-
 automation/scripts/qemu-smoke-dom0-arm64.sh | 2 +-
 automation/scripts/qubes-x86-64.sh          | 4 ++--
 4 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/automation/scripts/qemu-alpine-x86_64.sh b/automation/scripts/qemu-alpine-x86_64.sh
index 8e398dcea34b..a188d60ea6f3 100755
--- a/automation/scripts/qemu-alpine-x86_64.sh
+++ b/automation/scripts/qemu-alpine-x86_64.sh
@@ -56,7 +56,7 @@ bash /etc/init.d/xencommons start
 
 xl list
 
-xl create -c /root/test.cfg
+xl -vvv create -c /root/test.cfg
 
 " > etc/local.d/xen.start
 chmod +x etc/local.d/xen.start
diff --git a/automation/scripts/qemu-smoke-dom0-arm32.sh b/automation/scripts/qemu-smoke-dom0-arm32.sh
index d91648905669..3d208cd55bfa 100755
--- a/automation/scripts/qemu-smoke-dom0-arm32.sh
+++ b/automation/scripts/qemu-smoke-dom0-arm32.sh
@@ -21,7 +21,7 @@ echo "#!/bin/bash
 
 xl list
 
-xl create -c /root/test.cfg
+xl -vvv create -c /root/test.cfg
 
 " > ./root/xen.start
 echo "bash /root/xen.start" >> ./etc/init.d/xen-watchdog
diff --git a/automation/scripts/qemu-smoke-dom0-arm64.sh b/automation/scripts/qemu-smoke-dom0-arm64.sh
index e0bb37af3610..afc24074eef8 100755
--- a/automation/scripts/qemu-smoke-dom0-arm64.sh
+++ b/automation/scripts/qemu-smoke-dom0-arm64.sh
@@ -52,7 +52,7 @@ bash /etc/init.d/xencommons start
 
 xl list
 
-xl create -c /root/test.cfg
+xl -vvv create -c /root/test.cfg
 
 " > etc/local.d/xen.start
 chmod +x etc/local.d/xen.start
diff --git a/automation/scripts/qubes-x86-64.sh b/automation/scripts/qubes-x86-64.sh
index 4beeff17d31b..bd620b0d9273 100755
--- a/automation/scripts/qubes-x86-64.sh
+++ b/automation/scripts/qubes-x86-64.sh
@@ -112,7 +112,6 @@ echo \"${passed}\"
 "
 
     dom0_check="
-tail -F /var/log/xen/qemu-dm-domU.log &
 until grep -q \"^domU Welcome to Alpine Linux\" /var/log/xen/console/guest-domU.log; do
     sleep 1
 done
@@ -167,7 +166,8 @@ ifconfig xenbr0 192.168.0.1
 
 # get domU console content into test log
 tail -F /var/log/xen/console/guest-domU.log 2>/dev/null | sed -e \"s/^/(domU) /\" &
-xl create /etc/xen/domU.cfg
+tail -F /var/log/xen/qemu-dm-domU.log 2>/dev/null | sed -e \"s/^/(qemu-dm) /\" &
+xl -vvv create /etc/xen/domU.cfg
 ${dom0_check}
 " > etc/local.d/xen.start
 chmod +x etc/local.d/xen.start
-- 
git-series 0.9.1


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

* [PATCH 05/12] automation: prevent grub unpacking initramfs
  2024-05-16 13:58 [PATCH 00/12] automation: Add build and test for Linux stubdomain Marek Marczykowski-Górecki
                   ` (3 preceding siblings ...)
  2024-05-16 13:58 ` [PATCH 04/12] automation: increase verbosity of starting a domain Marek Marczykowski-Górecki
@ 2024-05-16 13:58 ` Marek Marczykowski-Górecki
  2024-05-17 21:51   ` Stefano Stabellini
  2024-05-16 13:58 ` [PATCH 06/12] RFC: automation: Add linux stubdom build and smoke test Marek Marczykowski-Górecki
                   ` (6 subsequent siblings)
  11 siblings, 1 reply; 22+ messages in thread
From: Marek Marczykowski-Górecki @ 2024-05-16 13:58 UTC (permalink / raw
  To: xen-devel
  Cc: Marek Marczykowski-Górecki, Doug Goldstein,
	Stefano Stabellini

It fails on larger initramfs (~250MB one), let Linux do it.

Signed-off-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
---
 automation/scripts/qubes-x86-64.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/automation/scripts/qubes-x86-64.sh b/automation/scripts/qubes-x86-64.sh
index bd620b0d9273..77cb0d45815d 100755
--- a/automation/scripts/qubes-x86-64.sh
+++ b/automation/scripts/qubes-x86-64.sh
@@ -189,7 +189,7 @@ CONTROLLER=control@thor.testnet
 echo "
 multiboot2 (http)/gitlab-ci/xen $CONSOLE_OPTS loglvl=all guest_loglvl=all dom0_mem=4G console_timestamps=boot $extra_xen_opts
 module2 (http)/gitlab-ci/vmlinuz console=hvc0 root=/dev/ram0 earlyprintk=xen
-module2 (http)/gitlab-ci/initrd-dom0
+module2 --nounzip (http)/gitlab-ci/initrd-dom0
 " > $TFTP/grub.cfg
 
 cp -f binaries/xen $TFTP/xen
-- 
git-series 0.9.1


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

* [PATCH 06/12] RFC: automation: Add linux stubdom build and smoke test
  2024-05-16 13:58 [PATCH 00/12] automation: Add build and test for Linux stubdomain Marek Marczykowski-Górecki
                   ` (4 preceding siblings ...)
  2024-05-16 13:58 ` [PATCH 05/12] automation: prevent grub unpacking initramfs Marek Marczykowski-Górecki
@ 2024-05-16 13:58 ` Marek Marczykowski-Górecki
  2024-05-18  0:40   ` Stefano Stabellini
  2024-05-16 13:58 ` [PATCH 07/12] libxl: Allow stubdomain to control interupts of PCI device Marek Marczykowski-Górecki
                   ` (5 subsequent siblings)
  11 siblings, 1 reply; 22+ messages in thread
From: Marek Marczykowski-Górecki @ 2024-05-16 13:58 UTC (permalink / raw
  To: xen-devel
  Cc: Marek Marczykowski-Górecki, Doug Goldstein,
	Stefano Stabellini

Add minimal linux-stubdom smoke test. It starts a simple HVM with
linux-stubdom. The actual stubdom implementation is taken from Qubes OS
and then stripped off Qubes-specific code. In particular, the remaining
code does _not_ support:
 - direct kernel boot (implemented by relaying on specific guest disk
   laying in Qubes OS)
 - graphical console (used Qubes GUI agent injected into
   stubdomain's qemu)
 - audio input/output (used Qubes audio agent inside stubdomain)
 - USB passthrough (used qrexec <-> usbip proxy inside stubdomain)
 - setting up DHCP server (assumes guest addressing used in Qubes OS)

For this smoke test, the relevant part is missing direct kernel boot, as
that's used in other smoke tests. Solve this by preparing disk image
with proper bootloader (grub) installed. Since the test script is
running on arm64 to control x86_64 box, it cannot (easily) install grub
directly. For this reason, prepare bootsector as part of the Xen build
(which runs on x86_64) and then prepend do the disk image during the
test (and adjust partitions table afterwards).

Signed-off-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
---
The test is implemented using hardware runner, because some of the
further tests will require it (for example PCI passthrough with
stubdomain). But if there is strong desire to have stubdomain tested
inside qemu tests (to be included in patchew runs), it is probably an
option for this basic smoke test.

For now I'm keeping stubdomain code (build and glue scripts) in separate
repository on my github account. This is far from ideal. What would be
preferred option? New repository on xenbits? Or add directly into
xen.git (stubdom directory)? Honestly, I'd rather avoid the latter, as
from packager point of view those are mostly separate beings (similar to
qemu, where many use distribution-provide one instead of the one bundled
with Xen) and it's convenient to not need to rebuild stubdomain on every
hypervisor change (like a security patch).

Another topic is QEMU version inside stubdomain. It needs to be a
separate build due to vastly different configure options, so I cannot
reuse the qemu binary built for dom0 (or distribution-provided one if
Xen is configured to use it). But also, at this moment qemu for
stubdomain needs few extra patches that are not upstream yet.
What should be the proper solution here (after upstreaming all the
patches)?

Generally, I try to add tests early, even though there is still some
work to do for proper stubdomain integration into upstream Xen, so any
cleanups and future changes (like the CDROM libxl patches by Jason
Andryuk) can be made with more confidence and reduce risk of
regressions.

The patch is RFC only because of the stubdom repository location.
---
 automation/build/alpine/3.19-arm64v8.dockerfile   |  2 +-
 automation/build/alpine/3.19.dockerfile           |  9 ++-
 automation/gitlab-ci/build.yaml                   |  3 +-
 automation/gitlab-ci/test.yaml                    |  8 +-
 automation/scripts/build                          | 12 ++-
 automation/scripts/qubes-x86-64.sh                | 87 +++++++++++++++-
 automation/tests-artifacts/alpine/3.19.dockerfile |  6 +-
 7 files changed, 123 insertions(+), 4 deletions(-)

diff --git a/automation/build/alpine/3.19-arm64v8.dockerfile b/automation/build/alpine/3.19-arm64v8.dockerfile
index 158cf465a9ff..12810f87ecc6 100644
--- a/automation/build/alpine/3.19-arm64v8.dockerfile
+++ b/automation/build/alpine/3.19-arm64v8.dockerfile
@@ -47,3 +47,5 @@ RUN apk --no-cache add \
   # qubes test deps
   openssh-client \
   fakeroot \
+  sfdisk \
+  e2fsprogs \
diff --git a/automation/build/alpine/3.19.dockerfile b/automation/build/alpine/3.19.dockerfile
index 0be6d7c85fe7..108284613987 100644
--- a/automation/build/alpine/3.19.dockerfile
+++ b/automation/build/alpine/3.19.dockerfile
@@ -49,3 +49,12 @@ RUN apk --no-cache add \
   pixman-dev \
   # livepatch-tools deps
   elfutils-dev \
+  # stubdom deps
+  dracut-core \
+  quilt \
+  gnupg \
+  libseccomp-dev \
+  glib-static \
+  gmp-dev \
+  mpc1-dev \
+  mpfr-dev \
diff --git a/automation/gitlab-ci/build.yaml b/automation/gitlab-ci/build.yaml
index b186289bbd82..783a0687ba34 100644
--- a/automation/gitlab-ci/build.yaml
+++ b/automation/gitlab-ci/build.yaml
@@ -323,9 +323,11 @@ alpine-3.19-rootfs-export:
   image: registry.gitlab.com/xen-project/xen/tests-artifacts/alpine:3.19
   script:
     - mkdir binaries && cp /initrd.tar.gz binaries/initrd.tar.gz
+    - cp /grub-core.img binaries/grub-core.img
   artifacts:
     paths:
       - binaries/initrd.tar.gz
+      - binaries/grub-core.img
   tags:
     - x86_64
 
@@ -353,6 +355,7 @@ alpine-3.19-gcc-debug:
   extends: .gcc-x86-64-build-debug
   variables:
     CONTAINER: alpine:3.19
+    STUBDOM_LINUX: y
 
 debian-stretch-gcc-debug:
   extends: .gcc-x86-64-build-debug
diff --git a/automation/gitlab-ci/test.yaml b/automation/gitlab-ci/test.yaml
index f62d426a8d34..80d10eb7f476 100644
--- a/automation/gitlab-ci/test.yaml
+++ b/automation/gitlab-ci/test.yaml
@@ -199,6 +199,14 @@ adl-pci-hvm-x86-64-gcc-debug:
     - *x86-64-test-needs
     - alpine-3.19-gcc-debug
 
+adl-stubdom-hvm-x86-64-gcc-debug:
+  extends: .adl-x86-64
+  script:
+    - ./automation/scripts/qubes-x86-64.sh stubdom-hvm 2>&1 | tee ${LOGFILE}
+  needs:
+    - *x86-64-test-needs
+    - alpine-3.19-gcc-debug
+
 zen3p-smoke-x86-64-gcc-debug:
   extends: .zen3p-x86-64
   script:
diff --git a/automation/scripts/build b/automation/scripts/build
index b3c71fb6fb60..f7c85b07a8d0 100755
--- a/automation/scripts/build
+++ b/automation/scripts/build
@@ -102,4 +102,16 @@ else
     # build Xen
     cp -r dist binaries/
     if [[ -f xen/xen ]] ; then cp xen/xen binaries/xen; fi
+
+    if [[ "${STUBDOM_LINUX}" == "y" ]]; then
+        git clone https://github.com/marmarek/qubes-vmm-xen-stubdom-linux -b for-upstream2
+        make -j$(nproc) -C qubes-vmm-xen-stubdom-linux get-sources
+        CFLAGS="-I${PWD}/dist/install/usr/local/include" \
+            LDFLAGS="-L${PWD}/dist/install/usr/local/lib" \
+            LD_LIBRARY_PATH="${PWD}/dist/install/usr/local/lib" \
+            PATH="${PWD}/dist/install/usr/local/bin:$PATH" \
+            make -j$(nproc) -C qubes-vmm-xen-stubdom-linux -f Makefile.stubdom all
+        cp qubes-vmm-xen-stubdom-linux/build/linux/arch/x86/boot/bzImage binaries/dist/install/usr/local/lib/xen/boot/qemu-stubdom-linux-kernel
+        cp qubes-vmm-xen-stubdom-linux/build/rootfs/stubdom-linux-rootfs binaries/dist/install/usr/local/lib/xen/boot/qemu-stubdom-linux-rootfs
+    fi
 fi
diff --git a/automation/scripts/qubes-x86-64.sh b/automation/scripts/qubes-x86-64.sh
index 77cb0d45815d..fc73403dbadf 100755
--- a/automation/scripts/qubes-x86-64.sh
+++ b/automation/scripts/qubes-x86-64.sh
@@ -18,6 +18,37 @@ memory = 512
 vif = [ "bridge=xenbr0", ]
 disk = [ ]
 '
+domU_disk_path=
+
+### helper functions
+
+build_domU_disk() {
+    local kernel="$1"
+    local initrd="$2"
+    local rootfs="$3"
+    local output="$4"
+    local grubcfg="$rootfs/boot/grub2/grub.cfg"
+    local kernel_cmdline="root=/dev/xvda1 console=hvc0 earlyprintk=xen"
+
+    mkdir -p "$rootfs/boot/grub2"
+    cp "$kernel" "$rootfs/boot/vmlinuz"
+    echo "linux /boot/vmlinuz $kernel_cmdline" >> "$grubcfg"
+    if [ -n "$initrd" ]; then
+        cp "$initrd" "$rootfs/boot/initrd.img"
+        echo "initrd /boot/initrd.img" >> "$grubcfg"
+    fi
+    echo "boot" >> "$grubcfg"
+    size=$(du -sm "$rootfs")
+    size=${size%%	*}
+    # add 5M margin
+    size=$(( size + 5 ))
+    mke2fs -d "$rootfs" "$output.part1" ${size}m
+    cat "$rootfs/usr/lib/grub/i386-pc/boot_hybrid.img" binaries/grub-core.img > "$output"
+    # align for the partition 1 start (2048 sectors)
+    truncate -s $((2048 * 512)) "$output"
+    cat "$output.part1" >> "$output"
+    echo ",,linux,*" | sfdisk "$output"
+}
 
 ### test: smoke test & smoke test PVH
 if [ -z "${test_variant}" ] || [ "${test_variant}" = "dom0pvh" ]; then
@@ -116,6 +147,41 @@ until grep -q \"^domU Welcome to Alpine Linux\" /var/log/xen/console/guest-domU.
     sleep 1
 done
 "
+
+### test: stubdom-hvm
+elif [ "${test_variant}" = "stubdom-hvm" ]; then
+    passed="ping test passed"
+
+    domU_config='
+type = "hvm"
+name = "domU"
+memory = 512
+vif = [ "bridge=xenbr0", ]
+disk = [ "/srv/disk.img,format=raw,vdev=xvda" ]
+device_model_version = "qemu-xen"
+device_model_stubdomain_override = 1
+on_reboot = "destroy"
+# libxl configures vkb backend to be dom0 instead of the stubdomain, defer
+# changing that until there is consensus what to do about VGA output (VNC)
+vkb_device = 0
+'
+    domU_check="
+ifconfig eth0 192.168.0.2
+until ping -c 10 192.168.0.1; do
+    sleep 1
+done
+echo \"${passed}\"
+"
+    dom0_check="
+set +x
+until grep -q \"${passed}\" /var/log/xen/console/guest-domU.log; do
+    sleep 1
+done
+set -x
+echo \"${passed}\"
+"
+
+    domU_disk_path=/srv/disk.img
 fi
 
 # DomU
@@ -137,8 +203,17 @@ ${domU_check}
 chmod +x etc/local.d/xen.start
 echo "rc_verbose=yes" >> etc/rc.conf
 sed -i -e 's/^Welcome/domU \0/' etc/issue
-find . | fakeroot -i ../fakeroot-save cpio -H newc -o | gzip > ../binaries/domU-rootfs.cpio.gz
 cd ..
+if [ -n "$domU_disk_path" ]; then
+    build_domU_disk \
+        "binaries/bzImage" \
+        "" \
+        "rootfs" \
+        "binaries/disk.img"
+else
+    (cd rootfs; find . | fakeroot -i ../fakeroot-save cpio -H newc -o | gzip > ../binaries/domU-rootfs.cpio.gz)
+fi
+
 rm -rf rootfs
 
 # DOM0 rootfs
@@ -152,6 +227,9 @@ mkdir srv
 mkdir sys
 rm var/run
 cp -ar ../binaries/dist/install/* .
+if [ -n "$domU_disk_path" ]; then
+    cp ../binaries/disk.img "./$domU_disk_path"
+fi
 
 echo "#!/bin/bash
 
@@ -164,8 +242,9 @@ ifconfig eth0 up
 ifconfig xenbr0 up
 ifconfig xenbr0 192.168.0.1
 
-# get domU console content into test log
+# get domU (and possibly its stubdom) console content into test log
 tail -F /var/log/xen/console/guest-domU.log 2>/dev/null | sed -e \"s/^/(domU) /\" &
+tail -F /var/log/xen/console/guest-domU-dm.log 2>/dev/null | sed -e \"s/^/(domU-dm) /\" &
 tail -F /var/log/xen/qemu-dm-domU.log 2>/dev/null | sed -e \"s/^/(qemu-dm) /\" &
 xl -vvv create /etc/xen/domU.cfg
 ${dom0_check}
@@ -178,7 +257,9 @@ echo "XENCONSOLED_TRACE=all" >> etc/default/xencommons
 echo "QEMU_XEN=/bin/false" >> etc/default/xencommons
 mkdir -p var/log/xen/console
 cp ../binaries/bzImage boot/vmlinuz
-cp ../binaries/domU-rootfs.cpio.gz boot/initrd-domU
+if [ -r ../binaries/domU-rootfs.cpio.gz ]; then
+    cp ../binaries/domU-rootfs.cpio.gz boot/initrd-domU
+fi
 find . | fakeroot -i ../fakeroot-save cpio -H newc -o | gzip > ../binaries/dom0-rootfs.cpio.gz
 cd ..
 
diff --git a/automation/tests-artifacts/alpine/3.19.dockerfile b/automation/tests-artifacts/alpine/3.19.dockerfile
index 6d665daedfa4..cfb2cb30fb30 100644
--- a/automation/tests-artifacts/alpine/3.19.dockerfile
+++ b/automation/tests-artifacts/alpine/3.19.dockerfile
@@ -35,6 +35,8 @@ RUN \
   apk add pciutils && \
   apk add libelf && \
   apk add libdw && \
+  apk add grub-bios && \
+  apk add libseccomp && \
   \
   # Xen
   cd / && \
@@ -64,4 +66,6 @@ RUN \
   \
   # Create rootfs
   cd / && \
-  tar cvzf /initrd.tar.gz bin dev etc home init lib mnt opt root sbin usr var
+  tar cvzf /initrd.tar.gz bin dev etc home init lib mnt opt root sbin usr var && \
+  # Prepare boot sector for HVM disk
+  grub-mkimage -o /grub-core.img -O i386-pc -p '(hd0,msdos1)/boot/grub2' boot part_msdos ext2 linux biosdisk configfile normal
-- 
git-series 0.9.1


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

* [PATCH 07/12] libxl: Allow stubdomain to control interupts of PCI device
  2024-05-16 13:58 [PATCH 00/12] automation: Add build and test for Linux stubdomain Marek Marczykowski-Górecki
                   ` (5 preceding siblings ...)
  2024-05-16 13:58 ` [PATCH 06/12] RFC: automation: Add linux stubdom build and smoke test Marek Marczykowski-Górecki
@ 2024-05-16 13:58 ` Marek Marczykowski-Górecki
  2024-05-16 13:58 ` [PATCH 08/12] automation: update kernel for x86 tests Marek Marczykowski-Górecki
                   ` (4 subsequent siblings)
  11 siblings, 0 replies; 22+ messages in thread
From: Marek Marczykowski-Górecki @ 2024-05-16 13:58 UTC (permalink / raw
  To: xen-devel; +Cc: Marek Marczykowski-Górecki, Anthony PERARD, Juergen Gross

Especially allow it to control MSI/MSI-X enabling bits. This part only
writes a flag to a sysfs, the actual implementation is on the kernel
side.

This requires Linux >= 5.10 in dom0 (or relevant patch backported).

Signed-off-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
---
 tools/libs/light/libxl_pci.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/tools/libs/light/libxl_pci.c b/tools/libs/light/libxl_pci.c
index 96cb4da0794e..6f357b70b815 100644
--- a/tools/libs/light/libxl_pci.c
+++ b/tools/libs/light/libxl_pci.c
@@ -1513,6 +1513,14 @@ static void pci_add_dm_done(libxl__egc *egc,
             rc = ERROR_FAIL;
             goto out;
         }
+    } else if (libxl_is_stubdom(ctx, domid, NULL)) {
+        /* Allow acces to MSI enable flag in PCI config space for the stubdom */
+        if ( sysfs_write_bdf(gc, SYSFS_PCIBACK_DRIVER"/allow_interrupt_control",
+                             pci) < 0 ) {
+            LOGD(ERROR, domainid, "Setting allow_interrupt_control for device");
+            rc = ERROR_FAIL;
+            goto out;
+        }
     }
 
 out_no_irq:
-- 
git-series 0.9.1


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

* [PATCH 08/12] automation: update kernel for x86 tests
  2024-05-16 13:58 [PATCH 00/12] automation: Add build and test for Linux stubdomain Marek Marczykowski-Górecki
                   ` (6 preceding siblings ...)
  2024-05-16 13:58 ` [PATCH 07/12] libxl: Allow stubdomain to control interupts of PCI device Marek Marczykowski-Górecki
@ 2024-05-16 13:58 ` Marek Marczykowski-Górecki
  2024-05-17 21:53   ` Stefano Stabellini
  2024-05-16 13:58 ` [PATCH 09/12] WIP: automation: temporarily add 'testlab' tag to stubdomain build Marek Marczykowski-Górecki
                   ` (3 subsequent siblings)
  11 siblings, 1 reply; 22+ messages in thread
From: Marek Marczykowski-Górecki @ 2024-05-16 13:58 UTC (permalink / raw
  To: xen-devel
  Cc: Marek Marczykowski-Górecki, Doug Goldstein,
	Stefano Stabellini

Update 6.1.x kernel to the latest version in this branch. This is
especially needed to include MSI-X related fixes for stubdomain
("xen-pciback: Consider INTx disabled when MSI/MSI-X is enabled").

Signed-off-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
---
 automation/gitlab-ci/build.yaml                     |  4 +-
 automation/gitlab-ci/test.yaml                      |  2 +-
 automation/tests-artifacts/kernel/6.1.19.dockerfile | 40 +--------------
 automation/tests-artifacts/kernel/6.1.90.dockerfile | 40 ++++++++++++++-
 4 files changed, 43 insertions(+), 43 deletions(-)
 delete mode 100644 automation/tests-artifacts/kernel/6.1.19.dockerfile
 create mode 100644 automation/tests-artifacts/kernel/6.1.90.dockerfile

diff --git a/automation/gitlab-ci/build.yaml b/automation/gitlab-ci/build.yaml
index 783a0687ba34..9b9e5464f179 100644
--- a/automation/gitlab-ci/build.yaml
+++ b/automation/gitlab-ci/build.yaml
@@ -331,9 +331,9 @@ alpine-3.19-rootfs-export:
   tags:
     - x86_64
 
-kernel-6.1.19-export:
+kernel-6.1.90-export:
   extends: .test-jobs-artifact-common
-  image: registry.gitlab.com/xen-project/xen/tests-artifacts/kernel:6.1.19
+  image: registry.gitlab.com/xen-project/xen/tests-artifacts/kernel:6.1.90
   script:
     - mkdir binaries && cp /bzImage binaries/bzImage
   artifacts:
diff --git a/automation/gitlab-ci/test.yaml b/automation/gitlab-ci/test.yaml
index 80d10eb7f476..e3910f4c1a9f 100644
--- a/automation/gitlab-ci/test.yaml
+++ b/automation/gitlab-ci/test.yaml
@@ -12,7 +12,7 @@
 
 .x86-64-test-needs: &x86-64-test-needs
   - alpine-3.19-rootfs-export
-  - kernel-6.1.19-export
+  - kernel-6.1.90-export
 
 .qemu-arm64:
   extends: .test-jobs-common
diff --git a/automation/tests-artifacts/kernel/6.1.19.dockerfile b/automation/tests-artifacts/kernel/6.1.19.dockerfile
deleted file mode 100644
index 3a4096780d20..000000000000
--- a/automation/tests-artifacts/kernel/6.1.19.dockerfile
+++ /dev/null
@@ -1,40 +0,0 @@
-FROM --platform=linux/amd64 debian:bookworm
-LABEL maintainer.name="The Xen Project" \
-      maintainer.email="xen-devel@lists.xenproject.org"
-
-ENV DEBIAN_FRONTEND=noninteractive
-ENV LINUX_VERSION=6.1.19
-ENV USER root
-
-RUN mkdir /build
-WORKDIR /build
-
-# build depends
-RUN apt-get update && \
-    apt-get --quiet --yes install \
-        build-essential \
-        libssl-dev \
-        bc \
-        curl \
-        flex \
-        bison \
-        libelf-dev \
-        && \
-    apt-get autoremove -y && \
-    apt-get clean && \
-    rm -rf /var/lib/apt/lists* /tmp/* /var/tmp/*
-
-# Build the kernel
-RUN curl -fsSLO https://cdn.kernel.org/pub/linux/kernel/v6.x/linux-"$LINUX_VERSION".tar.xz && \
-    tar xvJf linux-"$LINUX_VERSION".tar.xz && \
-    cd linux-"$LINUX_VERSION" && \
-    make defconfig && \
-    make xen.config && \
-    scripts/config --enable BRIDGE && \
-    scripts/config --enable IGC && \
-    cp .config .config.orig && \
-    cat .config.orig | grep XEN | grep =m |sed 's/=m/=y/g' >> .config && \
-    make -j$(nproc) bzImage && \
-    cp arch/x86/boot/bzImage / && \
-    cd /build && \
-    rm -rf linux-"$LINUX_VERSION"*
diff --git a/automation/tests-artifacts/kernel/6.1.90.dockerfile b/automation/tests-artifacts/kernel/6.1.90.dockerfile
new file mode 100644
index 000000000000..46cadf02ca78
--- /dev/null
+++ b/automation/tests-artifacts/kernel/6.1.90.dockerfile
@@ -0,0 +1,40 @@
+FROM --platform=linux/amd64 debian:bookworm
+LABEL maintainer.name="The Xen Project" \
+      maintainer.email="xen-devel@lists.xenproject.org"
+
+ENV DEBIAN_FRONTEND=noninteractive
+ENV LINUX_VERSION=6.1.90
+ENV USER root
+
+RUN mkdir /build
+WORKDIR /build
+
+# build depends
+RUN apt-get update && \
+    apt-get --quiet --yes install \
+        build-essential \
+        libssl-dev \
+        bc \
+        curl \
+        flex \
+        bison \
+        libelf-dev \
+        && \
+    apt-get autoremove -y && \
+    apt-get clean && \
+    rm -rf /var/lib/apt/lists* /tmp/* /var/tmp/*
+
+# Build the kernel
+RUN curl -fsSLO https://cdn.kernel.org/pub/linux/kernel/v6.x/linux-"$LINUX_VERSION".tar.xz && \
+    tar xvJf linux-"$LINUX_VERSION".tar.xz && \
+    cd linux-"$LINUX_VERSION" && \
+    make defconfig && \
+    make xen.config && \
+    scripts/config --enable BRIDGE && \
+    scripts/config --enable IGC && \
+    cp .config .config.orig && \
+    cat .config.orig | grep XEN | grep =m |sed 's/=m/=y/g' >> .config && \
+    make -j$(nproc) bzImage && \
+    cp arch/x86/boot/bzImage / && \
+    cd /build && \
+    rm -rf linux-"$LINUX_VERSION"*
-- 
git-series 0.9.1


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

* [PATCH 09/12] WIP: automation: temporarily add 'testlab' tag to stubdomain build
  2024-05-16 13:58 [PATCH 00/12] automation: Add build and test for Linux stubdomain Marek Marczykowski-Górecki
                   ` (7 preceding siblings ...)
  2024-05-16 13:58 ` [PATCH 08/12] automation: update kernel for x86 tests Marek Marczykowski-Górecki
@ 2024-05-16 13:58 ` Marek Marczykowski-Górecki
  2024-05-16 13:58 ` [PATCH 10/12] automation: stubdom test with PCI passthrough Marek Marczykowski-Górecki
                   ` (2 subsequent siblings)
  11 siblings, 0 replies; 22+ messages in thread
From: Marek Marczykowski-Górecki @ 2024-05-16 13:58 UTC (permalink / raw
  To: xen-devel
  Cc: Marek Marczykowski-Górecki, Doug Goldstein,
	Stefano Stabellini

Make it run on newer runners that have new enough kernel for
dracut-install.

Signed-off-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
---
 automation/gitlab-ci/build.yaml | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/automation/gitlab-ci/build.yaml b/automation/gitlab-ci/build.yaml
index 9b9e5464f179..134a01d03efa 100644
--- a/automation/gitlab-ci/build.yaml
+++ b/automation/gitlab-ci/build.yaml
@@ -356,6 +356,9 @@ alpine-3.19-gcc-debug:
   variables:
     CONTAINER: alpine:3.19
     STUBDOM_LINUX: y
+  tags:
+  - x86_64
+  - testlab
 
 debian-stretch-gcc-debug:
   extends: .gcc-x86-64-build-debug
-- 
git-series 0.9.1


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

* [PATCH 10/12] automation: stubdom test with PCI passthrough
  2024-05-16 13:58 [PATCH 00/12] automation: Add build and test for Linux stubdomain Marek Marczykowski-Górecki
                   ` (8 preceding siblings ...)
  2024-05-16 13:58 ` [PATCH 09/12] WIP: automation: temporarily add 'testlab' tag to stubdomain build Marek Marczykowski-Górecki
@ 2024-05-16 13:58 ` Marek Marczykowski-Górecki
  2024-05-18  0:41   ` Stefano Stabellini
  2024-05-16 13:58 ` [PATCH 11/12] automation: stubdom test with boot from CDROM Marek Marczykowski-Górecki
  2024-05-16 13:58 ` [PATCH 12/12] [DO NOT MERGE] switch to my containers fork Marek Marczykowski-Górecki
  11 siblings, 1 reply; 22+ messages in thread
From: Marek Marczykowski-Górecki @ 2024-05-16 13:58 UTC (permalink / raw
  To: xen-devel
  Cc: Marek Marczykowski-Górecki, Doug Goldstein,
	Stefano Stabellini

Based on the initial stubdomain test and existing PCI passthrough tests,
add one that combines both.
Schedule it on the AMD runner, as it has less tests right now.

Signed-off-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
---
 automation/gitlab-ci/test.yaml     |  8 ++++++++
 automation/scripts/qubes-x86-64.sh | 30 +++++++++++++++++++++++++-----
 2 files changed, 33 insertions(+), 5 deletions(-)

diff --git a/automation/gitlab-ci/test.yaml b/automation/gitlab-ci/test.yaml
index e3910f4c1a9f..76cc430ae00f 100644
--- a/automation/gitlab-ci/test.yaml
+++ b/automation/gitlab-ci/test.yaml
@@ -231,6 +231,14 @@ zen3p-pci-hvm-x86-64-gcc-debug:
     - *x86-64-test-needs
     - alpine-3.19-gcc-debug
 
+zen3p-pci-stubdom-x86-64-gcc-debug:
+  extends: .zen3p-x86-64
+  script:
+    - ./automation/scripts/qubes-x86-64.sh pci-stubdom 2>&1 | tee ${LOGFILE}
+  needs:
+    - *x86-64-test-needs
+    - alpine-3.19-gcc-debug
+
 qemu-smoke-dom0-arm64-gcc:
   extends: .qemu-arm64
   script:
diff --git a/automation/scripts/qubes-x86-64.sh b/automation/scripts/qubes-x86-64.sh
index fc73403dbadf..816c16fbab3e 100755
--- a/automation/scripts/qubes-x86-64.sh
+++ b/automation/scripts/qubes-x86-64.sh
@@ -98,8 +98,8 @@ ping -c 10 192.168.0.2 || exit 1
 echo \"${passed}\"
 "
 
-### test: pci-pv, pci-hvm
-elif [ "${test_variant}" = "pci-pv" ] || [ "${test_variant}" = "pci-hvm" ]; then
+### test: pci-pv, pci-hvm, pci-stubdom
+elif [ "${test_variant}" = "pci-pv" ] || [ "${test_variant}" = "pci-hvm" ] || [ "${test_variant}" = "pci-stubdom" ]; then
 
     if [ -z "$PCIDEV" ]; then
         echo "Please set 'PCIDEV' variable with BDF of test network adapter" >&2
@@ -109,15 +109,35 @@ elif [ "${test_variant}" = "pci-pv" ] || [ "${test_variant}" = "pci-hvm" ]; then
 
     passed="pci test passed"
 
-    domU_config='
+    domain_type="${test_variant#pci-}"
+    if [ "$test_variant" = "pci-stubdom" ]; then
+        domain_type="hvm"
+        domU_config='
+type = "hvm"
+disk = [ "/srv/disk.img,format=raw,vdev=xvda" ]
+device_model_version = "qemu-xen"
+device_model_stubdomain_override = 1
+on_reboot = "destroy"
+# libxl configures vkb backend to be dom0 instead of the stubdomain, defer
+# changing that until there is consensus what to do about VGA output (VNC)
+vkb_device = 0
+'
+        domU_disk_path=/srv/disk.img
+    else
+        domU_config='
 type = "'${test_variant#pci-}'"
-name = "domU"
 kernel = "/boot/vmlinuz"
 ramdisk = "/boot/initrd-domU"
 extra = "root=/dev/ram0 console=hvc0 earlyprintk=xen"
+disk = [ ]
+'
+    fi
+
+    # common part
+    domU_config="$domU_config"'
+name = "domU"
 memory = 512
 vif = [ ]
-disk = [ ]
 pci = [ "'$PCIDEV',seize=1" ]
 on_reboot = "destroy"
 '
-- 
git-series 0.9.1


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

* [PATCH 11/12] automation: stubdom test with boot from CDROM
  2024-05-16 13:58 [PATCH 00/12] automation: Add build and test for Linux stubdomain Marek Marczykowski-Górecki
                   ` (9 preceding siblings ...)
  2024-05-16 13:58 ` [PATCH 10/12] automation: stubdom test with PCI passthrough Marek Marczykowski-Górecki
@ 2024-05-16 13:58 ` Marek Marczykowski-Górecki
  2024-05-16 13:58 ` [PATCH 12/12] [DO NOT MERGE] switch to my containers fork Marek Marczykowski-Górecki
  11 siblings, 0 replies; 22+ messages in thread
From: Marek Marczykowski-Górecki @ 2024-05-16 13:58 UTC (permalink / raw
  To: xen-devel
  Cc: Marek Marczykowski-Górecki, Doug Goldstein,
	Stefano Stabellini

Based on the initial stubdomain test add booting from CDOM. It's
significantly different in terms of emulated devices (contrary to PV
disk, the cdrom is backed by qemu), so test that path too.
Schedule it on the AMD runner, as it has less tests right now.

Signed-off-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
---
 automation/build/alpine/3.19-arm64v8.dockerfile   |  1 +-
 automation/gitlab-ci/build.yaml                   |  2 +-
 automation/gitlab-ci/test.yaml                    |  8 ++-
 automation/scripts/qubes-x86-64.sh                | 58 +++++++++++-----
 automation/tests-artifacts/alpine/3.19.dockerfile |  3 +-
 5 files changed, 56 insertions(+), 16 deletions(-)

diff --git a/automation/build/alpine/3.19-arm64v8.dockerfile b/automation/build/alpine/3.19-arm64v8.dockerfile
index 12810f87ecc6..03a3f28ff686 100644
--- a/automation/build/alpine/3.19-arm64v8.dockerfile
+++ b/automation/build/alpine/3.19-arm64v8.dockerfile
@@ -49,3 +49,4 @@ RUN apk --no-cache add \
   fakeroot \
   sfdisk \
   e2fsprogs \
+  xorriso \
diff --git a/automation/gitlab-ci/build.yaml b/automation/gitlab-ci/build.yaml
index 134a01d03efa..f1e6a6144c90 100644
--- a/automation/gitlab-ci/build.yaml
+++ b/automation/gitlab-ci/build.yaml
@@ -324,10 +324,12 @@ alpine-3.19-rootfs-export:
   script:
     - mkdir binaries && cp /initrd.tar.gz binaries/initrd.tar.gz
     - cp /grub-core.img binaries/grub-core.img
+    - cp /grub-core-eltorito.img binaries/grub-core-eltorito.img
   artifacts:
     paths:
       - binaries/initrd.tar.gz
       - binaries/grub-core.img
+      - binaries/grub-core-eltorito.img
   tags:
     - x86_64
 
diff --git a/automation/gitlab-ci/test.yaml b/automation/gitlab-ci/test.yaml
index 76cc430ae00f..4e4dca91c26e 100644
--- a/automation/gitlab-ci/test.yaml
+++ b/automation/gitlab-ci/test.yaml
@@ -239,6 +239,14 @@ zen3p-pci-stubdom-x86-64-gcc-debug:
     - *x86-64-test-needs
     - alpine-3.19-gcc-debug
 
+zen3p-stubdom-hvm-cdboot-x86-64-gcc-debug:
+  extends: .zen3p-x86-64
+  script:
+    - ./automation/scripts/qubes-x86-64.sh stubdom-hvm-cdboot 2>&1 | tee ${LOGFILE}
+  needs:
+    - *x86-64-test-needs
+    - alpine-3.19-gcc-debug
+
 qemu-smoke-dom0-arm64-gcc:
   extends: .qemu-arm64
   script:
diff --git a/automation/scripts/qubes-x86-64.sh b/automation/scripts/qubes-x86-64.sh
index 816c16fbab3e..b4f5c846ffe3 100755
--- a/automation/scripts/qubes-x86-64.sh
+++ b/automation/scripts/qubes-x86-64.sh
@@ -19,6 +19,7 @@ vif = [ "bridge=xenbr0", ]
 disk = [ ]
 '
 domU_disk_path=
+domU_disk_type=disk
 
 ### helper functions
 
@@ -27,27 +28,47 @@ build_domU_disk() {
     local initrd="$2"
     local rootfs="$3"
     local output="$4"
+    local img_type="$5"
     local grubcfg="$rootfs/boot/grub2/grub.cfg"
-    local kernel_cmdline="root=/dev/xvda1 console=hvc0 earlyprintk=xen"
+    local kernel_cmdline
 
     mkdir -p "$rootfs/boot/grub2"
     cp "$kernel" "$rootfs/boot/vmlinuz"
+    if [ "$img_type" = "disk" ]; then
+        kernel_cmdline="root=/dev/xvda1 console=hvc0 earlyprintk=xen"
+    elif [ "$img_type" = "cdrom" ]; then
+        kernel_cmdline="root=/dev/sr0 console=hvc0 earlyprintk=xen"
+    fi
     echo "linux /boot/vmlinuz $kernel_cmdline" >> "$grubcfg"
     if [ -n "$initrd" ]; then
         cp "$initrd" "$rootfs/boot/initrd.img"
         echo "initrd /boot/initrd.img" >> "$grubcfg"
     fi
     echo "boot" >> "$grubcfg"
-    size=$(du -sm "$rootfs")
-    size=${size%%	*}
-    # add 5M margin
-    size=$(( size + 5 ))
-    mke2fs -d "$rootfs" "$output.part1" ${size}m
-    cat "$rootfs/usr/lib/grub/i386-pc/boot_hybrid.img" binaries/grub-core.img > "$output"
-    # align for the partition 1 start (2048 sectors)
-    truncate -s $((2048 * 512)) "$output"
-    cat "$output.part1" >> "$output"
-    echo ",,linux,*" | sfdisk "$output"
+    if [ "$img_type" = "disk" ]; then
+        size=$(du -sm "$rootfs")
+        size=${size%%	*}
+        # add 5M margin
+        size=$(( size + 5 ))
+        mke2fs -d "$rootfs" "$output.part1" ${size}m
+        cat "$rootfs/usr/lib/grub/i386-pc/boot_hybrid.img" binaries/grub-core.img > "$output"
+        # align for the partition 1 start (2048 sectors)
+        truncate -s $((2048 * 512)) "$output"
+        cat "$output.part1" >> "$output"
+        echo ",,linux,*" | sfdisk "$output"
+    elif [ "$img_type" = "cdrom" ]; then
+        cp binaries/grub-core-eltorito.img "$rootfs/boot/"
+        xorriso -as mkisofs \
+            -o "$output" \
+            -b boot/grub-core-eltorito.img \
+            -no-emul-boot \
+            -boot-load-size 4 \
+            -boot-info-table \
+            "$rootfs"
+    else
+        echo "Invalid img_type: $img_type" >&2
+        return 1
+    fi
 }
 
 ### test: smoke test & smoke test PVH
@@ -168,16 +189,22 @@ until grep -q \"^domU Welcome to Alpine Linux\" /var/log/xen/console/guest-domU.
 done
 "
 
-### test: stubdom-hvm
-elif [ "${test_variant}" = "stubdom-hvm" ]; then
+### test: stubdom-hvm, stubdom-hvm-cdboot
+elif [ "${test_variant}" = "stubdom-hvm" ] || [ "${test_variant}" = "stubdom-hvm-cdboot" ] ; then
     passed="ping test passed"
 
+    disk_opts=
+    if [ "${test_variant}" = "stubdom-hvm-cdboot" ]; then
+        disk_opts=",devtype=cdrom"
+        domU_disk_type="cdrom"
+    fi
+
     domU_config='
 type = "hvm"
 name = "domU"
 memory = 512
 vif = [ "bridge=xenbr0", ]
-disk = [ "/srv/disk.img,format=raw,vdev=xvda" ]
+disk = [ "/srv/disk.img,format=raw,vdev=xvda'"$disk_opts"'" ]
 device_model_version = "qemu-xen"
 device_model_stubdomain_override = 1
 on_reboot = "destroy"
@@ -229,7 +256,8 @@ if [ -n "$domU_disk_path" ]; then
         "binaries/bzImage" \
         "" \
         "rootfs" \
-        "binaries/disk.img"
+        "binaries/disk.img" \
+        "$domU_disk_type"
 else
     (cd rootfs; find . | fakeroot -i ../fakeroot-save cpio -H newc -o | gzip > ../binaries/domU-rootfs.cpio.gz)
 fi
diff --git a/automation/tests-artifacts/alpine/3.19.dockerfile b/automation/tests-artifacts/alpine/3.19.dockerfile
index cfb2cb30fb30..7632b694c3da 100644
--- a/automation/tests-artifacts/alpine/3.19.dockerfile
+++ b/automation/tests-artifacts/alpine/3.19.dockerfile
@@ -68,4 +68,5 @@ RUN \
   cd / && \
   tar cvzf /initrd.tar.gz bin dev etc home init lib mnt opt root sbin usr var && \
   # Prepare boot sector for HVM disk
-  grub-mkimage -o /grub-core.img -O i386-pc -p '(hd0,msdos1)/boot/grub2' boot part_msdos ext2 linux biosdisk configfile normal
+  grub-mkimage -o /grub-core.img -O i386-pc -p '(hd0,msdos1)/boot/grub2' boot part_msdos ext2 linux biosdisk configfile normal && \
+  grub-mkimage -o /grub-core-eltorito.img -O i386-pc-eltorito -p '(cd)/boot/grub2' boot part_msdos ext2 linux biosdisk configfile normal iso9660
-- 
git-series 0.9.1


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

* [PATCH 12/12] [DO NOT MERGE] switch to my containers fork
  2024-05-16 13:58 [PATCH 00/12] automation: Add build and test for Linux stubdomain Marek Marczykowski-Górecki
                   ` (10 preceding siblings ...)
  2024-05-16 13:58 ` [PATCH 11/12] automation: stubdom test with boot from CDROM Marek Marczykowski-Górecki
@ 2024-05-16 13:58 ` Marek Marczykowski-Górecki
  11 siblings, 0 replies; 22+ messages in thread
From: Marek Marczykowski-Górecki @ 2024-05-16 13:58 UTC (permalink / raw
  To: xen-devel
  Cc: Marek Marczykowski-Górecki, Doug Goldstein,
	Stefano Stabellini

---
 automation/gitlab-ci/build.yaml | 19 ++++++++++++++++---
 automation/gitlab-ci/test.yaml  |  9 ++++++++-
 2 files changed, 24 insertions(+), 4 deletions(-)

diff --git a/automation/gitlab-ci/build.yaml b/automation/gitlab-ci/build.yaml
index f1e6a6144c90..88a59692a881 100644
--- a/automation/gitlab-ci/build.yaml
+++ b/automation/gitlab-ci/build.yaml
@@ -260,7 +260,7 @@
 
 alpine-3.19-arm64-rootfs-export:
   extends: .test-jobs-artifact-common
-  image: registry.gitlab.com/xen-project/xen/tests-artifacts/alpine:3.19-arm64v8
+  image: registry.gitlab.com/xen-project/people/marmarek/xen/tests-artifacts/alpine:3.19-arm64v8
   script:
     - mkdir binaries && cp /initrd.tar.gz binaries/initrd.tar.gz
   artifacts:
@@ -320,7 +320,7 @@ qemu-system-ppc64-8.1.0-ppc64-export:
 
 alpine-3.19-rootfs-export:
   extends: .test-jobs-artifact-common
-  image: registry.gitlab.com/xen-project/xen/tests-artifacts/alpine:3.19
+  image: registry.gitlab.com/xen-project/people/marmarek/xen/tests-artifacts/alpine:3.19
   script:
     - mkdir binaries && cp /initrd.tar.gz binaries/initrd.tar.gz
     - cp /grub-core.img binaries/grub-core.img
@@ -335,7 +335,7 @@ alpine-3.19-rootfs-export:
 
 kernel-6.1.90-export:
   extends: .test-jobs-artifact-common
-  image: registry.gitlab.com/xen-project/xen/tests-artifacts/kernel:6.1.90
+  image: registry.gitlab.com/xen-project/people/marmarek/xen/tests-artifacts/kernel:6.1.90
   script:
     - mkdir binaries && cp /bzImage binaries/bzImage
   artifacts:
@@ -350,11 +350,13 @@ kernel-6.1.90-export:
 
 alpine-3.19-gcc:
   extends: .gcc-x86-64-build
+  image: registry.gitlab.com/xen-project/people/marmarek/xen/${CONTAINER}
   variables:
     CONTAINER: alpine:3.19
 
 alpine-3.19-gcc-debug:
   extends: .gcc-x86-64-build-debug
+  image: registry.gitlab.com/xen-project/people/marmarek/xen/${CONTAINER}
   variables:
     CONTAINER: alpine:3.19
     STUBDOM_LINUX: y
@@ -445,28 +447,33 @@ debian-bookworm-gcc-debug-arm64-randconfig:
 
 alpine-3.19-gcc-arm64:
   extends: .gcc-arm64-build
+  image: registry.gitlab.com/xen-project/people/marmarek/xen/${CONTAINER}
   variables:
     CONTAINER: alpine:3.19-arm64v8
 
 alpine-3.19-gcc-debug-arm64:
   extends: .gcc-arm64-build-debug
+  image: registry.gitlab.com/xen-project/people/marmarek/xen/${CONTAINER}
   variables:
     CONTAINER: alpine:3.19-arm64v8
 
 alpine-3.19-gcc-arm64-randconfig:
   extends: .gcc-arm64-build
+  image: registry.gitlab.com/xen-project/people/marmarek/xen/${CONTAINER}
   variables:
     CONTAINER: alpine:3.19-arm64v8
     RANDCONFIG: y
 
 alpine-3.19-gcc-debug-arm64-randconfig:
   extends: .gcc-arm64-build-debug
+  image: registry.gitlab.com/xen-project/people/marmarek/xen/${CONTAINER}
   variables:
     CONTAINER: alpine:3.19-arm64v8
     RANDCONFIG: y
 
 alpine-3.19-gcc-debug-arm64-staticmem:
   extends: .gcc-arm64-build-debug
+  image: registry.gitlab.com/xen-project/people/marmarek/xen/${CONTAINER}
   variables:
     CONTAINER: alpine:3.19-arm64v8
     EXTRA_XEN_CONFIG: |
@@ -476,6 +483,7 @@ alpine-3.19-gcc-debug-arm64-staticmem:
 
 alpine-3.19-gcc-debug-arm64-static-shared-mem:
   extends: .gcc-arm64-build-debug
+  image: registry.gitlab.com/xen-project/people/marmarek/xen/${CONTAINER}
   variables:
     CONTAINER: alpine:3.19-arm64v8
     EXTRA_XEN_CONFIG: |
@@ -485,6 +493,7 @@ alpine-3.19-gcc-debug-arm64-static-shared-mem:
 
 alpine-3.19-gcc-debug-arm64-boot-cpupools:
   extends: .gcc-arm64-build-debug
+  image: registry.gitlab.com/xen-project/people/marmarek/xen/${CONTAINER}
   variables:
     CONTAINER: alpine:3.19-arm64v8
     EXTRA_XEN_CONFIG: |
@@ -598,11 +607,13 @@ debian-bookworm-gcc-arm64-cppcheck:
 
 alpine-3.19-clang:
   extends: .clang-x86-64-build
+  image: registry.gitlab.com/xen-project/people/marmarek/xen/${CONTAINER}
   variables:
     CONTAINER: alpine:3.19
 
 alpine-3.19-clang-debug:
   extends: .clang-x86-64-build-debug
+  image: registry.gitlab.com/xen-project/people/marmarek/xen/${CONTAINER}
   variables:
     CONTAINER: alpine:3.19
 
@@ -698,11 +709,13 @@ debian-bookworm-32-gcc-debug:
 
 fedora-gcc:
   extends: .gcc-x86-64-build
+  image: registry.gitlab.com/xen-project/people/marmarek/xen/${CONTAINER}
   variables:
     CONTAINER: fedora:39
 
 fedora-gcc-debug:
   extends: .gcc-x86-64-build-debug
+  image: registry.gitlab.com/xen-project/people/marmarek/xen/${CONTAINER}
   variables:
     CONTAINER: fedora:39
 
diff --git a/automation/gitlab-ci/test.yaml b/automation/gitlab-ci/test.yaml
index 4e4dca91c26e..0f36036d8275 100644
--- a/automation/gitlab-ci/test.yaml
+++ b/automation/gitlab-ci/test.yaml
@@ -1,6 +1,6 @@
 .test-jobs-common:
   stage: test
-  image: registry.gitlab.com/xen-project/xen/${CONTAINER}
+  image: registry.gitlab.com/xen-project/people/marmarek/xen/${CONTAINER}
 
 .arm64-test-needs: &arm64-test-needs
   - alpine-3.19-arm64-rootfs-export
@@ -16,6 +16,7 @@
 
 .qemu-arm64:
   extends: .test-jobs-common
+  image: registry.gitlab.com/xen-project/xen/${CONTAINER}
   variables:
     CONTAINER: debian:bookworm-arm64v8
     LOGFILE: qemu-smoke-arm64.log
@@ -29,6 +30,7 @@
 
 .qemu-arm32:
   extends: .test-jobs-common
+  image: registry.gitlab.com/xen-project/xen/${CONTAINER}
   variables:
     CONTAINER: debian:bookworm-arm64v8
     LOGFILE: qemu-smoke-arm32.log
@@ -42,6 +44,7 @@
 
 .qemu-x86-64:
   extends: .test-jobs-common
+  image: registry.gitlab.com/xen-project/xen/${CONTAINER}
   variables:
     CONTAINER: debian:bookworm
     LOGFILE: qemu-smoke-x86-64.log
@@ -55,6 +58,7 @@
 
 .qemu-riscv64:
   extends: .test-jobs-common
+  image: registry.gitlab.com/xen-project/xen/${CONTAINER}
   variables:
     CONTAINER: archlinux:current-riscv64
     LOGFILE: qemu-smoke-riscv64.log
@@ -68,6 +72,7 @@
 
 .qemu-ppc64le:
   extends: .test-jobs-common
+  image: registry.gitlab.com/xen-project/xen/${CONTAINER}
   variables:
     CONTAINER: debian:bullseye-ppc64le
     LOGFILE: qemu-smoke-ppc64le.log
@@ -81,6 +86,7 @@
 
 .xilinx-arm64:
   extends: .test-jobs-common
+  image: registry.gitlab.com/xen-project/xen/${CONTAINER}
   variables:
     CONTAINER: ubuntu:xenial-xilinx
     LOGFILE: qemu-smoke-xilinx.log
@@ -129,6 +135,7 @@
 # Test jobs
 build-each-commit-gcc:
   extends: .test-jobs-common
+  image: registry.gitlab.com/xen-project/xen/${CONTAINER}
   variables:
     CONTAINER: debian:bookworm
     XEN_TARGET_ARCH: x86_64
-- 
git-series 0.9.1


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

* Re: [PATCH 01/12] automation: include domU kernel messages in the console output log
  2024-05-16 13:58 ` [PATCH 01/12] automation: include domU kernel messages in the console output log Marek Marczykowski-Górecki
@ 2024-05-17 20:57   ` Stefano Stabellini
  0 siblings, 0 replies; 22+ messages in thread
From: Stefano Stabellini @ 2024-05-17 20:57 UTC (permalink / raw
  To: Marek Marczykowski-Górecki
  Cc: xen-devel, Doug Goldstein, Stefano Stabellini

[-- Attachment #1: Type: text/plain, Size: 711 bytes --]

On Thu, 16 May 2024, Marek Marczykowski-Górecki wrote:
> Signed-off-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>

Acked-by: Stefano Stabellini <sstabellini@kernel.org>

> ---
>  automation/scripts/qubes-x86-64.sh | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/automation/scripts/qubes-x86-64.sh b/automation/scripts/qubes-x86-64.sh
> index d81ed7b931cf..4beeff17d31b 100755
> --- a/automation/scripts/qubes-x86-64.sh
> +++ b/automation/scripts/qubes-x86-64.sh
> @@ -131,6 +131,8 @@ mkdir sys
>  rm var/run
>  echo "#!/bin/sh
>  
> +echo 8 > /proc/sys/kernel/printk
> +
>  ${domU_check}
>  " > etc/local.d/xen.start
>  chmod +x etc/local.d/xen.start
> -- 
> git-series 0.9.1
> 

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

* Re: [PATCH 02/12] automation: update fedora build to F39
  2024-05-16 13:58 ` [PATCH 02/12] automation: update fedora build to F39 Marek Marczykowski-Górecki
@ 2024-05-17 20:57   ` Stefano Stabellini
  0 siblings, 0 replies; 22+ messages in thread
From: Stefano Stabellini @ 2024-05-17 20:57 UTC (permalink / raw
  To: Marek Marczykowski-Górecki
  Cc: xen-devel, Doug Goldstein, Stefano Stabellini

[-- Attachment #1: Type: text/plain, Size: 3847 bytes --]

On Thu, 16 May 2024, Marek Marczykowski-Górecki wrote:
> Fedora 29 is long EOL
> 
> Signed-off-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>

Acked-by: Stefano Stabellini <sstabellini@kernel.org>

> ---
>  automation/build/fedora/29.dockerfile | 46 +----------------------------
>  automation/build/fedora/39.dockerfile | 46 ++++++++++++++++++++++++++++-
>  automation/gitlab-ci/build.yaml       |  4 +-
>  3 files changed, 48 insertions(+), 48 deletions(-)
>  delete mode 100644 automation/build/fedora/29.dockerfile
>  create mode 100644 automation/build/fedora/39.dockerfile
> 
> diff --git a/automation/build/fedora/29.dockerfile b/automation/build/fedora/29.dockerfile
> deleted file mode 100644
> index f473ae13e7c1..000000000000
> --- a/automation/build/fedora/29.dockerfile
> +++ /dev/null
> @@ -1,46 +0,0 @@
> -FROM --platform=linux/amd64 fedora:29
> -LABEL maintainer.name="The Xen Project" \
> -      maintainer.email="xen-devel@lists.xenproject.org"
> -
> -# install Xen depends
> -RUN dnf -y install \
> -        clang \
> -        gcc \
> -        gcc-c++ \
> -        ncurses-devel \
> -        zlib-devel \
> -        openssl-devel \
> -        python-devel \
> -        python3-devel \
> -        libuuid-devel \
> -        pkgconfig \
> -        flex \
> -        bison \
> -        libaio-devel \
> -        glib2-devel \
> -        yajl-devel \
> -        pixman-devel \
> -        glibc-devel \
> -        make \
> -        binutils \
> -        git \
> -        wget \
> -        acpica-tools \
> -        python-markdown \
> -        patch \
> -        checkpolicy \
> -        dev86 \
> -        xz-devel \
> -        bzip2 \
> -        nasm \
> -        ocaml \
> -        ocaml-findlib \
> -        golang \
> -        # QEMU
> -        ninja-build \
> -    && dnf clean all && \
> -    rm -rf /var/cache/dnf
> -
> -RUN useradd --create-home user
> -USER user
> -WORKDIR /build
> diff --git a/automation/build/fedora/39.dockerfile b/automation/build/fedora/39.dockerfile
> new file mode 100644
> index 000000000000..054f73444060
> --- /dev/null
> +++ b/automation/build/fedora/39.dockerfile
> @@ -0,0 +1,46 @@
> +FROM --platform=linux/amd64 fedora:39
> +LABEL maintainer.name="The Xen Project" \
> +      maintainer.email="xen-devel@lists.xenproject.org"
> +
> +# install Xen depends
> +RUN dnf -y install \
> +        clang \
> +        gcc \
> +        gcc-c++ \
> +        ncurses-devel \
> +        zlib-devel \
> +        openssl-devel \
> +        python-devel \
> +        python3-devel \
> +        libuuid-devel \
> +        pkgconfig \
> +        flex \
> +        bison \
> +        libaio-devel \
> +        glib2-devel \
> +        yajl-devel \
> +        pixman-devel \
> +        glibc-devel \
> +        make \
> +        binutils \
> +        git \
> +        wget \
> +        acpica-tools \
> +        python-markdown \
> +        patch \
> +        checkpolicy \
> +        dev86 \
> +        xz-devel \
> +        bzip2 \
> +        nasm \
> +        ocaml \
> +        ocaml-findlib \
> +        golang \
> +        # QEMU
> +        ninja-build \
> +    && dnf clean all && \
> +    rm -rf /var/cache/dnf
> +
> +RUN useradd --create-home user
> +USER user
> +WORKDIR /build
> diff --git a/automation/gitlab-ci/build.yaml b/automation/gitlab-ci/build.yaml
> index 49d6265ad5b4..69665ec5b11f 100644
> --- a/automation/gitlab-ci/build.yaml
> +++ b/automation/gitlab-ci/build.yaml
> @@ -691,12 +691,12 @@ debian-bookworm-32-gcc-debug:
>  fedora-gcc:
>    extends: .gcc-x86-64-build
>    variables:
> -    CONTAINER: fedora:29
> +    CONTAINER: fedora:39
>  
>  fedora-gcc-debug:
>    extends: .gcc-x86-64-build-debug
>    variables:
> -    CONTAINER: fedora:29
> +    CONTAINER: fedora:39
>  
>  # Ubuntu Trusty's Clang is 3.4 while Xen requires 3.5
>  
> -- 
> git-series 0.9.1
> 

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

* Re: [PATCH 04/12] automation: increase verbosity of starting a domain
  2024-05-16 13:58 ` [PATCH 04/12] automation: increase verbosity of starting a domain Marek Marczykowski-Górecki
@ 2024-05-17 21:50   ` Stefano Stabellini
  0 siblings, 0 replies; 22+ messages in thread
From: Stefano Stabellini @ 2024-05-17 21:50 UTC (permalink / raw
  To: Marek Marczykowski-Górecki
  Cc: xen-devel, Doug Goldstein, Stefano Stabellini

[-- Attachment #1: Type: text/plain, Size: 2830 bytes --]

On Thu, 16 May 2024, Marek Marczykowski-Górecki wrote:
> And start collecting qemu log earlier, so it isn't lost in case of a
> timeout during domain startup.
> 
> Signed-off-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>

Acked-by: Stefano Stabellini <sstabellini@kernel.org>


> ---
>  automation/scripts/qemu-alpine-x86_64.sh    | 2 +-
>  automation/scripts/qemu-smoke-dom0-arm32.sh | 2 +-
>  automation/scripts/qemu-smoke-dom0-arm64.sh | 2 +-
>  automation/scripts/qubes-x86-64.sh          | 4 ++--
>  4 files changed, 5 insertions(+), 5 deletions(-)
> 
> diff --git a/automation/scripts/qemu-alpine-x86_64.sh b/automation/scripts/qemu-alpine-x86_64.sh
> index 8e398dcea34b..a188d60ea6f3 100755
> --- a/automation/scripts/qemu-alpine-x86_64.sh
> +++ b/automation/scripts/qemu-alpine-x86_64.sh
> @@ -56,7 +56,7 @@ bash /etc/init.d/xencommons start
>  
>  xl list
>  
> -xl create -c /root/test.cfg
> +xl -vvv create -c /root/test.cfg
>  
>  " > etc/local.d/xen.start
>  chmod +x etc/local.d/xen.start
> diff --git a/automation/scripts/qemu-smoke-dom0-arm32.sh b/automation/scripts/qemu-smoke-dom0-arm32.sh
> index d91648905669..3d208cd55bfa 100755
> --- a/automation/scripts/qemu-smoke-dom0-arm32.sh
> +++ b/automation/scripts/qemu-smoke-dom0-arm32.sh
> @@ -21,7 +21,7 @@ echo "#!/bin/bash
>  
>  xl list
>  
> -xl create -c /root/test.cfg
> +xl -vvv create -c /root/test.cfg
>  
>  " > ./root/xen.start
>  echo "bash /root/xen.start" >> ./etc/init.d/xen-watchdog
> diff --git a/automation/scripts/qemu-smoke-dom0-arm64.sh b/automation/scripts/qemu-smoke-dom0-arm64.sh
> index e0bb37af3610..afc24074eef8 100755
> --- a/automation/scripts/qemu-smoke-dom0-arm64.sh
> +++ b/automation/scripts/qemu-smoke-dom0-arm64.sh
> @@ -52,7 +52,7 @@ bash /etc/init.d/xencommons start
>  
>  xl list
>  
> -xl create -c /root/test.cfg
> +xl -vvv create -c /root/test.cfg
>  
>  " > etc/local.d/xen.start
>  chmod +x etc/local.d/xen.start
> diff --git a/automation/scripts/qubes-x86-64.sh b/automation/scripts/qubes-x86-64.sh
> index 4beeff17d31b..bd620b0d9273 100755
> --- a/automation/scripts/qubes-x86-64.sh
> +++ b/automation/scripts/qubes-x86-64.sh
> @@ -112,7 +112,6 @@ echo \"${passed}\"
>  "
>  
>      dom0_check="
> -tail -F /var/log/xen/qemu-dm-domU.log &
>  until grep -q \"^domU Welcome to Alpine Linux\" /var/log/xen/console/guest-domU.log; do
>      sleep 1
>  done
> @@ -167,7 +166,8 @@ ifconfig xenbr0 192.168.0.1
>  
>  # get domU console content into test log
>  tail -F /var/log/xen/console/guest-domU.log 2>/dev/null | sed -e \"s/^/(domU) /\" &
> -xl create /etc/xen/domU.cfg
> +tail -F /var/log/xen/qemu-dm-domU.log 2>/dev/null | sed -e \"s/^/(qemu-dm) /\" &
> +xl -vvv create /etc/xen/domU.cfg
>  ${dom0_check}
>  " > etc/local.d/xen.start
>  chmod +x etc/local.d/xen.start
> -- 
> git-series 0.9.1
> 

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

* Re: [PATCH 05/12] automation: prevent grub unpacking initramfs
  2024-05-16 13:58 ` [PATCH 05/12] automation: prevent grub unpacking initramfs Marek Marczykowski-Górecki
@ 2024-05-17 21:51   ` Stefano Stabellini
  0 siblings, 0 replies; 22+ messages in thread
From: Stefano Stabellini @ 2024-05-17 21:51 UTC (permalink / raw
  To: Marek Marczykowski-Górecki
  Cc: xen-devel, Doug Goldstein, Stefano Stabellini

[-- Attachment #1: Type: text/plain, Size: 1023 bytes --]

On Thu, 16 May 2024, Marek Marczykowski-Górecki wrote:
> It fails on larger initramfs (~250MB one), let Linux do it.
> 
> Signed-off-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>

Acked-by: Stefano Stabellini <sstabellini@kernel.org>


> ---
>  automation/scripts/qubes-x86-64.sh | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/automation/scripts/qubes-x86-64.sh b/automation/scripts/qubes-x86-64.sh
> index bd620b0d9273..77cb0d45815d 100755
> --- a/automation/scripts/qubes-x86-64.sh
> +++ b/automation/scripts/qubes-x86-64.sh
> @@ -189,7 +189,7 @@ CONTROLLER=control@thor.testnet
>  echo "
>  multiboot2 (http)/gitlab-ci/xen $CONSOLE_OPTS loglvl=all guest_loglvl=all dom0_mem=4G console_timestamps=boot $extra_xen_opts
>  module2 (http)/gitlab-ci/vmlinuz console=hvc0 root=/dev/ram0 earlyprintk=xen
> -module2 (http)/gitlab-ci/initrd-dom0
> +module2 --nounzip (http)/gitlab-ci/initrd-dom0
>  " > $TFTP/grub.cfg
>  
>  cp -f binaries/xen $TFTP/xen
> -- 
> git-series 0.9.1
> 

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

* Re: [PATCH 08/12] automation: update kernel for x86 tests
  2024-05-16 13:58 ` [PATCH 08/12] automation: update kernel for x86 tests Marek Marczykowski-Górecki
@ 2024-05-17 21:53   ` Stefano Stabellini
  0 siblings, 0 replies; 22+ messages in thread
From: Stefano Stabellini @ 2024-05-17 21:53 UTC (permalink / raw
  To: Marek Marczykowski-Górecki
  Cc: xen-devel, Doug Goldstein, Stefano Stabellini

[-- Attachment #1: Type: text/plain, Size: 4982 bytes --]

On Thu, 16 May 2024, Marek Marczykowski-Górecki wrote:
> Update 6.1.x kernel to the latest version in this branch. This is
> especially needed to include MSI-X related fixes for stubdomain
> ("xen-pciback: Consider INTx disabled when MSI/MSI-X is enabled").
> 
> Signed-off-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>

Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>


> ---
>  automation/gitlab-ci/build.yaml                     |  4 +-
>  automation/gitlab-ci/test.yaml                      |  2 +-
>  automation/tests-artifacts/kernel/6.1.19.dockerfile | 40 +--------------
>  automation/tests-artifacts/kernel/6.1.90.dockerfile | 40 ++++++++++++++-
>  4 files changed, 43 insertions(+), 43 deletions(-)
>  delete mode 100644 automation/tests-artifacts/kernel/6.1.19.dockerfile
>  create mode 100644 automation/tests-artifacts/kernel/6.1.90.dockerfile
> 
> diff --git a/automation/gitlab-ci/build.yaml b/automation/gitlab-ci/build.yaml
> index 783a0687ba34..9b9e5464f179 100644
> --- a/automation/gitlab-ci/build.yaml
> +++ b/automation/gitlab-ci/build.yaml
> @@ -331,9 +331,9 @@ alpine-3.19-rootfs-export:
>    tags:
>      - x86_64
>  
> -kernel-6.1.19-export:
> +kernel-6.1.90-export:
>    extends: .test-jobs-artifact-common
> -  image: registry.gitlab.com/xen-project/xen/tests-artifacts/kernel:6.1.19
> +  image: registry.gitlab.com/xen-project/xen/tests-artifacts/kernel:6.1.90
>    script:
>      - mkdir binaries && cp /bzImage binaries/bzImage
>    artifacts:
> diff --git a/automation/gitlab-ci/test.yaml b/automation/gitlab-ci/test.yaml
> index 80d10eb7f476..e3910f4c1a9f 100644
> --- a/automation/gitlab-ci/test.yaml
> +++ b/automation/gitlab-ci/test.yaml
> @@ -12,7 +12,7 @@
>  
>  .x86-64-test-needs: &x86-64-test-needs
>    - alpine-3.19-rootfs-export
> -  - kernel-6.1.19-export
> +  - kernel-6.1.90-export
>  
>  .qemu-arm64:
>    extends: .test-jobs-common
> diff --git a/automation/tests-artifacts/kernel/6.1.19.dockerfile b/automation/tests-artifacts/kernel/6.1.19.dockerfile
> deleted file mode 100644
> index 3a4096780d20..000000000000
> --- a/automation/tests-artifacts/kernel/6.1.19.dockerfile
> +++ /dev/null
> @@ -1,40 +0,0 @@
> -FROM --platform=linux/amd64 debian:bookworm
> -LABEL maintainer.name="The Xen Project" \
> -      maintainer.email="xen-devel@lists.xenproject.org"
> -
> -ENV DEBIAN_FRONTEND=noninteractive
> -ENV LINUX_VERSION=6.1.19
> -ENV USER root
> -
> -RUN mkdir /build
> -WORKDIR /build
> -
> -# build depends
> -RUN apt-get update && \
> -    apt-get --quiet --yes install \
> -        build-essential \
> -        libssl-dev \
> -        bc \
> -        curl \
> -        flex \
> -        bison \
> -        libelf-dev \
> -        && \
> -    apt-get autoremove -y && \
> -    apt-get clean && \
> -    rm -rf /var/lib/apt/lists* /tmp/* /var/tmp/*
> -
> -# Build the kernel
> -RUN curl -fsSLO https://cdn.kernel.org/pub/linux/kernel/v6.x/linux-"$LINUX_VERSION".tar.xz && \
> -    tar xvJf linux-"$LINUX_VERSION".tar.xz && \
> -    cd linux-"$LINUX_VERSION" && \
> -    make defconfig && \
> -    make xen.config && \
> -    scripts/config --enable BRIDGE && \
> -    scripts/config --enable IGC && \
> -    cp .config .config.orig && \
> -    cat .config.orig | grep XEN | grep =m |sed 's/=m/=y/g' >> .config && \
> -    make -j$(nproc) bzImage && \
> -    cp arch/x86/boot/bzImage / && \
> -    cd /build && \
> -    rm -rf linux-"$LINUX_VERSION"*
> diff --git a/automation/tests-artifacts/kernel/6.1.90.dockerfile b/automation/tests-artifacts/kernel/6.1.90.dockerfile
> new file mode 100644
> index 000000000000..46cadf02ca78
> --- /dev/null
> +++ b/automation/tests-artifacts/kernel/6.1.90.dockerfile
> @@ -0,0 +1,40 @@
> +FROM --platform=linux/amd64 debian:bookworm
> +LABEL maintainer.name="The Xen Project" \
> +      maintainer.email="xen-devel@lists.xenproject.org"
> +
> +ENV DEBIAN_FRONTEND=noninteractive
> +ENV LINUX_VERSION=6.1.90
> +ENV USER root
> +
> +RUN mkdir /build
> +WORKDIR /build
> +
> +# build depends
> +RUN apt-get update && \
> +    apt-get --quiet --yes install \
> +        build-essential \
> +        libssl-dev \
> +        bc \
> +        curl \
> +        flex \
> +        bison \
> +        libelf-dev \
> +        && \
> +    apt-get autoremove -y && \
> +    apt-get clean && \
> +    rm -rf /var/lib/apt/lists* /tmp/* /var/tmp/*
> +
> +# Build the kernel
> +RUN curl -fsSLO https://cdn.kernel.org/pub/linux/kernel/v6.x/linux-"$LINUX_VERSION".tar.xz && \
> +    tar xvJf linux-"$LINUX_VERSION".tar.xz && \
> +    cd linux-"$LINUX_VERSION" && \
> +    make defconfig && \
> +    make xen.config && \
> +    scripts/config --enable BRIDGE && \
> +    scripts/config --enable IGC && \
> +    cp .config .config.orig && \
> +    cat .config.orig | grep XEN | grep =m |sed 's/=m/=y/g' >> .config && \
> +    make -j$(nproc) bzImage && \
> +    cp arch/x86/boot/bzImage / && \
> +    cd /build && \
> +    rm -rf linux-"$LINUX_VERSION"*
> -- 
> git-series 0.9.1
> 

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

* Re: [PATCH 03/12] automation: switch to alpine:3.19
  2024-05-16 13:58 ` [PATCH 03/12] automation: switch to alpine:3.19 Marek Marczykowski-Górecki
@ 2024-05-17 21:58   ` Stefano Stabellini
  0 siblings, 0 replies; 22+ messages in thread
From: Stefano Stabellini @ 2024-05-17 21:58 UTC (permalink / raw
  To: Marek Marczykowski-Górecki
  Cc: xen-devel, Doug Goldstein, Stefano Stabellini

[-- Attachment #1: Type: text/plain, Size: 635 bytes --]

On Thu, 16 May 2024, Marek Marczykowski-Górecki wrote:
> Alpine 3.19 is needed for upcoming stubdomain tests, as linux stubdomain
> build requires dracut-core package (dracut-install tool specifically)
> which isn't available in 3.18. While technically it will be needed only
> in the x86_64 builds, switch Alpine version everywhere for uniformity.
> Note this bumps kernel version requirement on docker runners -
> dracut-install uses faccessat2() syscall which was introduced in Linux
> 5.8.
> 
> Signed-off-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>

Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>

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

* Re: [PATCH 06/12] RFC: automation: Add linux stubdom build and smoke test
  2024-05-16 13:58 ` [PATCH 06/12] RFC: automation: Add linux stubdom build and smoke test Marek Marczykowski-Górecki
@ 2024-05-18  0:40   ` Stefano Stabellini
  2024-05-18  1:28     ` Marek Marczykowski-Górecki
  0 siblings, 1 reply; 22+ messages in thread
From: Stefano Stabellini @ 2024-05-18  0:40 UTC (permalink / raw
  To: Marek Marczykowski-Górecki
  Cc: xen-devel, Doug Goldstein, Stefano Stabellini

[-- Attachment #1: Type: text/plain, Size: 13344 bytes --]

On Thu, 16 May 2024, Marek Marczykowski-Górecki wrote:
> Add minimal linux-stubdom smoke test. It starts a simple HVM with
> linux-stubdom. The actual stubdom implementation is taken from Qubes OS
> and then stripped off Qubes-specific code. In particular, the remaining
> code does _not_ support:
>  - direct kernel boot (implemented by relaying on specific guest disk
>    laying in Qubes OS)
>  - graphical console (used Qubes GUI agent injected into
>    stubdomain's qemu)
>  - audio input/output (used Qubes audio agent inside stubdomain)
>  - USB passthrough (used qrexec <-> usbip proxy inside stubdomain)
>  - setting up DHCP server (assumes guest addressing used in Qubes OS)
> 
> For this smoke test, the relevant part is missing direct kernel boot, as
> that's used in other smoke tests. Solve this by preparing disk image
> with proper bootloader (grub) installed. Since the test script is
> running on arm64 to control x86_64 box, it cannot (easily) install grub
> directly. For this reason, prepare bootsector as part of the Xen build
> (which runs on x86_64) and then prepend do the disk image during the
> test (and adjust partitions table afterwards).

I am not an expert on this, but do you think it would be possible to use
network boot and tftp instead of grub on emulated disk? That would not
require us to build neither /grub-core.img nor build_domU_disk().

I am trying to avoid grub-core.img and disk.img because I think direct
kernel boot or network boot are easier to maintain and more similar to
the other tests. If you see the ARM tests, they all use tftp boot.


> Signed-off-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
> ---
> The test is implemented using hardware runner, because some of the
> further tests will require it (for example PCI passthrough with
> stubdomain). But if there is strong desire to have stubdomain tested
> inside qemu tests (to be included in patchew runs), it is probably an
> option for this basic smoke test.

Thanks for this amazing work. This is a great start, we can see how to
create more tests after merging this one.


> For now I'm keeping stubdomain code (build and glue scripts) in separate
> repository on my github account. This is far from ideal. What would be
> preferred option? New repository on xenbits? Or add directly into
> xen.git (stubdom directory)? Honestly, I'd rather avoid the latter, as
> from packager point of view those are mostly separate beings (similar to
> qemu, where many use distribution-provide one instead of the one bundled
> with Xen) and it's convenient to not need to rebuild stubdomain on every
> hypervisor change (like a security patch).

My suggestion is to create repositories under gitlab.com/xen-project


> Another topic is QEMU version inside stubdomain. It needs to be a
> separate build due to vastly different configure options, so I cannot
> reuse the qemu binary built for dom0 (or distribution-provided one if
> Xen is configured to use it). But also, at this moment qemu for
> stubdomain needs few extra patches that are not upstream yet.
> What should be the proper solution here (after upstreaming all the
> patches)?

It is fine to use a different QEMU version. For now, I would suggest to
keep the QEMU patches as patches to be applied, in the new repositories
under gitlab.com/xen-project


> Generally, I try to add tests early, even though there is still some
> work to do for proper stubdomain integration into upstream Xen, so any
> cleanups and future changes (like the CDROM libxl patches by Jason
> Andryuk) can be made with more confidence and reduce risk of
> regressions.
> 
> The patch is RFC only because of the stubdom repository location.
> ---
>  automation/build/alpine/3.19-arm64v8.dockerfile   |  2 +-
>  automation/build/alpine/3.19.dockerfile           |  9 ++-
>  automation/gitlab-ci/build.yaml                   |  3 +-
>  automation/gitlab-ci/test.yaml                    |  8 +-
>  automation/scripts/build                          | 12 ++-
>  automation/scripts/qubes-x86-64.sh                | 87 +++++++++++++++-
>  automation/tests-artifacts/alpine/3.19.dockerfile |  6 +-
>  7 files changed, 123 insertions(+), 4 deletions(-)
> 
> diff --git a/automation/build/alpine/3.19-arm64v8.dockerfile b/automation/build/alpine/3.19-arm64v8.dockerfile
> index 158cf465a9ff..12810f87ecc6 100644
> --- a/automation/build/alpine/3.19-arm64v8.dockerfile
> +++ b/automation/build/alpine/3.19-arm64v8.dockerfile
> @@ -47,3 +47,5 @@ RUN apk --no-cache add \
>    # qubes test deps
>    openssh-client \
>    fakeroot \
> +  sfdisk \
> +  e2fsprogs \
> diff --git a/automation/build/alpine/3.19.dockerfile b/automation/build/alpine/3.19.dockerfile
> index 0be6d7c85fe7..108284613987 100644
> --- a/automation/build/alpine/3.19.dockerfile
> +++ b/automation/build/alpine/3.19.dockerfile
> @@ -49,3 +49,12 @@ RUN apk --no-cache add \
>    pixman-dev \
>    # livepatch-tools deps
>    elfutils-dev \
> +  # stubdom deps
> +  dracut-core \
> +  quilt \
> +  gnupg \
> +  libseccomp-dev \
> +  glib-static \
> +  gmp-dev \
> +  mpc1-dev \
> +  mpfr-dev \
> diff --git a/automation/gitlab-ci/build.yaml b/automation/gitlab-ci/build.yaml
> index b186289bbd82..783a0687ba34 100644
> --- a/automation/gitlab-ci/build.yaml
> +++ b/automation/gitlab-ci/build.yaml
> @@ -323,9 +323,11 @@ alpine-3.19-rootfs-export:
>    image: registry.gitlab.com/xen-project/xen/tests-artifacts/alpine:3.19
>    script:
>      - mkdir binaries && cp /initrd.tar.gz binaries/initrd.tar.gz
> +    - cp /grub-core.img binaries/grub-core.img
>    artifacts:
>      paths:
>        - binaries/initrd.tar.gz
> +      - binaries/grub-core.img
>    tags:
>      - x86_64
>  
> @@ -353,6 +355,7 @@ alpine-3.19-gcc-debug:
>    extends: .gcc-x86-64-build-debug
>    variables:
>      CONTAINER: alpine:3.19
> +    STUBDOM_LINUX: y
>  
>  debian-stretch-gcc-debug:
>    extends: .gcc-x86-64-build-debug
> diff --git a/automation/gitlab-ci/test.yaml b/automation/gitlab-ci/test.yaml
> index f62d426a8d34..80d10eb7f476 100644
> --- a/automation/gitlab-ci/test.yaml
> +++ b/automation/gitlab-ci/test.yaml
> @@ -199,6 +199,14 @@ adl-pci-hvm-x86-64-gcc-debug:
>      - *x86-64-test-needs
>      - alpine-3.19-gcc-debug
>  
> +adl-stubdom-hvm-x86-64-gcc-debug:
> +  extends: .adl-x86-64
> +  script:
> +    - ./automation/scripts/qubes-x86-64.sh stubdom-hvm 2>&1 | tee ${LOGFILE}
> +  needs:
> +    - *x86-64-test-needs
> +    - alpine-3.19-gcc-debug
> +
>  zen3p-smoke-x86-64-gcc-debug:
>    extends: .zen3p-x86-64
>    script:
> diff --git a/automation/scripts/build b/automation/scripts/build
> index b3c71fb6fb60..f7c85b07a8d0 100755
> --- a/automation/scripts/build
> +++ b/automation/scripts/build
> @@ -102,4 +102,16 @@ else
>      # build Xen
>      cp -r dist binaries/
>      if [[ -f xen/xen ]] ; then cp xen/xen binaries/xen; fi
> +
> +    if [[ "${STUBDOM_LINUX}" == "y" ]]; then
> +        git clone https://github.com/marmarek/qubes-vmm-xen-stubdom-linux -b for-upstream2
> +        make -j$(nproc) -C qubes-vmm-xen-stubdom-linux get-sources
> +        CFLAGS="-I${PWD}/dist/install/usr/local/include" \
> +            LDFLAGS="-L${PWD}/dist/install/usr/local/lib" \
> +            LD_LIBRARY_PATH="${PWD}/dist/install/usr/local/lib" \
> +            PATH="${PWD}/dist/install/usr/local/bin:$PATH" \
> +            make -j$(nproc) -C qubes-vmm-xen-stubdom-linux -f Makefile.stubdom all
> +        cp qubes-vmm-xen-stubdom-linux/build/linux/arch/x86/boot/bzImage binaries/dist/install/usr/local/lib/xen/boot/qemu-stubdom-linux-kernel
> +        cp qubes-vmm-xen-stubdom-linux/build/rootfs/stubdom-linux-rootfs binaries/dist/install/usr/local/lib/xen/boot/qemu-stubdom-linux-rootfs
> +    fi

I think qemu-stubdom-linux-kernel and qemu-stubdom-linux-rootfs should
be built as test-artifacts if they are not strictly dependent on the Xen
version.

Otherwise, please create a separate new build job for linux stubdoms (do
not reuse alpine-3.19-gcc-debug). Also I would prefer if these build
instructions were on a separate file, separate from "build".


>  fi
> diff --git a/automation/scripts/qubes-x86-64.sh b/automation/scripts/qubes-x86-64.sh
> index 77cb0d45815d..fc73403dbadf 100755
> --- a/automation/scripts/qubes-x86-64.sh
> +++ b/automation/scripts/qubes-x86-64.sh
> @@ -18,6 +18,37 @@ memory = 512
>  vif = [ "bridge=xenbr0", ]
>  disk = [ ]
>  '
> +domU_disk_path=
> +
> +### helper functions
> +
> +build_domU_disk() {
> +    local kernel="$1"
> +    local initrd="$2"
> +    local rootfs="$3"
> +    local output="$4"
> +    local grubcfg="$rootfs/boot/grub2/grub.cfg"
> +    local kernel_cmdline="root=/dev/xvda1 console=hvc0 earlyprintk=xen"
> +
> +    mkdir -p "$rootfs/boot/grub2"
> +    cp "$kernel" "$rootfs/boot/vmlinuz"
> +    echo "linux /boot/vmlinuz $kernel_cmdline" >> "$grubcfg"
> +    if [ -n "$initrd" ]; then
> +        cp "$initrd" "$rootfs/boot/initrd.img"
> +        echo "initrd /boot/initrd.img" >> "$grubcfg"
> +    fi
> +    echo "boot" >> "$grubcfg"
> +    size=$(du -sm "$rootfs")
> +    size=${size%%	*}
> +    # add 5M margin
> +    size=$(( size + 5 ))
> +    mke2fs -d "$rootfs" "$output.part1" ${size}m
> +    cat "$rootfs/usr/lib/grub/i386-pc/boot_hybrid.img" binaries/grub-core.img > "$output"
> +    # align for the partition 1 start (2048 sectors)
> +    truncate -s $((2048 * 512)) "$output"
> +    cat "$output.part1" >> "$output"
> +    echo ",,linux,*" | sfdisk "$output"
> +}
>  
>  ### test: smoke test & smoke test PVH
>  if [ -z "${test_variant}" ] || [ "${test_variant}" = "dom0pvh" ]; then
> @@ -116,6 +147,41 @@ until grep -q \"^domU Welcome to Alpine Linux\" /var/log/xen/console/guest-domU.
>      sleep 1
>  done
>  "
> +
> +### test: stubdom-hvm
> +elif [ "${test_variant}" = "stubdom-hvm" ]; then
> +    passed="ping test passed"
> +
> +    domU_config='
> +type = "hvm"
> +name = "domU"
> +memory = 512
> +vif = [ "bridge=xenbr0", ]
> +disk = [ "/srv/disk.img,format=raw,vdev=xvda" ]
> +device_model_version = "qemu-xen"
> +device_model_stubdomain_override = 1
> +on_reboot = "destroy"
> +# libxl configures vkb backend to be dom0 instead of the stubdomain, defer
> +# changing that until there is consensus what to do about VGA output (VNC)
> +vkb_device = 0
> +'
> +    domU_check="
> +ifconfig eth0 192.168.0.2
> +until ping -c 10 192.168.0.1; do
> +    sleep 1
> +done
> +echo \"${passed}\"
> +"
> +    dom0_check="
> +set +x
> +until grep -q \"${passed}\" /var/log/xen/console/guest-domU.log; do
> +    sleep 1
> +done
> +set -x
> +echo \"${passed}\"
> +"
> +
> +    domU_disk_path=/srv/disk.img
>  fi
>  
>  # DomU
> @@ -137,8 +203,17 @@ ${domU_check}
>  chmod +x etc/local.d/xen.start
>  echo "rc_verbose=yes" >> etc/rc.conf
>  sed -i -e 's/^Welcome/domU \0/' etc/issue
> -find . | fakeroot -i ../fakeroot-save cpio -H newc -o | gzip > ../binaries/domU-rootfs.cpio.gz
>  cd ..
> +if [ -n "$domU_disk_path" ]; then
> +    build_domU_disk \
> +        "binaries/bzImage" \
> +        "" \
> +        "rootfs" \
> +        "binaries/disk.img"
> +else
> +    (cd rootfs; find . | fakeroot -i ../fakeroot-save cpio -H newc -o | gzip > ../binaries/domU-rootfs.cpio.gz)
> +fi
> +
>  rm -rf rootfs
>  
>  # DOM0 rootfs
> @@ -152,6 +227,9 @@ mkdir srv
>  mkdir sys
>  rm var/run
>  cp -ar ../binaries/dist/install/* .
> +if [ -n "$domU_disk_path" ]; then
> +    cp ../binaries/disk.img "./$domU_disk_path"
> +fi
>  
>  echo "#!/bin/bash
>  
> @@ -164,8 +242,9 @@ ifconfig eth0 up
>  ifconfig xenbr0 up
>  ifconfig xenbr0 192.168.0.1
>  
> -# get domU console content into test log
> +# get domU (and possibly its stubdom) console content into test log
>  tail -F /var/log/xen/console/guest-domU.log 2>/dev/null | sed -e \"s/^/(domU) /\" &
> +tail -F /var/log/xen/console/guest-domU-dm.log 2>/dev/null | sed -e \"s/^/(domU-dm) /\" &
>  tail -F /var/log/xen/qemu-dm-domU.log 2>/dev/null | sed -e \"s/^/(qemu-dm) /\" &
>  xl -vvv create /etc/xen/domU.cfg
>  ${dom0_check}
> @@ -178,7 +257,9 @@ echo "XENCONSOLED_TRACE=all" >> etc/default/xencommons
>  echo "QEMU_XEN=/bin/false" >> etc/default/xencommons
>  mkdir -p var/log/xen/console
>  cp ../binaries/bzImage boot/vmlinuz
> -cp ../binaries/domU-rootfs.cpio.gz boot/initrd-domU
> +if [ -r ../binaries/domU-rootfs.cpio.gz ]; then
> +    cp ../binaries/domU-rootfs.cpio.gz boot/initrd-domU
> +fi
>  find . | fakeroot -i ../fakeroot-save cpio -H newc -o | gzip > ../binaries/dom0-rootfs.cpio.gz
>  cd ..
>  
> diff --git a/automation/tests-artifacts/alpine/3.19.dockerfile b/automation/tests-artifacts/alpine/3.19.dockerfile
> index 6d665daedfa4..cfb2cb30fb30 100644
> --- a/automation/tests-artifacts/alpine/3.19.dockerfile
> +++ b/automation/tests-artifacts/alpine/3.19.dockerfile
> @@ -35,6 +35,8 @@ RUN \
>    apk add pciutils && \
>    apk add libelf && \
>    apk add libdw && \
> +  apk add grub-bios && \
> +  apk add libseccomp && \
>    \
>    # Xen
>    cd / && \
> @@ -64,4 +66,6 @@ RUN \
>    \
>    # Create rootfs
>    cd / && \
> -  tar cvzf /initrd.tar.gz bin dev etc home init lib mnt opt root sbin usr var
> +  tar cvzf /initrd.tar.gz bin dev etc home init lib mnt opt root sbin usr var && \
> +  # Prepare boot sector for HVM disk
> +  grub-mkimage -o /grub-core.img -O i386-pc -p '(hd0,msdos1)/boot/grub2' boot part_msdos ext2 linux biosdisk configfile normal
> -- 
> git-series 0.9.1
> 

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

* Re: [PATCH 10/12] automation: stubdom test with PCI passthrough
  2024-05-16 13:58 ` [PATCH 10/12] automation: stubdom test with PCI passthrough Marek Marczykowski-Górecki
@ 2024-05-18  0:41   ` Stefano Stabellini
  0 siblings, 0 replies; 22+ messages in thread
From: Stefano Stabellini @ 2024-05-18  0:41 UTC (permalink / raw
  To: Marek Marczykowski-Górecki
  Cc: xen-devel, Doug Goldstein, Stefano Stabellini

[-- Attachment #1: Type: text/plain, Size: 3090 bytes --]

On Thu, 16 May 2024, Marek Marczykowski-Górecki wrote:
> Based on the initial stubdomain test and existing PCI passthrough tests,
> add one that combines both.
> Schedule it on the AMD runner, as it has less tests right now.
> 
> Signed-off-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>

With the caveat that if we do tftp boot this might have to change:

Acked-by: Stefano Stabellini <sstabellini@kernel.org>


> ---
>  automation/gitlab-ci/test.yaml     |  8 ++++++++
>  automation/scripts/qubes-x86-64.sh | 30 +++++++++++++++++++++++++-----
>  2 files changed, 33 insertions(+), 5 deletions(-)
> 
> diff --git a/automation/gitlab-ci/test.yaml b/automation/gitlab-ci/test.yaml
> index e3910f4c1a9f..76cc430ae00f 100644
> --- a/automation/gitlab-ci/test.yaml
> +++ b/automation/gitlab-ci/test.yaml
> @@ -231,6 +231,14 @@ zen3p-pci-hvm-x86-64-gcc-debug:
>      - *x86-64-test-needs
>      - alpine-3.19-gcc-debug
>  
> +zen3p-pci-stubdom-x86-64-gcc-debug:
> +  extends: .zen3p-x86-64
> +  script:
> +    - ./automation/scripts/qubes-x86-64.sh pci-stubdom 2>&1 | tee ${LOGFILE}
> +  needs:
> +    - *x86-64-test-needs
> +    - alpine-3.19-gcc-debug
> +
>  qemu-smoke-dom0-arm64-gcc:
>    extends: .qemu-arm64
>    script:
> diff --git a/automation/scripts/qubes-x86-64.sh b/automation/scripts/qubes-x86-64.sh
> index fc73403dbadf..816c16fbab3e 100755
> --- a/automation/scripts/qubes-x86-64.sh
> +++ b/automation/scripts/qubes-x86-64.sh
> @@ -98,8 +98,8 @@ ping -c 10 192.168.0.2 || exit 1
>  echo \"${passed}\"
>  "
>  
> -### test: pci-pv, pci-hvm
> -elif [ "${test_variant}" = "pci-pv" ] || [ "${test_variant}" = "pci-hvm" ]; then
> +### test: pci-pv, pci-hvm, pci-stubdom
> +elif [ "${test_variant}" = "pci-pv" ] || [ "${test_variant}" = "pci-hvm" ] || [ "${test_variant}" = "pci-stubdom" ]; then
>  
>      if [ -z "$PCIDEV" ]; then
>          echo "Please set 'PCIDEV' variable with BDF of test network adapter" >&2
> @@ -109,15 +109,35 @@ elif [ "${test_variant}" = "pci-pv" ] || [ "${test_variant}" = "pci-hvm" ]; then
>  
>      passed="pci test passed"
>  
> -    domU_config='
> +    domain_type="${test_variant#pci-}"
> +    if [ "$test_variant" = "pci-stubdom" ]; then
> +        domain_type="hvm"
> +        domU_config='
> +type = "hvm"
> +disk = [ "/srv/disk.img,format=raw,vdev=xvda" ]
> +device_model_version = "qemu-xen"
> +device_model_stubdomain_override = 1
> +on_reboot = "destroy"
> +# libxl configures vkb backend to be dom0 instead of the stubdomain, defer
> +# changing that until there is consensus what to do about VGA output (VNC)
> +vkb_device = 0
> +'
> +        domU_disk_path=/srv/disk.img
> +    else
> +        domU_config='
>  type = "'${test_variant#pci-}'"
> -name = "domU"
>  kernel = "/boot/vmlinuz"
>  ramdisk = "/boot/initrd-domU"
>  extra = "root=/dev/ram0 console=hvc0 earlyprintk=xen"
> +disk = [ ]
> +'
> +    fi
> +
> +    # common part
> +    domU_config="$domU_config"'
> +name = "domU"
>  memory = 512
>  vif = [ ]
> -disk = [ ]
>  pci = [ "'$PCIDEV',seize=1" ]
>  on_reboot = "destroy"
>  '
> -- 
> git-series 0.9.1
> 

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

* Re: [PATCH 06/12] RFC: automation: Add linux stubdom build and smoke test
  2024-05-18  0:40   ` Stefano Stabellini
@ 2024-05-18  1:28     ` Marek Marczykowski-Górecki
  0 siblings, 0 replies; 22+ messages in thread
From: Marek Marczykowski-Górecki @ 2024-05-18  1:28 UTC (permalink / raw
  To: Stefano Stabellini; +Cc: xen-devel, Doug Goldstein

[-- Attachment #1: Type: text/plain, Size: 16282 bytes --]

On Fri, May 17, 2024 at 05:40:52PM -0700, Stefano Stabellini wrote:
> On Thu, 16 May 2024, Marek Marczykowski-Górecki wrote:
> > Add minimal linux-stubdom smoke test. It starts a simple HVM with
> > linux-stubdom. The actual stubdom implementation is taken from Qubes OS
> > and then stripped off Qubes-specific code. In particular, the remaining
> > code does _not_ support:
> >  - direct kernel boot (implemented by relaying on specific guest disk
> >    laying in Qubes OS)
> >  - graphical console (used Qubes GUI agent injected into
> >    stubdomain's qemu)
> >  - audio input/output (used Qubes audio agent inside stubdomain)
> >  - USB passthrough (used qrexec <-> usbip proxy inside stubdomain)
> >  - setting up DHCP server (assumes guest addressing used in Qubes OS)
> > 
> > For this smoke test, the relevant part is missing direct kernel boot, as
> > that's used in other smoke tests. Solve this by preparing disk image
> > with proper bootloader (grub) installed. Since the test script is
> > running on arm64 to control x86_64 box, it cannot (easily) install grub
> > directly. For this reason, prepare bootsector as part of the Xen build
> > (which runs on x86_64) and then prepend do the disk image during the
> > test (and adjust partitions table afterwards).
> 
> I am not an expert on this, but do you think it would be possible to use
> network boot and tftp instead of grub on emulated disk? That would not
> require us to build neither /grub-core.img nor build_domU_disk().

Honestly, I don't know. I guess I'd need at least dnsmasq in dom0, and
also iPXE for the domU (if not built already?). I can try for this test.
But a later test (the PCI one) connects a network card and dom0 can't
really setup own DHCP on that network. Additionally combining this with
vif network for PXE might be confusing down the road.

> I am trying to avoid grub-core.img and disk.img because I think direct
> kernel boot or network boot are easier to maintain and more similar to
> the other tests. If you see the ARM tests, they all use tftp boot.

The ARM ones boot as dom0less, where there is only one boot mode for the
system to start in. Here, we have two: xen+dom0 (which already
does network boot), and then domU started by dom0. The latter would
need either a separate DHCP server on a separate network (vif interface
in dom0 should be fine), or some other way to separate dom0/domU boot
mode.

That said, the stubdom used in Qubes does support direct kernel boot. It
is removed from this version, because it relies on specific disk layout
(it reserves xvdd for this purpose). But I do want to bring this
capability to the upstream version too at some point.

> > Signed-off-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
> > ---
> > The test is implemented using hardware runner, because some of the
> > further tests will require it (for example PCI passthrough with
> > stubdomain). But if there is strong desire to have stubdomain tested
> > inside qemu tests (to be included in patchew runs), it is probably an
> > option for this basic smoke test.
> 
> Thanks for this amazing work. This is a great start, we can see how to
> create more tests after merging this one.
> 
> 
> > For now I'm keeping stubdomain code (build and glue scripts) in separate
> > repository on my github account. This is far from ideal. What would be
> > preferred option? New repository on xenbits? Or add directly into
> > xen.git (stubdom directory)? Honestly, I'd rather avoid the latter, as
> > from packager point of view those are mostly separate beings (similar to
> > qemu, where many use distribution-provide one instead of the one bundled
> > with Xen) and it's convenient to not need to rebuild stubdomain on every
> > hypervisor change (like a security patch).
> 
> My suggestion is to create repositories under gitlab.com/xen-project

gitlab.com/xen-project/stubdom-dm-linux ?
Initially I can create the repository under people/marmarek/.

Is there any preference regarding git history? I see two options:
1. Preserve the current history, where there is a lot of qubes-specific
work and on top a bunch of commits making it not qubes-specific (this is
what is there now).
2. Start with fresh history and reference original repository (and the
commit id) in the initial commit message.

> > Another topic is QEMU version inside stubdomain. It needs to be a
> > separate build due to vastly different configure options, so I cannot
> > reuse the qemu binary built for dom0 (or distribution-provided one if
> > Xen is configured to use it). But also, at this moment qemu for
> > stubdomain needs few extra patches that are not upstream yet.
> > What should be the proper solution here (after upstreaming all the
> > patches)?
> 
> It is fine to use a different QEMU version. For now, I would suggest to
> keep the QEMU patches as patches to be applied, in the new repositories
> under gitlab.com/xen-project

Ok, makes sense.

> > Generally, I try to add tests early, even though there is still some
> > work to do for proper stubdomain integration into upstream Xen, so any
> > cleanups and future changes (like the CDROM libxl patches by Jason
> > Andryuk) can be made with more confidence and reduce risk of
> > regressions.
> > 
> > The patch is RFC only because of the stubdom repository location.
> > ---
> >  automation/build/alpine/3.19-arm64v8.dockerfile   |  2 +-
> >  automation/build/alpine/3.19.dockerfile           |  9 ++-
> >  automation/gitlab-ci/build.yaml                   |  3 +-
> >  automation/gitlab-ci/test.yaml                    |  8 +-
> >  automation/scripts/build                          | 12 ++-
> >  automation/scripts/qubes-x86-64.sh                | 87 +++++++++++++++-
> >  automation/tests-artifacts/alpine/3.19.dockerfile |  6 +-
> >  7 files changed, 123 insertions(+), 4 deletions(-)
> > 
> > diff --git a/automation/build/alpine/3.19-arm64v8.dockerfile b/automation/build/alpine/3.19-arm64v8.dockerfile
> > index 158cf465a9ff..12810f87ecc6 100644
> > --- a/automation/build/alpine/3.19-arm64v8.dockerfile
> > +++ b/automation/build/alpine/3.19-arm64v8.dockerfile
> > @@ -47,3 +47,5 @@ RUN apk --no-cache add \
> >    # qubes test deps
> >    openssh-client \
> >    fakeroot \
> > +  sfdisk \
> > +  e2fsprogs \
> > diff --git a/automation/build/alpine/3.19.dockerfile b/automation/build/alpine/3.19.dockerfile
> > index 0be6d7c85fe7..108284613987 100644
> > --- a/automation/build/alpine/3.19.dockerfile
> > +++ b/automation/build/alpine/3.19.dockerfile
> > @@ -49,3 +49,12 @@ RUN apk --no-cache add \
> >    pixman-dev \
> >    # livepatch-tools deps
> >    elfutils-dev \
> > +  # stubdom deps
> > +  dracut-core \
> > +  quilt \
> > +  gnupg \
> > +  libseccomp-dev \
> > +  glib-static \
> > +  gmp-dev \
> > +  mpc1-dev \
> > +  mpfr-dev \
> > diff --git a/automation/gitlab-ci/build.yaml b/automation/gitlab-ci/build.yaml
> > index b186289bbd82..783a0687ba34 100644
> > --- a/automation/gitlab-ci/build.yaml
> > +++ b/automation/gitlab-ci/build.yaml
> > @@ -323,9 +323,11 @@ alpine-3.19-rootfs-export:
> >    image: registry.gitlab.com/xen-project/xen/tests-artifacts/alpine:3.19
> >    script:
> >      - mkdir binaries && cp /initrd.tar.gz binaries/initrd.tar.gz
> > +    - cp /grub-core.img binaries/grub-core.img
> >    artifacts:
> >      paths:
> >        - binaries/initrd.tar.gz
> > +      - binaries/grub-core.img
> >    tags:
> >      - x86_64
> >  
> > @@ -353,6 +355,7 @@ alpine-3.19-gcc-debug:
> >    extends: .gcc-x86-64-build-debug
> >    variables:
> >      CONTAINER: alpine:3.19
> > +    STUBDOM_LINUX: y
> >  
> >  debian-stretch-gcc-debug:
> >    extends: .gcc-x86-64-build-debug
> > diff --git a/automation/gitlab-ci/test.yaml b/automation/gitlab-ci/test.yaml
> > index f62d426a8d34..80d10eb7f476 100644
> > --- a/automation/gitlab-ci/test.yaml
> > +++ b/automation/gitlab-ci/test.yaml
> > @@ -199,6 +199,14 @@ adl-pci-hvm-x86-64-gcc-debug:
> >      - *x86-64-test-needs
> >      - alpine-3.19-gcc-debug
> >  
> > +adl-stubdom-hvm-x86-64-gcc-debug:
> > +  extends: .adl-x86-64
> > +  script:
> > +    - ./automation/scripts/qubes-x86-64.sh stubdom-hvm 2>&1 | tee ${LOGFILE}
> > +  needs:
> > +    - *x86-64-test-needs
> > +    - alpine-3.19-gcc-debug
> > +
> >  zen3p-smoke-x86-64-gcc-debug:
> >    extends: .zen3p-x86-64
> >    script:
> > diff --git a/automation/scripts/build b/automation/scripts/build
> > index b3c71fb6fb60..f7c85b07a8d0 100755
> > --- a/automation/scripts/build
> > +++ b/automation/scripts/build
> > @@ -102,4 +102,16 @@ else
> >      # build Xen
> >      cp -r dist binaries/
> >      if [[ -f xen/xen ]] ; then cp xen/xen binaries/xen; fi
> > +
> > +    if [[ "${STUBDOM_LINUX}" == "y" ]]; then
> > +        git clone https://github.com/marmarek/qubes-vmm-xen-stubdom-linux -b for-upstream2
> > +        make -j$(nproc) -C qubes-vmm-xen-stubdom-linux get-sources
> > +        CFLAGS="-I${PWD}/dist/install/usr/local/include" \
> > +            LDFLAGS="-L${PWD}/dist/install/usr/local/lib" \
> > +            LD_LIBRARY_PATH="${PWD}/dist/install/usr/local/lib" \
> > +            PATH="${PWD}/dist/install/usr/local/bin:$PATH" \
> > +            make -j$(nproc) -C qubes-vmm-xen-stubdom-linux -f Makefile.stubdom all
> > +        cp qubes-vmm-xen-stubdom-linux/build/linux/arch/x86/boot/bzImage binaries/dist/install/usr/local/lib/xen/boot/qemu-stubdom-linux-kernel
> > +        cp qubes-vmm-xen-stubdom-linux/build/rootfs/stubdom-linux-rootfs binaries/dist/install/usr/local/lib/xen/boot/qemu-stubdom-linux-rootfs
> > +    fi
> 
> I think qemu-stubdom-linux-kernel and qemu-stubdom-linux-rootfs should
> be built as test-artifacts if they are not strictly dependent on the Xen
> version.

This is almost true - QEMU needs to be built for the specific Xen version,
since it still uses some of the unstable ABIs... In practice, it might
be possible to have test-artifact for each Xen version separately, but
it will be PITA about the time of bumping the interface version (like
XEN_DOMCTL_INTERFACE_VERSION).

> Otherwise, please create a separate new build job for linux stubdoms (do
> not reuse alpine-3.19-gcc-debug). Also I would prefer if these build
> instructions were on a separate file, separate from "build".

Ok.

> >  fi
> > diff --git a/automation/scripts/qubes-x86-64.sh b/automation/scripts/qubes-x86-64.sh
> > index 77cb0d45815d..fc73403dbadf 100755
> > --- a/automation/scripts/qubes-x86-64.sh
> > +++ b/automation/scripts/qubes-x86-64.sh
> > @@ -18,6 +18,37 @@ memory = 512
> >  vif = [ "bridge=xenbr0", ]
> >  disk = [ ]
> >  '
> > +domU_disk_path=
> > +
> > +### helper functions
> > +
> > +build_domU_disk() {
> > +    local kernel="$1"
> > +    local initrd="$2"
> > +    local rootfs="$3"
> > +    local output="$4"
> > +    local grubcfg="$rootfs/boot/grub2/grub.cfg"
> > +    local kernel_cmdline="root=/dev/xvda1 console=hvc0 earlyprintk=xen"
> > +
> > +    mkdir -p "$rootfs/boot/grub2"
> > +    cp "$kernel" "$rootfs/boot/vmlinuz"
> > +    echo "linux /boot/vmlinuz $kernel_cmdline" >> "$grubcfg"
> > +    if [ -n "$initrd" ]; then
> > +        cp "$initrd" "$rootfs/boot/initrd.img"
> > +        echo "initrd /boot/initrd.img" >> "$grubcfg"
> > +    fi
> > +    echo "boot" >> "$grubcfg"
> > +    size=$(du -sm "$rootfs")
> > +    size=${size%%	*}
> > +    # add 5M margin
> > +    size=$(( size + 5 ))
> > +    mke2fs -d "$rootfs" "$output.part1" ${size}m
> > +    cat "$rootfs/usr/lib/grub/i386-pc/boot_hybrid.img" binaries/grub-core.img > "$output"
> > +    # align for the partition 1 start (2048 sectors)
> > +    truncate -s $((2048 * 512)) "$output"
> > +    cat "$output.part1" >> "$output"
> > +    echo ",,linux,*" | sfdisk "$output"
> > +}
> >  
> >  ### test: smoke test & smoke test PVH
> >  if [ -z "${test_variant}" ] || [ "${test_variant}" = "dom0pvh" ]; then
> > @@ -116,6 +147,41 @@ until grep -q \"^domU Welcome to Alpine Linux\" /var/log/xen/console/guest-domU.
> >      sleep 1
> >  done
> >  "
> > +
> > +### test: stubdom-hvm
> > +elif [ "${test_variant}" = "stubdom-hvm" ]; then
> > +    passed="ping test passed"
> > +
> > +    domU_config='
> > +type = "hvm"
> > +name = "domU"
> > +memory = 512
> > +vif = [ "bridge=xenbr0", ]
> > +disk = [ "/srv/disk.img,format=raw,vdev=xvda" ]
> > +device_model_version = "qemu-xen"
> > +device_model_stubdomain_override = 1
> > +on_reboot = "destroy"
> > +# libxl configures vkb backend to be dom0 instead of the stubdomain, defer
> > +# changing that until there is consensus what to do about VGA output (VNC)
> > +vkb_device = 0
> > +'
> > +    domU_check="
> > +ifconfig eth0 192.168.0.2
> > +until ping -c 10 192.168.0.1; do
> > +    sleep 1
> > +done
> > +echo \"${passed}\"
> > +"
> > +    dom0_check="
> > +set +x
> > +until grep -q \"${passed}\" /var/log/xen/console/guest-domU.log; do
> > +    sleep 1
> > +done
> > +set -x
> > +echo \"${passed}\"
> > +"
> > +
> > +    domU_disk_path=/srv/disk.img
> >  fi
> >  
> >  # DomU
> > @@ -137,8 +203,17 @@ ${domU_check}
> >  chmod +x etc/local.d/xen.start
> >  echo "rc_verbose=yes" >> etc/rc.conf
> >  sed -i -e 's/^Welcome/domU \0/' etc/issue
> > -find . | fakeroot -i ../fakeroot-save cpio -H newc -o | gzip > ../binaries/domU-rootfs.cpio.gz
> >  cd ..
> > +if [ -n "$domU_disk_path" ]; then
> > +    build_domU_disk \
> > +        "binaries/bzImage" \
> > +        "" \
> > +        "rootfs" \
> > +        "binaries/disk.img"
> > +else
> > +    (cd rootfs; find . | fakeroot -i ../fakeroot-save cpio -H newc -o | gzip > ../binaries/domU-rootfs.cpio.gz)
> > +fi
> > +
> >  rm -rf rootfs
> >  
> >  # DOM0 rootfs
> > @@ -152,6 +227,9 @@ mkdir srv
> >  mkdir sys
> >  rm var/run
> >  cp -ar ../binaries/dist/install/* .
> > +if [ -n "$domU_disk_path" ]; then
> > +    cp ../binaries/disk.img "./$domU_disk_path"
> > +fi
> >  
> >  echo "#!/bin/bash
> >  
> > @@ -164,8 +242,9 @@ ifconfig eth0 up
> >  ifconfig xenbr0 up
> >  ifconfig xenbr0 192.168.0.1
> >  
> > -# get domU console content into test log
> > +# get domU (and possibly its stubdom) console content into test log
> >  tail -F /var/log/xen/console/guest-domU.log 2>/dev/null | sed -e \"s/^/(domU) /\" &
> > +tail -F /var/log/xen/console/guest-domU-dm.log 2>/dev/null | sed -e \"s/^/(domU-dm) /\" &
> >  tail -F /var/log/xen/qemu-dm-domU.log 2>/dev/null | sed -e \"s/^/(qemu-dm) /\" &
> >  xl -vvv create /etc/xen/domU.cfg
> >  ${dom0_check}
> > @@ -178,7 +257,9 @@ echo "XENCONSOLED_TRACE=all" >> etc/default/xencommons
> >  echo "QEMU_XEN=/bin/false" >> etc/default/xencommons
> >  mkdir -p var/log/xen/console
> >  cp ../binaries/bzImage boot/vmlinuz
> > -cp ../binaries/domU-rootfs.cpio.gz boot/initrd-domU
> > +if [ -r ../binaries/domU-rootfs.cpio.gz ]; then
> > +    cp ../binaries/domU-rootfs.cpio.gz boot/initrd-domU
> > +fi
> >  find . | fakeroot -i ../fakeroot-save cpio -H newc -o | gzip > ../binaries/dom0-rootfs.cpio.gz
> >  cd ..
> >  
> > diff --git a/automation/tests-artifacts/alpine/3.19.dockerfile b/automation/tests-artifacts/alpine/3.19.dockerfile
> > index 6d665daedfa4..cfb2cb30fb30 100644
> > --- a/automation/tests-artifacts/alpine/3.19.dockerfile
> > +++ b/automation/tests-artifacts/alpine/3.19.dockerfile
> > @@ -35,6 +35,8 @@ RUN \
> >    apk add pciutils && \
> >    apk add libelf && \
> >    apk add libdw && \
> > +  apk add grub-bios && \
> > +  apk add libseccomp && \
> >    \
> >    # Xen
> >    cd / && \
> > @@ -64,4 +66,6 @@ RUN \
> >    \
> >    # Create rootfs
> >    cd / && \
> > -  tar cvzf /initrd.tar.gz bin dev etc home init lib mnt opt root sbin usr var
> > +  tar cvzf /initrd.tar.gz bin dev etc home init lib mnt opt root sbin usr var && \
> > +  # Prepare boot sector for HVM disk
> > +  grub-mkimage -o /grub-core.img -O i386-pc -p '(hd0,msdos1)/boot/grub2' boot part_msdos ext2 linux biosdisk configfile normal
> > -- 
> > git-series 0.9.1
> > 


-- 
Best Regards,
Marek Marczykowski-Górecki
Invisible Things Lab

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

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

end of thread, other threads:[~2024-05-18  1:29 UTC | newest]

Thread overview: 22+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-05-16 13:58 [PATCH 00/12] automation: Add build and test for Linux stubdomain Marek Marczykowski-Górecki
2024-05-16 13:58 ` [PATCH 01/12] automation: include domU kernel messages in the console output log Marek Marczykowski-Górecki
2024-05-17 20:57   ` Stefano Stabellini
2024-05-16 13:58 ` [PATCH 02/12] automation: update fedora build to F39 Marek Marczykowski-Górecki
2024-05-17 20:57   ` Stefano Stabellini
2024-05-16 13:58 ` [PATCH 03/12] automation: switch to alpine:3.19 Marek Marczykowski-Górecki
2024-05-17 21:58   ` Stefano Stabellini
2024-05-16 13:58 ` [PATCH 04/12] automation: increase verbosity of starting a domain Marek Marczykowski-Górecki
2024-05-17 21:50   ` Stefano Stabellini
2024-05-16 13:58 ` [PATCH 05/12] automation: prevent grub unpacking initramfs Marek Marczykowski-Górecki
2024-05-17 21:51   ` Stefano Stabellini
2024-05-16 13:58 ` [PATCH 06/12] RFC: automation: Add linux stubdom build and smoke test Marek Marczykowski-Górecki
2024-05-18  0:40   ` Stefano Stabellini
2024-05-18  1:28     ` Marek Marczykowski-Górecki
2024-05-16 13:58 ` [PATCH 07/12] libxl: Allow stubdomain to control interupts of PCI device Marek Marczykowski-Górecki
2024-05-16 13:58 ` [PATCH 08/12] automation: update kernel for x86 tests Marek Marczykowski-Górecki
2024-05-17 21:53   ` Stefano Stabellini
2024-05-16 13:58 ` [PATCH 09/12] WIP: automation: temporarily add 'testlab' tag to stubdomain build Marek Marczykowski-Górecki
2024-05-16 13:58 ` [PATCH 10/12] automation: stubdom test with PCI passthrough Marek Marczykowski-Górecki
2024-05-18  0:41   ` Stefano Stabellini
2024-05-16 13:58 ` [PATCH 11/12] automation: stubdom test with boot from CDROM Marek Marczykowski-Górecki
2024-05-16 13:58 ` [PATCH 12/12] [DO NOT MERGE] switch to my containers fork Marek Marczykowski-Górecki

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).