Skip to contentSkip to conversation

ppc: Drop support for QEMU pseries

PATCH New Shawn Anastasio 1 participant 3 messages Sep 7, 2023

lore
Share & tools
lore
#0 lore raw

v3 cover ppc: Drop support for QEMU pseries

Hello all,

This small series drops support for the QEMU paravirtualized pseries machine type in favor of the bare metal PowerNV platform. pseries support was broken by 74b725a64d80 ('xen/ppc: Implement initial Radix MMU support'), and instead of maintaining separate code paths to retain support for the platform, I think it makes the most sense to drop it entirely.

pseries was originally targeted for initial bringup since it has historically been much better supported by QEMU, but PowerNV support in QEMU has recently developed to the point where this is no longer a concern. Since I can think of very little practical use for running Xen under pseries, and supporting it requires non-trivial duplication of effort, drop support for it entirely.

This also requires a change to the ppc64le CI dockerfile to build a newer version of QEMU than is available in the bullseye repository.

Thanks,
Shawn

--
v3: Build QEMU as test-artifact
v2: Add Fixes: tag to patch 2, add references to broken state of pseries

Shawn Anastasio (2):
automation: Switch ppc64le tests to PowerNV machine type xen/ppc: Drop support for pseries/OpenFirmware

 .../build/debian/bullseye-ppc64le.dockerfile  |   5 +-
 automation/gitlab-ci/build.yaml               |  14 +++
 automation/gitlab-ci/test.yaml                |   5 +-
 automation/scripts/qemu-smoke-ppc64le.sh      |   3 +-
 .../qemu-system-ppc64/8.1.0-ppc64.dockerfile  |  37 ++++++
 xen/arch/ppc/Makefile                         |   1 -
 xen/arch/ppc/boot-of.c                        | 113 ------------------
 xen/arch/ppc/include/asm/boot.h               |  19 ---
 xen/arch/ppc/ppc64/Makefile                   |   1 -
 xen/arch/ppc/ppc64/of-call.S                  |  83 -------------
 xen/arch/ppc/setup.c                          |  11 +-
 11 files changed, 62 insertions(+), 230 deletions(-)
 create mode 100644 automation/tests-artifacts/qemu-system-ppc64/8.1.0-ppc64.dockerfile
 delete mode 100644 xen/arch/ppc/boot-of.c
 delete mode 100644 xen/arch/ppc/ppc64/of-call.S

--
2.30.2

#1 lore raw

PATCH v3 1/2 automation: Switch ppc64le tests to PowerNV machine type

Run ppc64le tests with the PowerNV machine type (bare metal) instead of the paravirtualized pseries machine. This requires a more modern version of QEMU than is present in debian bullseye's repository, so update the dockerfile to build QEMU from source.

Support for booting on pseries was broken by 74b725a64d80 ('xen/ppc:
Implement initial Radix MMU support') which resulted in CI failures. In preparation for removing pseries support entirely, switch the CI infrastructure to the PowerNV machine type.

---
v3: Use test-artifact for custom QEMU build

 .../build/debian/bullseye-ppc64le.dockerfile  |  5 ++-
 automation/gitlab-ci/build.yaml               | 14 +++++++
 automation/gitlab-ci/test.yaml                |  5 ++-
 automation/scripts/qemu-smoke-ppc64le.sh      |  3 +-
 .../qemu-system-ppc64/8.1.0-ppc64.dockerfile  | 37 +++++++++++++++++++
 5 files changed, 59 insertions(+), 5 deletions(-)
 create mode 100644 automation/tests-artifacts/qemu-system-ppc64/8.1.0-ppc64.dockerfile
automation/build/debian/bullseye-ppc64le.dockerfile +3 -2
index 8fad26e903..4de8458445 100644
@@ -22,8 +22,9 @@ RUN apt-get update && \
         gcc-powerpc64le-linux-gnu \
         make \
         python3-minimal \
-        # for test phase
-        qemu-system-ppc \
+        # QEMU runtime dependencies for test phase
+        libglib2.0-0 \
+        libpixman-1-0 \
         && \
         apt-get autoremove -y && \
         apt-get clean && \
automation/gitlab-ci/build.yaml +14 -0
index b633facff4..1619e9a558 100644
@@ -306,6 +306,20 @@ qemu-system-aarch64-6.0.0-arm32-export:
   tags:
     - arm64
 
+# ppc64 test artifacts
+
+qemu-system-ppc64-8.1.0-ppc64-export:
+  extends: .test-jobs-artifact-common
+  image: registry.gitlab.com/xen-project/xen/tests-artifacts/qemu-system-ppc64:8.1.0-ppc64
+  script:
+    - mkdir binaries && cp /qemu-system-ppc64 /skiboot.lid binaries/
+  artifacts:
+    paths:
+      - binaries/qemu-system-ppc64
+      - binaries/skiboot.lid
+  tags:
+    - x86_64
+
 # x86_64 test artifacts
 
 alpine-3.18-rootfs-export:
automation/gitlab-ci/test.yaml +3 -2
index 9aa8deabea..4b836bf047 100644
@@ -454,9 +454,10 @@ qemu-smoke-riscv64-gcc:
   needs:
     - archlinux-current-gcc-riscv64-debug
 
-qemu-smoke-ppc64le-pseries-gcc:
+qemu-smoke-ppc64le-powernv9-gcc:
   extends: .qemu-ppc64le
   script:
-    - ./automation/scripts/qemu-smoke-ppc64le.sh pseries-5.2 2>&1 | tee ${LOGFILE}
+    - ./automation/scripts/qemu-smoke-ppc64le.sh powernv9 2>&1 | tee ${LOGFILE}
   needs:
+    - qemu-system-ppc64-8.1.0-ppc64-export
     - debian-bullseye-gcc-ppc64le-debug
automation/scripts/qemu-smoke-ppc64le.sh +2 -1
index eb55221221..2adbdac87e 100755
@@ -12,7 +12,8 @@ set +e
 touch smoke.serial
 
 timeout -k 1 20 \
-qemu-system-ppc64 \
+binaries/qemu-system-ppc64 \
+    -bios binaries/skiboot.lid \
     -M $machine \
     -m 2g \
     -smp 1 \
automation/tests-artifacts/qemu-system-ppc64/8.1.0-ppc64.dockerfile new file +37 -0
new file mode 100644
index 0000000000..7376ca46ff
@@ -0,0 +1,37 @@
+FROM debian:bullseye-slim
+LABEL maintainer.name="The Xen Project" \
+      maintainer.email="[email protected]"
+
+ENV DEBIAN_FRONTEND=noninteractive
+ENV QEMU_VERSION=8.1.0
+ENV USER root
+
+RUN mkdir /build
+WORKDIR /build
+
+# build depends
+RUN apt-get update && \
+    apt-get --quiet --yes install \
+        build-essential \
+        curl \
+        python3 \
+        python3-pip \
+        python3-elementpath \
+        ninja-build \
+        pkg-config \
+        libglib2.0-dev \
+        libpixman-1-dev \
+        && \
+    \
+    curl -fsSLO https://download.qemu.org/qemu-"$QEMU_VERSION".tar.xz && \
+    tar xvJf qemu-"$QEMU_VERSION".tar.xz && \
+    cd qemu-"$QEMU_VERSION" && \
+    ./configure --target-list=ppc64-softmmu && \
+    make -j$(nproc) && \
+    cp ./build/qemu-system-ppc64 / && \
+    cp ./build/qemu-bundle/usr/local/share/qemu/skiboot.lid / && \
+    cd /build && \
+    rm -rf qemu-"$QEMU_VERSION"* && \
+    apt-get autoremove -y && \
+    apt-get clean && \
+    rm -rf /var/lib/apt/lists* /tmp/* /var/tmp/*

--
2.30.2

#2 lore raw

PATCH v3 2/2 xen/ppc: Drop support for pseries/OpenFirmware

In reply to Shawn Anastasio

Since QEMU's PowerNV support has matured to the point where it is now suitable for development, drop support for booting on the paravirtualized pseries machine type and its associated interfaces.

Support for booting on pseries was broken by 74b725a64d80 ('xen/ppc:
Implement initial Radix MMU support'), and since there is little practical value in continuing to support pseries as a target, just drop support for it entirely.

Fixes 74b725a64d80 ('xen/ppc: Implement initial Radix MMU support')
---
 xen/arch/ppc/Makefile           |   1 -
 xen/arch/ppc/boot-of.c          | 113 --------------------------------
 xen/arch/ppc/include/asm/boot.h |  19 ------
 xen/arch/ppc/ppc64/Makefile     |   1 -
 xen/arch/ppc/ppc64/of-call.S    |  83 -----------------------
 xen/arch/ppc/setup.c            |  11 +---
 6 files changed, 3 insertions(+), 225 deletions(-)
 delete mode 100644 xen/arch/ppc/boot-of.c
 delete mode 100644 xen/arch/ppc/ppc64/of-call.S
xen/arch/ppc/Makefile +0 -1
index a059ac4c0a..b3205b8f7a 100644
@@ -1,6 +1,5 @@
 obj-$(CONFIG_PPC64) += ppc64/
 
-obj-y += boot-of.init.o
 obj-$(CONFIG_EARLY_PRINTK) += early_printk.init.o
 obj-y += mm-radix.o
 obj-y += opal.o
xen/arch/ppc/boot-of.c deleted +0 -113

113 lines not on this page · raw message

xen/arch/ppc/include/asm/boot.h +0 -19
index 296539cd9e..d62c3ff6e0 100644
@@ -4,25 +4,6 @@
 
 #include <xen/types.h>
 
-/*
- * OpenFirmware boot interfaces
- */
-
-enum {
-    OF_FAILURE = -1,
-    OF_SUCCESS = 0,
-};
-
-struct of_service {
-    __be32 ofs_service;
-    __be32 ofs_nargs;
-    __be32 ofs_nrets;
-    __be32 ofs_args[10];
-};
-
-int enter_of(struct of_service *args, unsigned long entry);
-void boot_of_init(unsigned long vec);
-
 /*
  * OPAL boot interfaces
  */
xen/arch/ppc/ppc64/Makefile +0 -1
index b9a91dc15f..5b88355bb2 100644
@@ -1,3 +1,2 @@
 obj-y += head.o
-obj-y += of-call.o
 obj-y += opal-calls.o
xen/arch/ppc/ppc64/of-call.S deleted +0 -83

83 lines not on this page · raw message

xen/arch/ppc/setup.c +3 -8
index 0106e9c9da..3fc7705d9b 100644
@@ -14,17 +14,12 @@ void __init noreturn start_xen(unsigned long r3, unsigned long r4,
 {
     if ( r5 )
     {
-        /* OpenFirmware boot protocol */
-        boot_of_init(r5);
+        /* Unsupported OpenFirmware boot protocol */
+        __builtin_trap();
     }
     else
     {
-        /*
-         * kexec boot protocol
-         *
-         * TODO: This currently assumes an OPAL/PowerNV system, but it's also
-         * possible to be kexec'd on an OF system.
-         */
+        /* kexec boot protocol */
         boot_opal_init((void *)r3);
     }
 

--
2.30.2