Skip to content

Commit

Permalink
[PATCH 00/73] tcg: Merge *_i32 and *_i64 opcodes
Browse files Browse the repository at this point in the history
https://lore.kernel.org/qemu-devel/[email protected]

---

From: Richard Henderson <[email protected]>
To: [email protected]
Subject: [PATCH 00/73] tcg: Merge *_i32 and *_i64 opcodes
Date: Thu,  2 Jan 2025 10:05:40 -0800
Message-ID: <[email protected]>
X-Mailer: git-send-email 2.43.0
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Received-SPF: pass client-ip=2607:f8b0:4864:20::630;
 [email protected]; helo=mail-pl1-x630.google.com
X-Spam_score_int: -20
X-Spam_score: -2.1
X-Spam_bar: --
X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1,
 DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1,
 RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001,
 SPF_PASS=-0.001 autolearn=ham autolearn_force=no
X-Spam_action: no action
X-BeenThere: [email protected]
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: <qemu-devel.nongnu.org>
List-Unsubscribe: <https://lists.nongnu.org/mailman/options/qemu-devel>,
 <mailto:[email protected]?subject=unsubscribe>
List-Archive: <https://lists.nongnu.org/archive/html/qemu-devel>
List-Post: <mailto:[email protected]>
List-Help: <mailto:[email protected]?subject=help>
List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/qemu-devel>,
 <mailto:[email protected]?subject=subscribe>
Errors-To: [email protected]
Sender: [email protected]

Currently we have individual opcodes for each integer type.
This makes things difficult in tcg/optimize.c when we want
to transform the opcode stream.

Add a TCGType field to TCGOp and use that instead.  Merge all of
the opcodes that are common to both TCG_TYPE_I32 and TCG_TYPE_I64.
We could eventually merge some of the vector opcodes too, but since
those have an additional element size operand, that is a larger job.

This also moves quite a lot of the tcg backend implementation out
of the publicly exposed headers.  After this patchset is complete,
we will not rebuild target translators for most changes to the tcg
backend.

r~

Richard Henderson (73):
  tcg: Add TCGOp.type
  tcg: Add TCGHelperInfo.out_type
  tcg: Add TCGType argument to tcg_emit_op, tcg_op_insert_*
  tcg: Add TCGType argument to tcg_gen_op*
  tcg: Remove TCGOP_VECL
  tcg: Move call abi parameters from tcg-target.h to tcg-target.c.inc
  tcg: Add TCGType argument to tcg_op_supported
  target/arm: Do not test TCG_TARGET_HAS_bitsel_vec
  target/arm: Use tcg_op_supported
  target/tricore: Use tcg_op_supported
  tcg: Add tcg_op_deposit_valid
  target/i386: Remove TCG_TARGET_extract_tl_valid
  target/i386: Use tcg_op_deposit_valid
  target/i386: Use tcg_op_supported
  tcg: Remove TCG_TARGET_NEED_LDST_LABELS and
    TCG_TARGET_NEED_POOL_LABELS
  tcg: Rename tcg-target.opc.h to tcg-target-opc.h.inc
  tcg/tci: Move TCI specific opcodes to tcg-target-opc.h.inc
  tcg: Move fallback tcg_can_emit_vec_op out of line
  tcg: Split out tcg-target-has.h and tcg-has.h
  tcg: Split out tcg-target-mo.h
  tcg: Merge TCG_TARGET_HAS_{div,rem,div2}
  tcg: Merge TCG_TARGET_HAS_{andc,orc,nand,nor,eqv,not}
  tcg/mips: Expand bswap unconditionally
  tcg: Merge TCG_TARGET_HAS_bswap*
  tcg: Merge TCG_TARGET_HAS_rot_{i32,i64}
  tcg: Merge TCG_TARGET_HAS_{clz,ctz,ctpop}
  tcg: Merge TCG_TARGET_HAS_{muls2,mulu2,mulsh,muluh}
  tcg: Merge TCG_TARGET_HAS_{add2,sub2}
  tcg: Merge TCG_TARGET_HAS_negsetcond_{i32,i64}
  tcg/i386: Handle all 8-bit extensions for i686
  tcg/i386: Fold the ext{8,16,32}[us] cases into {s}extract
  tcg/aarch64: Provide TCG_TARGET_{s}extract_valid
  tcg/aarch64: Expand extract with offset 0 with andi
  tcg/arm: Add full [US]XT[BH] into {s}extract
  tcg/loongarch64: Fold the ext{8,16,32}[us] cases into {s}extract
  tcg/mips: Fold the ext{8,16,32}[us] cases into {s}extract
  tcg/ppc: Fold the ext{8,16,32}[us] cases into {s}extract
  tcg/riscv64: Fold the ext{8,16,32}[us] cases into {s}extract
  tcg/riscv: Use SRAIW, SRLIW for {s}extract_i64
  tcg/s390x: Fold the ext{8,16,32}[us] cases into {s}extract
  tcg/sparc64: Use SRA, SRL for {s}extract_i64
  tcg/tci: Provide TCG_TARGET_{s}extract_valid
  tcg/tci: Remove assertions for deposit and extract
  tcg: Remove TCG_TARGET_HAS_{s}extract_{i32,i64}
  tcg: Remove TCG_TARGET_HAS_deposit_{i32,i64}
  tcg: Merge TCG_TARGET_HAS_extract2_{i32,i64}
  tcg: Make INDEX_op_extrh_i64_i32 mandatory
  tcg: Remove INDEX_op_ext{8,16,32}{us}
  tcg: Reorg process_op_defs
  tcg: Remove args_ct from TCGOpDef
  tcg: Constify tcg_op_defs
  tcg: Use tcg_op_supported in process_op_defs
  tcg: Use C_NotImplemented in tcg_target_op_def
  tcg: Pass TCGOp to tcg_target_op_def
  tcg: Merge INDEX_op_{ld,st}*_{i32_i64}
  tcg: Remove INDEX_op_qemu_st8_*_i32
  tcg: Add TCGType argument to tcg_out_op
  tcg/optimize: Remove OptContext.type
  tcg: Remove TCG_OPF_64BIT
  tcg: Change have_vec to has_type in tcg_op_supported
  tcg: Merge INDEX_op_mov_{i32,i64}
  tcg: Merge integer logical operations
  tcg: Merge integer add, sub, neg operations
  tcg: Merge integer add2, sub2 operations
  tcg: Merge integer mul, div operations
  tcg: Merge brcond, setcond, negsetcond, movcond operations
  tcg: Merge extract, sextract operations
  tcg: Merge integer shift operations
  tcg: Merge deposit operations
  tcg: Merge extract2 operations
  tcg: Merge host integer load/store operations
  tcg: Merge bswap operations
  tcg: Merge clz, ctz, ctpop operations

 accel/tcg/internal-target.h                   |    1 +
 include/tcg/helper-info.h                     |    3 +-
 include/tcg/tcg-op.h                          |    8 +-
 include/tcg/tcg-opc.h                         |  334 ++---
 include/tcg/tcg.h                             |  144 +-
 tcg/aarch64/tcg-target-has.h                  |   76 +
 tcg/aarch64/tcg-target-mo.h                   |   12 +
 tcg/aarch64/tcg-target.h                      |  126 --
 tcg/arm/tcg-target-has.h                      |   91 ++
 tcg/arm/tcg-target-mo.h                       |   13 +
 tcg/arm/tcg-target.h                          |   86 --
 tcg/i386/tcg-target-con-str.h                 |    2 +-
 tcg/i386/tcg-target-has.h                     |  124 ++
 tcg/i386/tcg-target-mo.h                      |   19 +
 tcg/i386/tcg-target.h                         |  162 --
 tcg/loongarch64/tcg-target-has.h              |   72 +
 tcg/loongarch64/tcg-target-mo.h               |   12 +
 tcg/loongarch64/tcg-target.h                  |  115 --
 tcg/mips/tcg-target-has.h                     |   88 ++
 tcg/mips/tcg-target-mo.h                      |   13 +
 tcg/mips/tcg-target.h                         |  130 --
 tcg/ppc/tcg-target-has.h                      |   86 ++
 tcg/ppc/tcg-target-mo.h                       |   12 +
 tcg/ppc/tcg-target.h                          |  126 --
 tcg/riscv/tcg-target-con-set.h                |    2 +-
 tcg/riscv/tcg-target-con-str.h                |    1 -
 tcg/riscv/tcg-target-has.h                    |   83 ++
 tcg/riscv/tcg-target-mo.h                     |   12 +
 tcg/riscv/tcg-target.h                        |  116 --
 tcg/s390x/tcg-target-has.h                    |   96 ++
 tcg/s390x/tcg-target-mo.h                     |   12 +
 tcg/s390x/tcg-target.h                        |  126 --
 tcg/sparc64/tcg-target-has.h                  |   51 +
 tcg/sparc64/tcg-target-mo.h                   |   12 +
 tcg/sparc64/tcg-target.h                      |   91 --
 tcg/tcg-has.h                                 |   51 +
 tcg/tcg-internal.h                            |   13 +-
 tcg/tci/tcg-target-has.h                      |   42 +
 tcg/tci/tcg-target-mo.h                       |   17 +
 tcg/tci/tcg-target.h                          |   94 --
 target/arm/tcg/translate-a64.c                |   10 +-
 target/arm/tcg/translate-sve.c                |   22 +-
 target/arm/tcg/translate.c                    |    2 +-
 target/sh4/translate.c                        |   26 +-
 target/tricore/translate.c                    |    4 +-
 tcg/optimize.c                                |  813 ++++------
 tcg/tcg-common.c                              |    4 +-
 tcg/tcg-op-gvec.c                             |    1 +
 tcg/tcg-op-ldst.c                             |   43 +-
 tcg/tcg-op-vec.c                              |   49 +-
 tcg/tcg-op.c                                  | 1310 +++++++----------
 tcg/tcg.c                                     | 1099 +++++++-------
 tcg/tci.c                                     |  551 +++----
 docs/devel/tcg-ops.rst                        |   28 +-
 target/i386/tcg/emit.c.inc                    |   20 +-
 ...{tcg-target.opc.h => tcg-target-opc.h.inc} |    4 +-
 tcg/aarch64/tcg-target.c.inc                  |  436 ++----
 ...{tcg-target.opc.h => tcg-target-opc.h.inc} |    6 +-
 tcg/arm/tcg-target.c.inc                      |  278 ++--
 ...{tcg-target.opc.h => tcg-target-opc.h.inc} |   22 +-
 tcg/i386/tcg-target.c.inc                     |  502 +++----
 ...{tcg-target.opc.h => tcg-target-opc.h.inc} |    0
 tcg/loongarch64/tcg-target.c.inc              |  601 ++++----
 tcg/mips/tcg-target-opc.h.inc                 |    1 +
 tcg/mips/tcg-target.c.inc                     |  641 ++++----
 ...{tcg-target.opc.h => tcg-target-opc.h.inc} |   12 +-
 tcg/ppc/tcg-target.c.inc                      |  699 ++++-----
 ...{tcg-target.opc.h => tcg-target-opc.h.inc} |    0
 tcg/riscv/tcg-target.c.inc                    |  624 ++++----
 ...{tcg-target.opc.h => tcg-target-opc.h.inc} |    6 +-
 tcg/s390x/tcg-target.c.inc                    | 1044 ++++++-------
 tcg/sparc64/tcg-target-opc.h.inc              |    1 +
 tcg/sparc64/tcg-target.c.inc                  |  422 +++---
 tcg/tcg-ldst.c.inc                            |   65 -
 tcg/tcg-pool.c.inc                            |  162 --
 tcg/tci/tcg-target-opc.h.inc                  |   15 +
 tcg/tci/tcg-target.c.inc                      |  511 +++----
 77 files changed, 5541 insertions(+), 7167 deletions(-)
 create mode 100644 tcg/aarch64/tcg-target-has.h
 create mode 100644 tcg/aarch64/tcg-target-mo.h
 create mode 100644 tcg/arm/tcg-target-has.h
 create mode 100644 tcg/arm/tcg-target-mo.h
 create mode 100644 tcg/i386/tcg-target-has.h
 create mode 100644 tcg/i386/tcg-target-mo.h
 create mode 100644 tcg/loongarch64/tcg-target-has.h
 create mode 100644 tcg/loongarch64/tcg-target-mo.h
 create mode 100644 tcg/mips/tcg-target-has.h
 create mode 100644 tcg/mips/tcg-target-mo.h
 create mode 100644 tcg/ppc/tcg-target-has.h
 create mode 100644 tcg/ppc/tcg-target-mo.h
 create mode 100644 tcg/riscv/tcg-target-has.h
 create mode 100644 tcg/riscv/tcg-target-mo.h
 create mode 100644 tcg/s390x/tcg-target-has.h
 create mode 100644 tcg/s390x/tcg-target-mo.h
 create mode 100644 tcg/sparc64/tcg-target-has.h
 create mode 100644 tcg/sparc64/tcg-target-mo.h
 create mode 100644 tcg/tcg-has.h
 create mode 100644 tcg/tci/tcg-target-has.h
 create mode 100644 tcg/tci/tcg-target-mo.h
 rename tcg/aarch64/{tcg-target.opc.h => tcg-target-opc.h.inc} (82%)
 rename tcg/arm/{tcg-target.opc.h => tcg-target-opc.h.inc} (75%)
 rename tcg/i386/{tcg-target.opc.h => tcg-target-opc.h.inc} (72%)
 rename tcg/loongarch64/{tcg-target.opc.h => tcg-target-opc.h.inc} (100%)
 create mode 100644 tcg/mips/tcg-target-opc.h.inc
 rename tcg/ppc/{tcg-target.opc.h => tcg-target-opc.h.inc} (83%)
 rename tcg/riscv/{tcg-target.opc.h => tcg-target-opc.h.inc} (100%)
 rename tcg/s390x/{tcg-target.opc.h => tcg-target-opc.h.inc} (75%)
 create mode 100644 tcg/sparc64/tcg-target-opc.h.inc
 delete mode 100644 tcg/tcg-ldst.c.inc
 delete mode 100644 tcg/tcg-pool.c.inc
 create mode 100644 tcg/tci/tcg-target-opc.h.inc

--
2.43.0

Signed-off-by: GitHub Actions Bot <[email protected]>
  • Loading branch information
GitHub Actions Bot committed Jan 2, 2025
1 parent 170b4f9 commit bcab4e3
Show file tree
Hide file tree
Showing 30 changed files with 741 additions and 801 deletions.
343 changes: 343 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,343 @@
on: push

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
checkapply:
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
# to debug container live from GitHub
# - uses: mxschmitt/action-tmate@v3
- run: bash -c '[ ! -f shazam.log ] || { cat shazam.log; exit 1; }'

checkpatch-ignore-signoff:
needs: checkapply
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- run: git fetch -a origin --unshallow || true
- run: git remote add upstream -f https://gitlab.com/qemu-project/qemu
- run: ./scripts/checkpatch.pl --no-signoff $(git merge-base upstream/master HEAD)..HEAD

checkpatch-with-signoff:
needs: checkapply
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- run: git fetch -a origin --unshallow || true
- run: git remote add upstream -f https://gitlab.com/qemu-project/qemu
- run: ./scripts/checkpatch.pl $(git merge-base upstream/master HEAD)..HEAD

# use docker-run to not rebuild images
# images are built daily and pushed on pbolinaro/qemu-ci:*
build-cross:
needs: checkapply
runs-on: ubuntu-24.04
strategy:
fail-fast: false
matrix:
container: [alpine,centos9,debian,debian-all-test-cross,debian-amd64-cross,debian-arm64-cross,debian-armhf-cross,debian-hexagon-cross,debian-i686-cross,debian-legacy-test-cross,debian-loongarch-cross,debian-mips64el-cross,debian-mipsel-cross,debian-ppc64el-cross,debian-riscv64-cross,debian-s390x-cross,debian-tricore-cross,fedora,fedora-rust-nightly,opensuse-leap,ubuntu2204]
steps:
- uses: actions/checkout@v4
- run: pip install meson
- run: make docker-run J=$(nproc) RUNC=podman TEST=test-build IMAGE=docker.io/pbolinaro/qemu-ci:${{matrix.container}}

build:
needs: checkapply
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- run: >
podman run --init --rm -it -v $(pwd):$(pwd) -w $(pwd)
docker.io/pbolinaro/qemu-ci:debian
bash -cx './configure && ninja -C build install'
- run: >
podman run --init --rm -it -v $(pwd):$(pwd) -w $(pwd)
docker.io/pbolinaro/qemu-ci:debian
./build/qemu-system-x86_64 -nographic -plugin ./build/contrib/plugins/libstoptrigger,icount=1000000 -plugin ./build/tests/tcg/plugins/libinsn -d plugin
build-cross-mingw64:
needs: checkapply
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- run: >
podman run --init --rm -it -v $(pwd):$(pwd) -w $(pwd)
docker.io/pbolinaro/qemu-ci:fedora-win64-cross
bash -cx './configure $QEMU_CONFIGURE_OPTS && ninja -C build install'
build-windows:
needs: checkapply
runs-on: windows-2025
strategy:
fail-fast: false
matrix:
sys: [UCRT64, CLANG64, MINGW64]
defaults:
run:
shell: msys2 {0}
steps:
- uses: msys2/setup-msys2@v2
with:
update: true
msystem: ${{matrix.sys}}
- run: pacman -S --noconfirm curl git
- uses: actions/checkout@v4
- run: >
pacman -S --noconfirm
base-devel binutils bison diffutils flex git grep make sed
${MINGW_PACKAGE_PREFIX}-toolchain
${MINGW_PACKAGE_PREFIX}-glib2
${MINGW_PACKAGE_PREFIX}-gtk3
${MINGW_PACKAGE_PREFIX}-libnfs
${MINGW_PACKAGE_PREFIX}-libssh
${MINGW_PACKAGE_PREFIX}-ninja
${MINGW_PACKAGE_PREFIX}-pixman
${MINGW_PACKAGE_PREFIX}-pkgconf
${MINGW_PACKAGE_PREFIX}-python
${MINGW_PACKAGE_PREFIX}-SDL2
${MINGW_PACKAGE_PREFIX}-zstd
- run: ./configure && ninja -C build
- run: ./build/qemu-system-x86_64 -nographic -plugin ./build/contrib/plugins/libstoptrigger,icount=1000000 -plugin ./build/tests/tcg/plugins/libinsn -d plugin

build-macos-x86_64:
needs: checkapply
runs-on: macos-13
steps:
- uses: actions/checkout@v4
- run: brew install --quiet $(brew deps --include-build qemu) || true
# on macos, werror is not on by default
- run: ./configure --enable-werror && ninja -C build
- run: ./build/qemu-system-x86_64 -nographic -plugin ./build/contrib/plugins/libstoptrigger,icount=1000000 -plugin ./build/tests/tcg/plugins/libinsn -d plugin

build-macos-aarch64:
needs: checkapply
runs-on: macos-14
steps:
- uses: actions/checkout@v4
- run: brew install --quiet $(brew deps --include-build qemu) || true
# on macos, werror is not on by default
- run: ./configure --enable-werror && ninja -C build
- run: ./build/qemu-system-x86_64 -nographic -plugin ./build/contrib/plugins/libstoptrigger,icount=1000000 -plugin ./build/tests/tcg/plugins/libinsn -d plugin

build-misc:
needs: checkapply
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- run: >
podman run --init --rm -it -v $(pwd):$(pwd) -w $(pwd)
docker.io/pbolinaro/qemu-ci:debian
bash -cx './configure --disable-user --disable-system --enable-docs --enable-tools && ninja -C build install'
build-32bits:
needs: checkapply
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- run: >
podman run --init --rm -it -v $(pwd):$(pwd) -w $(pwd)
docker.io/pbolinaro/qemu-ci:debian-i686-cross
bash -cx './configure $QEMU_CONFIGURE_OPTS && ninja -C build install'
build-big-endian:
needs: checkapply
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- run: >
podman run --init --rm -it -v $(pwd):$(pwd) -w $(pwd)
docker.io/pbolinaro/qemu-ci:debian-s390x-cross
bash -cx './configure $QEMU_CONFIGURE_OPTS && ninja -C build install'
build-debug:
needs: checkapply
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- run: >
podman run --init --rm -it -v $(pwd):$(pwd) -w $(pwd)
docker.io/pbolinaro/qemu-ci:debian
bash -cx './configure --enable-debug --enable-asan --enable-ubsan && ninja -C build install'
- run: >
podman run --init --rm -it -v $(pwd):$(pwd) -w $(pwd)
docker.io/pbolinaro/qemu-ci:debian
./build/qemu-system-x86_64 -nographic -plugin ./build/contrib/plugins/libstoptrigger,icount=1000000 -plugin ./build/tests/tcg/plugins/libinsn -d plugin
build-static:
needs: checkapply
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- run: >
podman run --init --rm -it -v $(pwd):$(pwd) -w $(pwd)
docker.io/pbolinaro/qemu-ci:debian
bash -cx './configure --disable-system --disable-tools --disable-guest-agent --disable-docs --static && ninja -C build install'
build-tsan:
needs: checkapply
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- run: >
podman run --init --rm -it -v $(pwd):$(pwd) -w $(pwd)
docker.io/pbolinaro/qemu-ci:debian
bash -cx './configure --enable-tsan && ninja -C build install'
build-clang:
needs: checkapply
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- run: >
podman run --init --rm -it -v $(pwd):$(pwd) -w $(pwd)
docker.io/pbolinaro/qemu-ci:debian
bash -cx './configure --cxx=clang++ --cc=clang --host-cc=clang && ninja -C build install'
build-clang-latest:
needs: checkapply
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- run: >
podman run --init --rm -it -v $(pwd):$(pwd) -w $(pwd)
docker.io/pbolinaro/qemu-ci:debian
bash -cx 'LLVM_VERSION=19 && apt update && apt install -y lsb-release wget software-properties-common gnupg && wget https://apt.llvm.org/llvm.sh && bash llvm.sh ${LLVM_VERSION} && ./configure --cxx=clang++-${LLVM_VERSION} --cc=clang-${LLVM_VERSION} --host-cc=clang-${LLVM_VERSION} && ninja -C build install'
build-rust:
needs: checkapply
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- run: >
podman run --init --rm -it -v $(pwd):$(pwd) -w $(pwd)
docker.io/pbolinaro/qemu-ci:fedora-rust-nightly
bash -cx 'cargo install [email protected] && ./configure $QEMU_CONFIGURE_OPTS --enable-rust && ninja -C build install'
build-disable-tcg:
needs: checkapply
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- run: >
podman run --init --rm -it -v $(pwd):$(pwd) -w $(pwd)
docker.io/pbolinaro/qemu-ci:debian
bash -cx './configure --disable-tcg && ninja -C build install'
build-disable-kvm:
needs: checkapply
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- run: >
podman run --init --rm -it -v $(pwd):$(pwd) -w $(pwd)
docker.io/pbolinaro/qemu-ci:debian
bash -cx './configure --disable-kvm && ninja -C build install'
build-disable-tcg-kvm-for-xen:
needs: checkapply
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- run: >
podman run --init --rm -it -v $(pwd):$(pwd) -w $(pwd)
docker.io/pbolinaro/qemu-ci:debian
bash -cx './configure --disable-tcg --disable-kvm && ninja -C build install'
build-minimal:
needs: checkapply
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- run: >
podman run --init --rm -it -v $(pwd):$(pwd) -w $(pwd)
docker.io/pbolinaro/qemu-ci:debian
bash -cx './configure --without-default-features --without-default-devices --disable-kvm --disable-tcg && ninja -C build install'
check-tcg:
needs: checkapply
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- run: >
podman run --init --rm -it -v $(pwd):$(pwd) -w $(pwd)
docker.io/pbolinaro/qemu-ci:debian-all-test-cross
bash -cx './configure $QEMU_CONFIGURE_OPTS --disable-docs --enable-debug-tcg --enable-debug-graph-lock --enable-debug-mutex --enable-asan --enable-ubsan && ninja -C build'
- run: >
podman run --init --privileged --rm -it -v $(pwd):$(pwd) -w $(pwd)
docker.io/pbolinaro/qemu-ci:debian-all-test-cross
bash -cx "env ASAN_OPTIONS=detect_leaks=0 make -k -j $(nproc) check-tcg"
# run all meson tests, except functional.
# block tests are not ran because they don't support sanitizers:
# https://gitlab.com/qemu-project/qemu/-/blob/master/tests/qemu-iotests/meson.build
check:
needs: checkapply
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
# we use image with download cache filled. Solves servers flakiness.
- run: >
podman run --init --rm -it -v $(pwd):$(pwd) -w $(pwd)
docker.io/pbolinaro/qemu-ci:debian-precache-tests
bash -cx './configure --disable-docs --enable-debug-tcg --enable-debug-graph-lock --enable-debug-mutex --enable-asan --enable-ubsan && ninja -C build'
- run: sudo chown $USER:$USER /dev/kvm
- run: >
podman run --init --privileged --rm -i -v /dev/kvm:/dev/kvm -v $(pwd):$(pwd) -w $(pwd)
docker.io/pbolinaro/qemu-ci:debian-precache-tests
bash -cx "env ASAN_OPTIONS=detect_leaks=0 ./build/pyvenv/bin/meson test -C build --setup thorough --no-suite func-quick --no-suite func-thorough -t 5 --print-errorlogs"
check-functional:
needs: checkapply
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
# we use image with download cache filled. Solves servers flakiness.
- run: >
podman run --init --rm -it -v $(pwd):$(pwd) -w $(pwd)
docker.io/pbolinaro/qemu-ci:debian-precache-tests
bash -cx './configure --disable-docs --enable-debug-tcg --enable-debug-graph-lock --enable-debug-mutex --enable-asan --enable-ubsan && ninja -C build'
- run: sudo chown $USER:$USER /dev/kvm
- run: >
podman run --init --privileged --rm -i -v /dev/kvm:/dev/kvm -v $(pwd):$(pwd) -w $(pwd)
docker.io/pbolinaro/qemu-ci:debian-precache-tests
bash -cx "env ASAN_OPTIONS=detect_leaks=0 ./build/pyvenv/bin/meson test -C build --setup thorough --suite func-quick --suite func-thorough -j $(($(nproc) / 2)) -t 5 --print-errorlogs"
# Limit parallelism because it creates timeout.
# iotests do not support sanitizers, so we run them in their own job
check-block:
needs: checkapply
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
# we use image with download cache filled. Solves servers flakiness.
- run: >
podman run --init --rm -it -v $(pwd):$(pwd) -w $(pwd)
docker.io/pbolinaro/qemu-ci:debian-precache-tests
bash -cx './configure --disable-docs --enable-debug-tcg --enable-debug-graph-lock --enable-debug-mutex && ninja -C build'
- run: sudo chown $USER:$USER /dev/kvm
- run: >
podman run --init --privileged --rm -i -v /dev/kvm:/dev/kvm -v $(pwd):$(pwd) -w $(pwd)
docker.io/pbolinaro/qemu-ci:debian-precache-tests
bash -cx "./build/pyvenv/bin/meson test -C build --setup thorough --suite block --suite block-slow --suite block-thorough -t 5 --print-errorlogs"
check-avocado:
needs: checkapply
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
# add more time for all tests
- run: sed -i -e 's/timeout = .*/timeout = 3600/' $(find tests/avocado/ -type f)
# we use image with download cache filled. Solves servers flakiness.
- run: >
podman run --init --rm -it -v $(pwd):$(pwd) -w $(pwd)
docker.io/pbolinaro/qemu-ci:debian-precache-tests
bash -cx './configure --disable-docs --enable-debug-tcg --enable-debug-graph-lock --enable-debug-mutex --enable-asan --enable-ubsan && ninja -C build'
- run: sudo chown $USER:$USER /dev/kvm
- run: >
podman run --init --privileged --rm -it -v /dev/kvm:/dev/kvm -v $(pwd):$(pwd) -w $(pwd)
docker.io/pbolinaro/qemu-ci:debian-precache-tests
bash -cx "env ASAN_OPTIONS=detect_leaks=0 make -k check-avocado V=1"
41 changes: 41 additions & 0 deletions .github/workflows/containers.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
on:
schedule:
- cron: '0 6 * * *'
workflow_dispatch:

permissions: write-all

jobs:
build_container:
runs-on: ubuntu-24.04
strategy:
fail-fast: false
matrix:
# cd tests/docker/dockerfiles/
# ls *docker | sed -e 's/.docker//' | tr '\n' ','
# remove: debian-bootstrap,debian-toolchain
container: [alpine,centos9,debian-all-test-cross,debian-amd64-cross,debian-arm64-cross,debian-armhf-cross,debian,debian-hexagon-cross,debian-i686-cross,debian-legacy-test-cross,debian-loongarch-cross,debian-mips64el-cross,debian-mipsel-cross,debian-ppc64el-cross,debian-riscv64-cross,debian-s390x-cross,debian-tricore-cross,debian-xtensa-cross,fedora,fedora-rust-nightly,fedora-win64-cross,opensuse-leap,python,ubuntu2204]
steps:
- uses: actions/checkout@v4
- run: make docker-image-${{matrix.container}} RUNC=podman V=1
- run: podman tag qemu/${{matrix.container}} docker.io/pbolinaro/qemu-ci:${{matrix.container}}
- run: podman login -u pbolinaro -p ${{secrets.DOCKERHUB_PASSWORD}}
- run: podman push docker.io/pbolinaro/qemu-ci:${{matrix.container}}

build_container_debian-precache-tests:
runs-on: ubuntu-24.04
steps:
# we clean up runner first, to get more disk space
- run: docker system prune -af && sudo rm -rf /opt/*
- uses: actions/checkout@v4
- run: make docker-image-debian RUNC=podman V=1
# fill download cache for functional and check-avocado
# running check-avocado without any qemu binary will only download data
# in /root/avocado
- run: >
podman run -it -v $(pwd):$(pwd) -w $(pwd) qemu/debian
./precache_tests.sh
# commit result as a new image. Cache will be in /root/.cache and /root/avocado
- run: podman commit "$(podman ps -aq)" docker.io/pbolinaro/qemu-ci:debian-precache-tests
- run: podman login -u pbolinaro -p ${{secrets.DOCKERHUB_PASSWORD}}
- run: podman push docker.io/pbolinaro/qemu-ci:debian-precache-tests
Loading

0 comments on commit bcab4e3

Please sign in to comment.