Skip to contentSkip to conversation

ppc: Drop support for QEMU pseries

PATCH Superseded Shawn Anastasio 3 participants 7 messages Sep 7, 2023 – Sep 8, 2023

v2 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

v2 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

--
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  |  37 +++++-
 automation/gitlab-ci/test.yaml                |   2 +-
 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 +-
 8 files changed, 39 insertions(+), 228 deletions(-)
 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 v2 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.

---
 .../build/debian/bullseye-ppc64le.dockerfile  | 37 ++++++++++++++++++-
 automation/gitlab-ci/test.yaml                |  2 +-
 2 files changed, 36 insertions(+), 3 deletions(-)
automation/build/debian/bullseye-ppc64le.dockerfile +35 -2
index 8fad26e903..15827bbcf4 100644
@@ -1,4 +1,36 @@
+FROM debian:bullseye-slim AS builder
+
+ENV DEBIAN_FRONTEND=noninteractive
+ENV QEMU_TAG=stable-8.1
+ENV USER root
+
+# dependencies for qemu build
+RUN apt-get update && \
+    apt-get --quiet --yes install \
+        git \
+        build-essential \
+        python3-minimal \
+        python3-elementpath \
+        python3-pip \
+        ninja-build \
+        libglib2.0-dev \
+        libpixman-1-dev
+
+RUN mkdir /build
+WORKDIR /build
+
+# QEMU build from git
+RUN git clone --depth 1 --branch "${QEMU_TAG}" https://github.com/qemu/qemu && \
+    mkdir qemu/build && \
+    cd qemu/build && \
+    ../configure --target-list=ppc64-softmmu && \
+    ninja && \
+    ninja install
+
 FROM debian:bullseye-slim
+COPY --from=builder /usr/local/bin/qemu-system-ppc64 /usr/local/bin/qemu-system-ppc64
+COPY --from=builder /usr/local/share/qemu/skiboot.lid /usr/local/share/qemu/skiboot.lid
+
 LABEL maintainer.name="The Xen Project" \
       maintainer.email="[email protected]"
 
@@ -22,8 +54,9 @@ RUN apt-get update && \
         gcc-powerpc64le-linux-gnu \
         make \
         python3-minimal \
-        # for test phase
-        qemu-system-ppc \
+        # QEMU runtime dependencies
+        libglib2.0-0 \
+        libpixman-1-0 \
         && \
         apt-get autoremove -y && \
         apt-get clean && \
automation/gitlab-ci/test.yaml +1 -1
index 9aa8deabea..9b26ccd907 100644
@@ -457,6 +457,6 @@ qemu-smoke-riscv64-gcc:
 qemu-smoke-ppc64le-pseries-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:
     - debian-bullseye-gcc-ppc64le-debug
Signature · 1 line
2.30.2
#2 lore raw

Re: [PATCH v2 1/2] automation: Switch ppc64le tests to PowerNV machine type

Quoted 39 lines · Shawn Anastasio

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.

---
 .../build/debian/bullseye-ppc64le.dockerfile  | 37 ++++++++++++++++++-
 automation/gitlab-ci/test.yaml                |  2 +-
 2 files changed, 36 insertions(+), 3 deletions(-)
automation/build/debian/bullseye-ppc64le.dockerfile +18 -0
index 8fad26e903..15827bbcf4 100644
@@ -1,4 +1,36 @@
+FROM debian:bullseye-slim AS builder
+
+ENV DEBIAN_FRONTEND=noninteractive
+ENV QEMU_TAG=stable-8.1
+ENV USER root
+
+# dependencies for qemu build
+RUN apt-get update && \
+    apt-get --quiet --yes install \
+        git \
+        build-essential \
+        python3-minimal \
+        python3-elementpath \
+        python3-pip \
+        ninja-build \
+        libglib2.0-dev \
+        libpixman-1-dev
+

automation/build/debian/bullseye-ppc64le.dockerfile line 28

Quoted 10 lines
automation/build/debian/bullseye-ppc64le.dockerfile +10 -0
+RUN mkdir /build
+WORKDIR /build
+
+# QEMU build from git
+RUN git clone --depth 1 --branch "${QEMU_TAG}" https://github.com/qemu/qemu && \
+    mkdir qemu/build && \
+    cd qemu/build && \
+    ../configure --target-list=ppc64-softmmu && \
+    ninja && \
+    ninja install

It is totally find to build your QEMU but please use a test-artifact instead, see automation/tests-artifacts/qemu-system-aarch64/ and qemu-system-aarch64-6.0.0-arm64-export as an example.

Quoted 34 lines
automation/build/debian/bullseye-ppc64le.dockerfile +6 -2
 FROM debian:bullseye-slim
+COPY --from=builder /usr/local/bin/qemu-system-ppc64 /usr/local/bin/qemu-system-ppc64
+COPY --from=builder /usr/local/share/qemu/skiboot.lid /usr/local/share/qemu/skiboot.lid
+
 LABEL maintainer.name="The Xen Project" \
       maintainer.email="[email protected]"
 
@@ -22,8 +54,9 @@ RUN apt-get update && \
         gcc-powerpc64le-linux-gnu \
         make \
         python3-minimal \
-        # for test phase
-        qemu-system-ppc \
+        # QEMU runtime dependencies
+        libglib2.0-0 \
+        libpixman-1-0 \
         && \
         apt-get autoremove -y && \
         apt-get clean && \
automation/gitlab-ci/test.yaml +1 -1
index 9aa8deabea..9b26ccd907 100644
@@ -457,6 +457,6 @@ qemu-smoke-riscv64-gcc:
 qemu-smoke-ppc64le-pseries-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:
     - debian-bullseye-gcc-ppc64le-debug
Signature · 1 line
2.30.2
#3 lore raw

Re: [PATCH v2 1/2] automation: Switch ppc64le tests to PowerNV machine type

Quoted 46 lines · Stefano Stabellini
Quoted 45 lines · Shawn Anastasio

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.

---
 .../build/debian/bullseye-ppc64le.dockerfile  | 37 ++++++++++++++++++-
 automation/gitlab-ci/test.yaml                |  2 +-
 2 files changed, 36 insertions(+), 3 deletions(-)
automation/build/debian/bullseye-ppc64le.dockerfile +24 -0
index 8fad26e903..15827bbcf4 100644
@@ -1,4 +1,36 @@
+FROM debian:bullseye-slim AS builder
+
+ENV DEBIAN_FRONTEND=noninteractive
+ENV QEMU_TAG=stable-8.1
+ENV USER root
+
+# dependencies for qemu build
+RUN apt-get update && \
+    apt-get --quiet --yes install \
+        git \
+        build-essential \
+        python3-minimal \
+        python3-elementpath \
+        python3-pip \
+        ninja-build \
+        libglib2.0-dev \
+        libpixman-1-dev
+
+RUN mkdir /build
+WORKDIR /build
+
+# QEMU build from git
+RUN git clone --depth 1 --branch "${QEMU_TAG}" https://github.com/qemu/qemu && \
+    mkdir qemu/build && \
Quoted 8 lines

automation/build/debian/bullseye-ppc64le.dockerfile line 28

Quoted 4 lines
automation/build/debian/bullseye-ppc64le.dockerfile +4 -0
+    cd qemu/build && \
+    ../configure --target-list=ppc64-softmmu && \
+    ninja && \
+    ninja install

It is totally find to build your QEMU but please use a test-artifact instead, see automation/tests-artifacts/qemu-system-aarch64/ and qemu-system-aarch64-6.0.0-arm64-export as an example.

Thanks for letting me know -- I've submitted a v3 that uses this technique to build the QEMU binary based on the aarch64 example you provided.

Shawn

#4 lore raw

Re: [PATCH v2 1/2] automation: Switch ppc64le tests to PowerNV machine type

Quoted 56 lines · Shawn Anastasio
Quoted 46 lines · Stefano Stabellini
Quoted 45 lines · Shawn Anastasio

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.

---
 .../build/debian/bullseye-ppc64le.dockerfile  | 37 ++++++++++++++++++-
 automation/gitlab-ci/test.yaml                |  2 +-
 2 files changed, 36 insertions(+), 3 deletions(-)
automation/build/debian/bullseye-ppc64le.dockerfile +24 -0
index 8fad26e903..15827bbcf4 100644
@@ -1,4 +1,36 @@
+FROM debian:bullseye-slim AS builder
+
+ENV DEBIAN_FRONTEND=noninteractive
+ENV QEMU_TAG=stable-8.1
+ENV USER root
+
+# dependencies for qemu build
+RUN apt-get update && \
+    apt-get --quiet --yes install \
+        git \
+        build-essential \
+        python3-minimal \
+        python3-elementpath \
+        python3-pip \
+        ninja-build \
+        libglib2.0-dev \
+        libpixman-1-dev
+
+RUN mkdir /build
+WORKDIR /build
+
+# QEMU build from git
+RUN git clone --depth 1 --branch "${QEMU_TAG}" https://github.com/qemu/qemu && \
+    mkdir qemu/build && \
Quoted 8 lines

automation/build/debian/bullseye-ppc64le.dockerfile line 28

Quoted 4 lines
automation/build/debian/bullseye-ppc64le.dockerfile +4 -0
+    cd qemu/build && \
+    ../configure --target-list=ppc64-softmmu && \
+    ninja && \
+    ninja install

It is totally find to build your QEMU but please use a test-artifact instead, see automation/tests-artifacts/qemu-system-aarch64/ and qemu-system-aarch64-6.0.0-arm64-export as an example.

Quoted 3 lines

Thanks for letting me know -- I've submitted a v3 that uses this technique to build the QEMU binary based on the aarch64 example you provided.

I have already committed v3 :-)

#5 lore raw

PATCH v2 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);
     }
 
Signature · 1 line
2.30.2
Acked-by on v2 2/2
#6 lore raw

Re: [PATCH v2 2/2] xen/ppc: Drop support for pseries/OpenFirmware

Quoted 11 lines · 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')

(Nit: Fixes: tag first please.)