mirror of
https://github.com/izzy2lost/xemu.git
synced 2026-07-06 00:20:22 -07:00
Merge remote-tracking branch 'remotes/stsquad/tags/pull-testing-and-misc-110720-2' into staging
Testing and misc build updates: - tests/vm support for aarch64 VMs - tests/tcg better cross-compiler detection - update docker tooling to support registries - update docker support for xtensa - gitlab build docker images and store in registry - gitlab use docker images for builds - a number of skipIf updates to support move - linux-user MAP_FIXED_NOREPLACE fix - qht-bench compiler tweaks - configure fix for secret keyring - tsan fiber annotation clean-up - doc updates for mttcg/icount/gdbstub - fix cirrus to use brew bash for iotests - revert virtio-gpu breakage - fix LC_ALL to avoid sorting changes in iotests # gpg: Signature made Sat 11 Jul 2020 15:56:42 BST # gpg: using RSA key 6685AE99E75167BCAFC8DF35FBD0DB095A9E2A44 # gpg: Good signature from "Alex Bennée (Master Work Key) <alex.bennee@linaro.org>" [full] # Primary key fingerprint: 6685 AE99 E751 67BC AFC8 DF35 FBD0 DB09 5A9E 2A44 * remotes/stsquad/tags/pull-testing-and-misc-110720-2: (50 commits) iotests: Set LC_ALL=C for sort Revert "vga: build virtio-gpu as module" tests: fix "make check-qtest" for modular builds .cirrus.yml: add bash to the brew packages tests/docker: update toolchain set in debian-xtensa-cross tests/docker: fall back more gracefully when pull fails docs: Add to gdbstub documentation the PhyMemMode docs/devel: add some notes on tcg-icount for developers docs/devel: convert and update MTTCG design document tests/qht-bench: Adjust threshold computation tests/qht-bench: Adjust testing rate by -1 travis.yml: Test also the other targets on s390x shippable: pull images from registry instead of building testing: add check-build target containers.yml: build with docker.py tooling gitlab: limit re-builds of the containers tests: improve performance of device-introspect-test gitlab: add avocado asset caching gitlab: enable check-tcg for linux-user tests linux-user/elfload: use MAP_FIXED_NOREPLACE in pgb_reserved_va ... Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
This commit is contained in:
+2
-2
@@ -20,7 +20,7 @@ macos_task:
|
||||
osx_instance:
|
||||
image: mojave-base
|
||||
install_script:
|
||||
- brew install pkg-config python gnu-sed glib pixman make sdl2
|
||||
- brew install pkg-config python gnu-sed glib pixman make sdl2 bash
|
||||
script:
|
||||
- mkdir build
|
||||
- cd build
|
||||
@@ -33,7 +33,7 @@ macos_xcode_task:
|
||||
# this is an alias for the latest Xcode
|
||||
image: mojave-xcode
|
||||
install_script:
|
||||
- brew install pkg-config gnu-sed glib pixman make sdl2
|
||||
- brew install pkg-config gnu-sed glib pixman make sdl2 bash
|
||||
script:
|
||||
- mkdir build
|
||||
- cd build
|
||||
|
||||
@@ -93,6 +93,7 @@
|
||||
*.tp
|
||||
*.vr
|
||||
*.d
|
||||
!/.gitlab-ci.d
|
||||
!/scripts/qemu-guest-agent/fsfreeze-hook.d
|
||||
*.o
|
||||
.sdk
|
||||
|
||||
@@ -0,0 +1,263 @@
|
||||
.container_job_template: &container_job_definition
|
||||
image: docker:stable
|
||||
stage: containers
|
||||
services:
|
||||
- docker:dind
|
||||
before_script:
|
||||
- export TAG="$CI_REGISTRY_IMAGE/qemu/$NAME:latest"
|
||||
- export COMMON_TAG="$CI_REGISTRY/qemu-project/qemu/$NAME:latest"
|
||||
- apk add python3
|
||||
- docker info
|
||||
- docker login registry.gitlab.com -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD"
|
||||
script:
|
||||
- echo "TAG:$TAG"
|
||||
- echo "COMMON_TAG:$COMMON_TAG"
|
||||
- docker pull "$TAG" || docker pull "$COMMON_TAG" || true
|
||||
- ./tests/docker/docker.py --engine docker build
|
||||
-t "qemu/$NAME" -f "tests/docker/dockerfiles/$NAME.docker"
|
||||
-r $CI_REGISTRY_IMAGE
|
||||
- docker tag "qemu/$NAME" "$TAG"
|
||||
- docker push "$TAG"
|
||||
after_script:
|
||||
- docker logout
|
||||
rules:
|
||||
- changes:
|
||||
- .gitlab-ci.d/containers.yml
|
||||
- tests/docker/*
|
||||
- if: '$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH'
|
||||
- if: '$CI_COMMIT_REF_NAME == "testing/next"'
|
||||
|
||||
amd64-centos7-container:
|
||||
<<: *container_job_definition
|
||||
variables:
|
||||
NAME: centos7
|
||||
|
||||
amd64-centos8-container:
|
||||
<<: *container_job_definition
|
||||
variables:
|
||||
NAME: centos8
|
||||
|
||||
amd64-debian10-container:
|
||||
<<: *container_job_definition
|
||||
variables:
|
||||
NAME: debian10
|
||||
|
||||
amd64-debian11-container:
|
||||
<<: *container_job_definition
|
||||
variables:
|
||||
NAME: debian11
|
||||
|
||||
amd64-debian9-container:
|
||||
<<: *container_job_definition
|
||||
variables:
|
||||
NAME: debian9
|
||||
|
||||
amd64-debian9-mxe-container:
|
||||
<<: *container_job_definition
|
||||
stage: containers-layer2
|
||||
needs: ['amd64-debian9-container']
|
||||
variables:
|
||||
NAME: debian9-mxe
|
||||
|
||||
alpha-debian-cross-container:
|
||||
<<: *container_job_definition
|
||||
stage: containers-layer2
|
||||
needs: ['amd64-debian10-container']
|
||||
variables:
|
||||
NAME: debian-alpha-cross
|
||||
|
||||
amd64-debian-cross-container:
|
||||
<<: *container_job_definition
|
||||
stage: containers-layer2
|
||||
needs: ['amd64-debian10-container']
|
||||
variables:
|
||||
NAME: debian-amd64-cross
|
||||
|
||||
amd64-debian-user-cross-container:
|
||||
<<: *container_job_definition
|
||||
stage: containers-layer2
|
||||
needs: ['amd64-debian10-container']
|
||||
variables:
|
||||
NAME: debian-all-test-cross
|
||||
|
||||
amd64-debian-container:
|
||||
<<: *container_job_definition
|
||||
stage: containers-layer2
|
||||
needs: ['amd64-debian10-container']
|
||||
variables:
|
||||
NAME: debian-amd64
|
||||
|
||||
arm64-debian-cross-container:
|
||||
<<: *container_job_definition
|
||||
stage: containers-layer2
|
||||
needs: ['amd64-debian10-container']
|
||||
variables:
|
||||
NAME: debian-arm64-cross
|
||||
|
||||
arm64-test-debian-cross-container:
|
||||
<<: *container_job_definition
|
||||
stage: containers-layer2
|
||||
needs: ['amd64-debian11-container']
|
||||
variables:
|
||||
NAME: debian-arm64-test-cross
|
||||
|
||||
armel-debian-cross-container:
|
||||
<<: *container_job_definition
|
||||
stage: containers-layer2
|
||||
needs: ['amd64-debian10-container']
|
||||
variables:
|
||||
NAME: debian-armel-cross
|
||||
|
||||
armhf-debian-cross-container:
|
||||
<<: *container_job_definition
|
||||
stage: containers-layer2
|
||||
needs: ['amd64-debian10-container']
|
||||
variables:
|
||||
NAME: debian-armhf-cross
|
||||
|
||||
hppa-debian-cross-container:
|
||||
<<: *container_job_definition
|
||||
stage: containers-layer2
|
||||
needs: ['amd64-debian10-container']
|
||||
variables:
|
||||
NAME: debian-hppa-cross
|
||||
|
||||
m68k-debian-cross-container:
|
||||
<<: *container_job_definition
|
||||
stage: containers-layer2
|
||||
needs: ['amd64-debian10-container']
|
||||
variables:
|
||||
NAME: debian-m68k-cross
|
||||
|
||||
mips64-debian-cross-container:
|
||||
<<: *container_job_definition
|
||||
stage: containers-layer2
|
||||
needs: ['amd64-debian10-container']
|
||||
variables:
|
||||
NAME: debian-mips64-cross
|
||||
|
||||
mips64el-debian-cross-container:
|
||||
<<: *container_job_definition
|
||||
stage: containers-layer2
|
||||
needs: ['amd64-debian10-container']
|
||||
variables:
|
||||
NAME: debian-mips64el-cross
|
||||
|
||||
mips-debian-cross-container:
|
||||
<<: *container_job_definition
|
||||
stage: containers-layer2
|
||||
needs: ['amd64-debian10-container']
|
||||
variables:
|
||||
NAME: debian-mips-cross
|
||||
|
||||
mipsel-debian-cross-container:
|
||||
<<: *container_job_definition
|
||||
stage: containers-layer2
|
||||
needs: ['amd64-debian10-container']
|
||||
variables:
|
||||
NAME: debian-mipsel-cross
|
||||
|
||||
powerpc-debian-cross-container:
|
||||
<<: *container_job_definition
|
||||
stage: containers-layer2
|
||||
needs: ['amd64-debian10-container']
|
||||
variables:
|
||||
NAME: debian-powerpc-cross
|
||||
|
||||
ppc64-debian-cross-container:
|
||||
<<: *container_job_definition
|
||||
stage: containers-layer2
|
||||
needs: ['amd64-debian10-container']
|
||||
variables:
|
||||
NAME: debian-ppc64-cross
|
||||
|
||||
ppc64el-debian-cross-container:
|
||||
<<: *container_job_definition
|
||||
stage: containers-layer2
|
||||
needs: ['amd64-debian10-container']
|
||||
variables:
|
||||
NAME: debian-ppc64el-cross
|
||||
|
||||
riscv64-debian-cross-container:
|
||||
<<: *container_job_definition
|
||||
stage: containers-layer2
|
||||
needs: ['amd64-debian10-container']
|
||||
variables:
|
||||
NAME: debian-riscv64-cross
|
||||
|
||||
s390x-debian-cross-container:
|
||||
<<: *container_job_definition
|
||||
stage: containers-layer2
|
||||
needs: ['amd64-debian10-container']
|
||||
variables:
|
||||
NAME: debian-s390x-cross
|
||||
|
||||
sh4-debian-cross-container:
|
||||
<<: *container_job_definition
|
||||
stage: containers-layer2
|
||||
needs: ['amd64-debian10-container']
|
||||
variables:
|
||||
NAME: debian-sh4-cross
|
||||
|
||||
sparc64-debian-cross-container:
|
||||
<<: *container_job_definition
|
||||
stage: containers-layer2
|
||||
needs: ['amd64-debian10-container']
|
||||
variables:
|
||||
NAME: debian-sparc64-cross
|
||||
|
||||
tricore-debian-cross-container:
|
||||
<<: *container_job_definition
|
||||
stage: containers-layer2
|
||||
needs: ['amd64-debian9-container']
|
||||
variables:
|
||||
NAME: debian-tricore-cross
|
||||
|
||||
win32-debian-cross-container:
|
||||
<<: *container_job_definition
|
||||
stage: containers-layer3
|
||||
needs: ['amd64-debian9-mxe-container']
|
||||
variables:
|
||||
NAME: debian-win32-cross
|
||||
|
||||
win64-debian-cross-container:
|
||||
<<: *container_job_definition
|
||||
stage: containers-layer3
|
||||
needs: ['amd64-debian9-mxe-container']
|
||||
variables:
|
||||
NAME: debian-win64-cross
|
||||
|
||||
xtensa-debian-cross-container:
|
||||
<<: *container_job_definition
|
||||
variables:
|
||||
NAME: debian-xtensa-cross
|
||||
|
||||
cris-fedora-cross-container:
|
||||
<<: *container_job_definition
|
||||
variables:
|
||||
NAME: fedora-cris-cross
|
||||
|
||||
amd64-fedora-container:
|
||||
<<: *container_job_definition
|
||||
variables:
|
||||
NAME: fedora
|
||||
|
||||
i386-fedora-cross-container:
|
||||
<<: *container_job_definition
|
||||
variables:
|
||||
NAME: fedora-i386-cross
|
||||
|
||||
amd64-ubuntu1804-container:
|
||||
<<: *container_job_definition
|
||||
variables:
|
||||
NAME: ubuntu1804
|
||||
|
||||
amd64-ubuntu2004-container:
|
||||
<<: *container_job_definition
|
||||
variables:
|
||||
NAME: ubuntu2004
|
||||
|
||||
amd64-ubuntu-container:
|
||||
<<: *container_job_definition
|
||||
variables:
|
||||
NAME: ubuntu
|
||||
@@ -1,8 +1,8 @@
|
||||
docker-edk2:
|
||||
stage: build
|
||||
stage: containers
|
||||
rules: # Only run this job when the Dockerfile is modified
|
||||
- changes:
|
||||
- .gitlab-ci-edk2.yml
|
||||
- .gitlab-ci.d/edk2.yml
|
||||
- .gitlab-ci.d/edk2/Dockerfile
|
||||
when: always
|
||||
image: docker:19.03.1
|
||||
@@ -24,6 +24,7 @@ docker-edk2:
|
||||
- docker push $IMAGE_TAG
|
||||
|
||||
build-edk2:
|
||||
stage: build
|
||||
rules: # Only run this job when ...
|
||||
- changes: # ... roms/edk2/ is modified (submodule updated)
|
||||
- roms/edk2/*
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
docker-opensbi:
|
||||
stage: build
|
||||
stage: containers
|
||||
rules: # Only run this job when the Dockerfile is modified
|
||||
- changes:
|
||||
- .gitlab-ci-opensbi.yml
|
||||
- .gitlab-ci.d/opensbi.yml
|
||||
- .gitlab-ci.d/opensbi/Dockerfile
|
||||
when: always
|
||||
image: docker:19.03.1
|
||||
@@ -24,6 +24,7 @@ docker-opensbi:
|
||||
- docker push $IMAGE_TAG
|
||||
|
||||
build-opensbi:
|
||||
stage: build
|
||||
rules: # Only run this job when ...
|
||||
- changes: # ... roms/opensbi/ is modified (submodule updated)
|
||||
- roms/opensbi/*
|
||||
|
||||
+159
-100
@@ -1,127 +1,186 @@
|
||||
# Currently we have two build stages after our containers are built:
|
||||
# - build (for traditional build and test or first stage build)
|
||||
# - test (for test stages, using build artefacts from a build stage)
|
||||
stages:
|
||||
- containers
|
||||
- containers-layer2
|
||||
- containers-layer3
|
||||
- build
|
||||
- test
|
||||
|
||||
# We assume GitLab has it's own caching set up for RPM/APT repositories so we
|
||||
# just take care of avocado assets here.
|
||||
cache:
|
||||
paths:
|
||||
- $HOME/avocado/data/cache
|
||||
|
||||
include:
|
||||
- local: '/.gitlab-ci.d/edk2.yml'
|
||||
- local: '/.gitlab-ci.d/opensbi.yml'
|
||||
- local: '/.gitlab-ci.d/containers.yml'
|
||||
|
||||
.update_apt_template: &before_script_apt
|
||||
before_script:
|
||||
- apt-get update -qq
|
||||
- apt-get install -y -qq git gcc libglib2.0-dev libpixman-1-dev make
|
||||
genisoimage
|
||||
- JOBS=$(expr $(nproc) + 1)
|
||||
.native_build_job_template: &native_build_job_definition
|
||||
stage: build
|
||||
image: $CI_REGISTRY_IMAGE/qemu/$IMAGE:latest
|
||||
before_script:
|
||||
- JOBS=$(expr $(nproc) + 1)
|
||||
script:
|
||||
- mkdir build
|
||||
- cd build
|
||||
- if test -n "$TARGETS";
|
||||
then
|
||||
../configure --enable-werror $CONFIGURE_ARGS --target-list="$TARGETS" ;
|
||||
else
|
||||
../configure --enable-werror $CONFIGURE_ARGS ;
|
||||
fi
|
||||
- make -j"$JOBS"
|
||||
- if test -n "$MAKE_CHECK_ARGS";
|
||||
then
|
||||
make -j"$JOBS" $MAKE_CHECK_ARGS ;
|
||||
fi
|
||||
|
||||
.update_dnf_template: &before_script_dnf
|
||||
before_script:
|
||||
- dnf update -y
|
||||
- dnf install -y bzip2 diffutils gcc git genisoimage findutils glib2-devel
|
||||
make python3 perl-podlators perl-Test-Harness pixman-devel zlib-devel
|
||||
- JOBS=$(expr $(nproc) + 1)
|
||||
.native_test_job_template: &native_test_job_definition
|
||||
stage: test
|
||||
image: $CI_REGISTRY_IMAGE/qemu/$IMAGE:latest
|
||||
script:
|
||||
- cd build
|
||||
- find . -type f -exec touch {} +
|
||||
- make $MAKE_CHECK_ARGS
|
||||
|
||||
build-system1:
|
||||
image: ubuntu:19.10
|
||||
<<: *before_script_apt
|
||||
script:
|
||||
- apt-get install -y -qq libgtk-3-dev libvte-dev nettle-dev libcacard-dev
|
||||
libusb-dev libvde-dev libspice-protocol-dev libgl1-mesa-dev libvdeplug-dev
|
||||
- mkdir build
|
||||
- cd build
|
||||
- ../configure --enable-werror --target-list="aarch64-softmmu alpha-softmmu
|
||||
cris-softmmu hppa-softmmu lm32-softmmu moxie-softmmu microblazeel-softmmu
|
||||
mips64el-softmmu m68k-softmmu ppc-softmmu riscv64-softmmu sparc-softmmu"
|
||||
- make -j"$JOBS"
|
||||
- make -j"$JOBS" check
|
||||
.post_acceptance_template: &post_acceptance
|
||||
after_script:
|
||||
- cd build
|
||||
- python3 -c 'import json; r = json.load(open("tests/results/latest/results.json")); [print(t["logfile"]) for t in r["tests"] if t["status"] not in ("PASS", "SKIP")]' | xargs cat
|
||||
- du -chs $HOME/avocado/data/cache
|
||||
|
||||
build-system2:
|
||||
image: fedora:latest
|
||||
<<: *before_script_dnf
|
||||
script:
|
||||
- yum install -y SDL2-devel libgcrypt-devel brlapi-devel libaio-devel
|
||||
libfdt-devel lzo-devel librdmacm-devel libibverbs-devel libibumad-devel
|
||||
libzstd-devel
|
||||
- mkdir build
|
||||
- cd build
|
||||
- ../configure --enable-werror --target-list="tricore-softmmu unicore32-softmmu
|
||||
microblaze-softmmu mips-softmmu riscv32-softmmu s390x-softmmu sh4-softmmu
|
||||
sparc64-softmmu x86_64-softmmu xtensa-softmmu nios2-softmmu or1k-softmmu"
|
||||
- make -j"$JOBS"
|
||||
- make -j"$JOBS" check
|
||||
build-system-ubuntu-main:
|
||||
<<: *native_build_job_definition
|
||||
variables:
|
||||
IMAGE: ubuntu2004
|
||||
TARGETS: aarch64-softmmu alpha-softmmu cris-softmmu hppa-softmmu lm32-softmmu
|
||||
moxie-softmmu microblazeel-softmmu mips64el-softmmu m68k-softmmu ppc-softmmu
|
||||
riscv64-softmmu sparc-softmmu
|
||||
MAKE_CHECK_ARGS: check-build
|
||||
artifacts:
|
||||
paths:
|
||||
- build
|
||||
|
||||
check-system-ubuntu-main:
|
||||
<<: *native_test_job_definition
|
||||
needs:
|
||||
- job: build-system-ubuntu-main
|
||||
artifacts: true
|
||||
variables:
|
||||
IMAGE: ubuntu2004
|
||||
MAKE_CHECK_ARGS: check
|
||||
|
||||
acceptance-system-ubuntu-main:
|
||||
<<: *native_test_job_definition
|
||||
needs:
|
||||
- job: build-system-ubuntu-main
|
||||
artifacts: true
|
||||
variables:
|
||||
IMAGE: ubuntu2004
|
||||
MAKE_CHECK_ARGS: check-acceptance
|
||||
<<: *post_acceptance
|
||||
|
||||
build-system-fedora-alt:
|
||||
<<: *native_build_job_definition
|
||||
variables:
|
||||
IMAGE: fedora
|
||||
TARGETS: tricore-softmmu unicore32-softmmu microblaze-softmmu mips-softmmu
|
||||
riscv32-softmmu s390x-softmmu sh4-softmmu sparc64-softmmu x86_64-softmmu
|
||||
xtensa-softmmu nios2-softmmu or1k-softmmu
|
||||
MAKE_CHECK_ARGS: check-build
|
||||
artifacts:
|
||||
paths:
|
||||
- build
|
||||
|
||||
check-system-fedora-alt:
|
||||
<<: *native_test_job_definition
|
||||
needs:
|
||||
- job: build-system-fedora-alt
|
||||
artifacts: true
|
||||
variables:
|
||||
IMAGE: fedora
|
||||
MAKE_CHECK_ARGS: check
|
||||
|
||||
acceptance-system-fedora-alt:
|
||||
<<: *native_test_job_definition
|
||||
needs:
|
||||
- job: build-system-fedora-alt
|
||||
artifacts: true
|
||||
variables:
|
||||
IMAGE: fedora
|
||||
MAKE_CHECK_ARGS: check-acceptance
|
||||
<<: *post_acceptance
|
||||
|
||||
build-disabled:
|
||||
image: fedora:latest
|
||||
<<: *before_script_dnf
|
||||
script:
|
||||
- mkdir build
|
||||
- cd build
|
||||
- ../configure --enable-werror --disable-rdma --disable-slirp --disable-curl
|
||||
<<: *native_build_job_definition
|
||||
variables:
|
||||
IMAGE: fedora
|
||||
CONFIGURE_ARGS: --disable-rdma --disable-slirp --disable-curl
|
||||
--disable-capstone --disable-live-block-migration --disable-glusterfs
|
||||
--disable-replication --disable-coroutine-pool --disable-smartcard
|
||||
--disable-guest-agent --disable-curses --disable-libxml2 --disable-tpm
|
||||
--disable-qom-cast-debug --disable-spice --disable-vhost-vsock
|
||||
--disable-vhost-net --disable-vhost-crypto --disable-vhost-user
|
||||
--target-list="i386-softmmu ppc64-softmmu mips64-softmmu i386-linux-user"
|
||||
- make -j"$JOBS"
|
||||
- make -j"$JOBS" check-qtest SPEED=slow
|
||||
TARGETS: i386-softmmu ppc64-softmmu mips64-softmmu i386-linux-user
|
||||
MAKE_CHECK_ARGS: check-qtest SPEED=slow
|
||||
|
||||
build-tcg-disabled:
|
||||
image: centos:8
|
||||
<<: *before_script_dnf
|
||||
script:
|
||||
- dnf install -y clang gtk3-devel libusbx-devel libgcrypt-devel
|
||||
- mkdir build
|
||||
- cd build
|
||||
- ../configure --cc=clang --enable-werror --disable-tcg --audio-drv-list=""
|
||||
- make -j"$JOBS"
|
||||
- make check-unit
|
||||
- make check-qapi-schema
|
||||
- cd tests/qemu-iotests/
|
||||
- ./check -raw 001 002 003 004 005 008 009 010 011 012 021 025 032 033 048
|
||||
<<: *native_build_job_definition
|
||||
variables:
|
||||
IMAGE: centos8
|
||||
script:
|
||||
- mkdir build
|
||||
- cd build
|
||||
- ../configure --disable-tcg --audio-drv-list=""
|
||||
- make -j"$JOBS"
|
||||
- make check-unit
|
||||
- make check-qapi-schema
|
||||
- cd tests/qemu-iotests/
|
||||
- ./check -raw 001 002 003 004 005 008 009 010 011 012 021 025 032 033 048
|
||||
052 063 077 086 101 104 106 113 148 150 151 152 157 159 160 163
|
||||
170 171 183 184 192 194 197 208 215 221 222 226 227 236 253 277
|
||||
- ./check -qcow2 028 051 056 057 058 065 067 068 082 085 091 095 096 102 122
|
||||
- ./check -qcow2 028 051 056 057 058 065 067 068 082 085 091 095 096 102 122
|
||||
124 132 139 142 144 145 151 152 155 157 165 194 196 197 200 202
|
||||
208 209 215 216 218 222 227 234 246 247 248 250 254 255 257 258
|
||||
260 261 262 263 264 270 272 273 277 279
|
||||
|
||||
build-user:
|
||||
<<: *before_script_apt
|
||||
script:
|
||||
- mkdir build
|
||||
- cd build
|
||||
- ../configure --enable-werror --disable-system --disable-guest-agent
|
||||
--disable-capstone --disable-slirp --disable-fdt
|
||||
- make -j"$JOBS"
|
||||
- make run-tcg-tests-i386-linux-user run-tcg-tests-x86_64-linux-user
|
||||
<<: *native_build_job_definition
|
||||
variables:
|
||||
IMAGE: debian-all-test-cross
|
||||
CONFIGURE_ARGS: --disable-tools --disable-system
|
||||
MAKE_CHECK_ARGS: check-tcg
|
||||
|
||||
build-clang:
|
||||
image: fedora:latest
|
||||
<<: *before_script_dnf
|
||||
script:
|
||||
- yum install -y clang SDL2-devel libattr-devel libcap-ng-devel xfsprogs-devel
|
||||
libiscsi-devel libnfs-devel libseccomp-devel gnutls-devel librbd-devel
|
||||
- mkdir build
|
||||
- cd build
|
||||
- ../configure --cc=clang --cxx=clang++ --enable-werror
|
||||
--target-list="alpha-softmmu arm-softmmu m68k-softmmu mips64-softmmu
|
||||
ppc-softmmu s390x-softmmu x86_64-softmmu arm-linux-user"
|
||||
- make -j"$JOBS"
|
||||
- make -j"$JOBS" check
|
||||
<<: *native_build_job_definition
|
||||
variables:
|
||||
IMAGE: fedora
|
||||
CONFIGURE_ARGS: --cc=clang --cxx=clang++
|
||||
TARGETS: alpha-softmmu arm-softmmu m68k-softmmu mips64-softmmu
|
||||
ppc-softmmu s390x-softmmu x86_64-softmmu arm-linux-user
|
||||
MAKE_CHECK_ARGS: check
|
||||
|
||||
build-tci:
|
||||
image: centos:8
|
||||
<<: *before_script_dnf
|
||||
script:
|
||||
- TARGETS="aarch64 alpha arm hppa m68k microblaze moxie ppc64 s390x x86_64"
|
||||
- mkdir build
|
||||
- cd build
|
||||
- ../configure --enable-tcg-interpreter
|
||||
--target-list="$(for tg in $TARGETS; do echo -n ${tg}'-softmmu '; done)"
|
||||
- make -j"$JOBS"
|
||||
- make run-tcg-tests-x86_64-softmmu
|
||||
- make tests/qtest/boot-serial-test tests/qtest/cdrom-test tests/qtest/pxe-test
|
||||
- for tg in $TARGETS ; do
|
||||
export QTEST_QEMU_BINARY="${tg}-softmmu/qemu-system-${tg}" ;
|
||||
./tests/qtest/boot-serial-test || exit 1 ;
|
||||
./tests/qtest/cdrom-test || exit 1 ;
|
||||
done
|
||||
- QTEST_QEMU_BINARY="x86_64-softmmu/qemu-system-x86_64" ./tests/qtest/pxe-test
|
||||
- QTEST_QEMU_BINARY="s390x-softmmu/qemu-system-s390x"
|
||||
./tests/qtest/pxe-test -m slow
|
||||
<<: *native_build_job_definition
|
||||
variables:
|
||||
IMAGE: fedora
|
||||
script:
|
||||
- TARGETS="aarch64 alpha arm hppa m68k microblaze moxie ppc64 s390x x86_64"
|
||||
- mkdir build
|
||||
- cd build
|
||||
- ../configure --enable-tcg-interpreter
|
||||
--target-list="$(for tg in $TARGETS; do echo -n ${tg}'-softmmu '; done)"
|
||||
- make -j"$JOBS"
|
||||
- make run-tcg-tests-x86_64-softmmu
|
||||
- make tests/qtest/boot-serial-test tests/qtest/cdrom-test tests/qtest/pxe-test
|
||||
- for tg in $TARGETS ; do
|
||||
export QTEST_QEMU_BINARY="${tg}-softmmu/qemu-system-${tg}" ;
|
||||
./tests/qtest/boot-serial-test || exit 1 ;
|
||||
./tests/qtest/cdrom-test || exit 1 ;
|
||||
done
|
||||
- QTEST_QEMU_BINARY="x86_64-softmmu/qemu-system-x86_64" ./tests/qtest/pxe-test
|
||||
- QTEST_QEMU_BINARY="s390x-softmmu/qemu-system-s390x" ./tests/qtest/pxe-test -m slow
|
||||
|
||||
+3
-5
@@ -26,12 +26,10 @@ env:
|
||||
- IMAGE=debian-ppc64el-cross
|
||||
TARGET_LIST=ppc64-softmmu,ppc64-linux-user,ppc64abi32-linux-user
|
||||
build:
|
||||
pre_ci:
|
||||
- make docker-image-${IMAGE} V=1
|
||||
pre_ci_boot:
|
||||
image_name: qemu
|
||||
image_tag: ${IMAGE}
|
||||
pull: false
|
||||
image_name: registry.gitlab.com/qemu-project/qemu/${IMAGE}
|
||||
image_tag: latest
|
||||
pull: true
|
||||
options: "-e HOME=/root"
|
||||
ci:
|
||||
- unset CC
|
||||
|
||||
+39
-23
@@ -289,29 +289,6 @@ jobs:
|
||||
python: 3.6
|
||||
|
||||
|
||||
# Acceptance (Functional) tests
|
||||
- name: "GCC check-acceptance"
|
||||
dist: bionic
|
||||
env:
|
||||
- CONFIG="--enable-tools --target-list=aarch64-softmmu,alpha-softmmu,arm-softmmu,m68k-softmmu,microblaze-softmmu,mips-softmmu,mips64el-softmmu,nios2-softmmu,or1k-softmmu,ppc-softmmu,ppc64-softmmu,s390x-softmmu,sh4-softmmu,sparc-softmmu,x86_64-softmmu,xtensa-softmmu"
|
||||
- TEST_CMD="make check-acceptance"
|
||||
- CACHE_NAME="${TRAVIS_BRANCH}-linux-gcc-acceptance"
|
||||
after_script:
|
||||
- python3 -c 'import json; r = json.load(open("tests/results/latest/results.json")); [print(t["logfile"]) for t in r["tests"] if t["status"] not in ("PASS", "SKIP")]' | xargs cat
|
||||
- du -chs $HOME/avocado/data/cache
|
||||
addons:
|
||||
apt:
|
||||
packages:
|
||||
- python3-pil
|
||||
- python3-pip
|
||||
- python3-numpy
|
||||
- python3-opencv
|
||||
- python3-venv
|
||||
- rpm2cpio
|
||||
- tesseract-ocr
|
||||
- tesseract-ocr-eng
|
||||
|
||||
|
||||
# Using newer GCC with sanitizers
|
||||
- name: "GCC9 with sanitizers (softmmu)"
|
||||
addons:
|
||||
@@ -505,6 +482,45 @@ jobs:
|
||||
$(exit $BUILD_RC);
|
||||
fi
|
||||
|
||||
- name: "[s390x] GCC (other-softmmu)"
|
||||
arch: s390x
|
||||
dist: bionic
|
||||
addons:
|
||||
apt_packages:
|
||||
- libaio-dev
|
||||
- libattr1-dev
|
||||
- libcap-ng-dev
|
||||
- libgnutls28-dev
|
||||
- libiscsi-dev
|
||||
- liblttng-ust-dev
|
||||
- liblzo2-dev
|
||||
- libncurses-dev
|
||||
- libnfs-dev
|
||||
- libnss3-dev
|
||||
- libpixman-1-dev
|
||||
- libsdl2-dev
|
||||
- libsdl2-image-dev
|
||||
- libseccomp-dev
|
||||
- libsnappy-dev
|
||||
- libzstd-dev
|
||||
- nettle-dev
|
||||
- xfslibs-dev
|
||||
# Tests dependencies
|
||||
- genisoimage
|
||||
env:
|
||||
- CONFIG="--disable-containers --audio-drv-list=sdl --disable-user
|
||||
--target-list-exclude=${MAIN_SOFTMMU_TARGETS}"
|
||||
|
||||
- name: "[s390x] GCC (user)"
|
||||
arch: s390x
|
||||
dist: bionic
|
||||
addons:
|
||||
apt_packages:
|
||||
- libgcrypt20-dev
|
||||
- libgnutls28-dev
|
||||
env:
|
||||
- CONFIG="--disable-containers --disable-system"
|
||||
|
||||
- name: "[s390x] Clang (disable-tcg)"
|
||||
arch: s390x
|
||||
dist: bionic
|
||||
|
||||
@@ -418,6 +418,7 @@ prefix="/usr/local"
|
||||
mandir="\${prefix}/share/man"
|
||||
datadir="\${prefix}/share"
|
||||
firmwarepath="\${prefix}/share/qemu-firmware"
|
||||
efi_aarch64=""
|
||||
qemu_docdir="\${prefix}/share/doc/qemu"
|
||||
bindir="\${prefix}/bin"
|
||||
libdir="\${prefix}/lib"
|
||||
@@ -960,6 +961,13 @@ do
|
||||
fi
|
||||
done
|
||||
|
||||
# Check for existence of python3 yaml, needed to
|
||||
# import yaml config files into vm-build.
|
||||
python_yaml="no"
|
||||
if $(python3 -c "import yaml" 2> /dev/null); then
|
||||
python_yaml="yes"
|
||||
fi
|
||||
|
||||
: ${smbd=${SMBD-/usr/sbin/smbd}}
|
||||
|
||||
# Default objcc to clang if available, otherwise use CC
|
||||
@@ -1102,6 +1110,8 @@ for opt do
|
||||
;;
|
||||
--firmwarepath=*) firmwarepath="$optarg"
|
||||
;;
|
||||
--efi-aarch64=*) efi_aarch64="$optarg"
|
||||
;;
|
||||
--host=*|--build=*|\
|
||||
--disable-dependency-tracking|\
|
||||
--sbindir=*|--sharedstatedir=*|\
|
||||
@@ -1784,6 +1794,7 @@ Advanced options (experts only):
|
||||
--sysconfdir=PATH install config in PATH$confsuffix
|
||||
--localstatedir=PATH install local state in PATH (set at runtime on win32)
|
||||
--firmwarepath=PATH search PATH for firmware files
|
||||
--efi-aarch64=PATH PATH of efi file to use for aarch64 VMs.
|
||||
--with-confsuffix=SUFFIX suffix for QEMU data inside datadir/libdir/sysconfdir [$confsuffix]
|
||||
--with-pkgversion=VERS use specified string as sub-version of the package
|
||||
--enable-debug enable common debug build options
|
||||
@@ -3620,6 +3631,20 @@ EOF
|
||||
fi
|
||||
fi
|
||||
|
||||
############################################
|
||||
# efi-aarch64 probe
|
||||
# Check for efi files needed by aarch64 VMs.
|
||||
# By default we will use the efi included with QEMU.
|
||||
# Allow user to override the path for efi also.
|
||||
if ! test -f "$efi_aarch64"; then
|
||||
if test -f $source_path/pc-bios/edk2-aarch64-code.fd.bz2; then
|
||||
# valid after build
|
||||
efi_aarch64=$PWD/pc-bios/edk2-aarch64-code.fd
|
||||
else
|
||||
efi_aarch64=""
|
||||
fi
|
||||
fi
|
||||
|
||||
##########################################
|
||||
# libcap-ng library probe
|
||||
if test "$cap_ng" != "no" ; then
|
||||
@@ -6486,7 +6511,7 @@ EOF
|
||||
fi
|
||||
if test "$secret_keyring" != "no"
|
||||
then
|
||||
if test "$have_keyring" == "yes"
|
||||
if test "$have_keyring" = "yes"
|
||||
then
|
||||
secret_keyring=yes
|
||||
else
|
||||
@@ -6868,6 +6893,8 @@ if test "$docs" != "no"; then
|
||||
echo "sphinx-build $sphinx_build"
|
||||
fi
|
||||
echo "genisoimage $genisoimage"
|
||||
echo "efi_aarch64 $efi_aarch64"
|
||||
echo "python_yaml $python_yaml"
|
||||
echo "slirp support $slirp $(echo_version $slirp $slirp_version)"
|
||||
if test "$slirp" != "no" ; then
|
||||
echo "smbd $smbd"
|
||||
@@ -7966,6 +7993,8 @@ echo "PYTHON=$python" >> $config_host_mak
|
||||
echo "SPHINX_BUILD=$sphinx_build" >> $config_host_mak
|
||||
echo "SPHINX_WERROR=$sphinx_werror" >> $config_host_mak
|
||||
echo "GENISOIMAGE=$genisoimage" >> $config_host_mak
|
||||
echo "EFI_AARCH64=$efi_aarch64" >> $config_host_mak
|
||||
echo "PYTHON_YAML=$python_yaml" >> $config_host_mak
|
||||
echo "CC=$cc" >> $config_host_mak
|
||||
if $iasl -h > /dev/null 2>&1; then
|
||||
echo "IASL=$iasl" >> $config_host_mak
|
||||
|
||||
@@ -23,6 +23,8 @@ Contents:
|
||||
decodetree
|
||||
secure-coding-practices
|
||||
tcg
|
||||
tcg-icount
|
||||
multi-thread-tcg
|
||||
tcg-plugins
|
||||
bitops
|
||||
reset
|
||||
|
||||
@@ -1,15 +1,17 @@
|
||||
Copyright (c) 2015-2016 Linaro Ltd.
|
||||
..
|
||||
Copyright (c) 2015-2020 Linaro Ltd.
|
||||
|
||||
This work is licensed under the terms of the GNU GPL, version 2 or
|
||||
later. See the COPYING file in the top-level directory.
|
||||
This work is licensed under the terms of the GNU GPL, version 2 or
|
||||
later. See the COPYING file in the top-level directory.
|
||||
|
||||
Introduction
|
||||
============
|
||||
|
||||
This document outlines the design for multi-threaded TCG system-mode
|
||||
emulation. The current user-mode emulation mirrors the thread
|
||||
structure of the translated executable. Some of the work will be
|
||||
applicable to both system and linux-user emulation.
|
||||
This document outlines the design for multi-threaded TCG (a.k.a MTTCG)
|
||||
system-mode emulation. user-mode emulation has always mirrored the
|
||||
thread structure of the translated executable although some of the
|
||||
changes done for MTTCG system emulation have improved the stability of
|
||||
linux-user emulation.
|
||||
|
||||
The original system-mode TCG implementation was single threaded and
|
||||
dealt with multiple CPUs with simple round-robin scheduling. This
|
||||
@@ -21,9 +23,18 @@ vCPU Scheduling
|
||||
===============
|
||||
|
||||
We introduce a new running mode where each vCPU will run on its own
|
||||
user-space thread. This will be enabled by default for all FE/BE
|
||||
combinations that have had the required work done to support this
|
||||
safely.
|
||||
user-space thread. This is enabled by default for all FE/BE
|
||||
combinations where the host memory model is able to accommodate the
|
||||
guest (TCG_GUEST_DEFAULT_MO & ~TCG_TARGET_DEFAULT_MO is zero) and the
|
||||
guest has had the required work done to support this safely
|
||||
(TARGET_SUPPORTS_MTTCG).
|
||||
|
||||
System emulation will fall back to the original round robin approach
|
||||
if:
|
||||
|
||||
* forced by --accel tcg,thread=single
|
||||
* enabling --icount mode
|
||||
* 64 bit guests on 32 bit hosts (TCG_OVERSIZED_GUEST)
|
||||
|
||||
In the general case of running translated code there should be no
|
||||
inter-vCPU dependencies and all vCPUs should be able to run at full
|
||||
@@ -61,7 +72,9 @@ have their block-to-block jumps patched.
|
||||
Global TCG State
|
||||
----------------
|
||||
|
||||
### User-mode emulation
|
||||
User-mode emulation
|
||||
~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
We need to protect the entire code generation cycle including any post
|
||||
generation patching of the translated code. This also implies a shared
|
||||
translation buffer which contains code running on all cores. Any
|
||||
@@ -78,9 +91,11 @@ patching.
|
||||
|
||||
Code generation is serialised with mmap_lock().
|
||||
|
||||
### !User-mode emulation
|
||||
!User-mode emulation
|
||||
~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
Each vCPU has its own TCG context and associated TCG region, thereby
|
||||
requiring no locking.
|
||||
requiring no locking during translation.
|
||||
|
||||
Translation Blocks
|
||||
------------------
|
||||
@@ -92,6 +107,7 @@ including:
|
||||
|
||||
- debugging operations (breakpoint insertion/removal)
|
||||
- some CPU helper functions
|
||||
- linux-user spawning it's first thread
|
||||
|
||||
This is done with the async_safe_run_on_cpu() mechanism to ensure all
|
||||
vCPUs are quiescent when changes are being made to shared global
|
||||
@@ -250,8 +266,10 @@ to enforce a particular ordering of memory operations from the point
|
||||
of view of external observers (e.g. another processor core). They can
|
||||
apply to any memory operations as well as just loads or stores.
|
||||
|
||||
The Linux kernel has an excellent write-up on the various forms of
|
||||
memory barrier and the guarantees they can provide [1].
|
||||
The Linux kernel has an excellent `write-up
|
||||
<https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/plain/Documentation/memory-barriers.txt>`
|
||||
on the various forms of memory barrier and the guarantees they can
|
||||
provide.
|
||||
|
||||
Barriers are often wrapped around synchronisation primitives to
|
||||
provide explicit memory ordering semantics. However they can be used
|
||||
@@ -352,7 +370,3 @@ an exclusive lock which ensures all emulation is serialised.
|
||||
While the atomic helpers look good enough for now there may be a need
|
||||
to look at solutions that can more closely model the guest
|
||||
architectures semantics.
|
||||
|
||||
==========
|
||||
|
||||
[1] https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/plain/Documentation/memory-barriers.txt
|
||||
@@ -0,0 +1,97 @@
|
||||
..
|
||||
Copyright (c) 2020, Linaro Limited
|
||||
Written by Alex Bennée
|
||||
|
||||
|
||||
========================
|
||||
TCG Instruction Counting
|
||||
========================
|
||||
|
||||
TCG has long supported a feature known as icount which allows for
|
||||
instruction counting during execution. This should not be confused
|
||||
with cycle accurate emulation - QEMU does not attempt to emulate how
|
||||
long an instruction would take on real hardware. That is a job for
|
||||
other more detailed (and slower) tools that simulate the rest of a
|
||||
micro-architecture.
|
||||
|
||||
This feature is only available for system emulation and is
|
||||
incompatible with multi-threaded TCG. It can be used to better align
|
||||
execution time with wall-clock time so a "slow" device doesn't run too
|
||||
fast on modern hardware. It can also provides for a degree of
|
||||
deterministic execution and is an essential part of the record/replay
|
||||
support in QEMU.
|
||||
|
||||
Core Concepts
|
||||
=============
|
||||
|
||||
At its heart icount is simply a count of executed instructions which
|
||||
is stored in the TimersState of QEMU's timer sub-system. The number of
|
||||
executed instructions can then be used to calculate QEMU_CLOCK_VIRTUAL
|
||||
which represents the amount of elapsed time in the system since
|
||||
execution started. Depending on the icount mode this may either be a
|
||||
fixed number of ns per instruction or adjusted as execution continues
|
||||
to keep wall clock time and virtual time in sync.
|
||||
|
||||
To be able to calculate the number of executed instructions the
|
||||
translator starts by allocating a budget of instructions to be
|
||||
executed. The budget of instructions is limited by how long it will be
|
||||
until the next timer will expire. We store this budget as part of a
|
||||
vCPU icount_decr field which shared with the machinery for handling
|
||||
cpu_exit(). The whole field is checked at the start of every
|
||||
translated block and will cause a return to the outer loop to deal
|
||||
with whatever caused the exit.
|
||||
|
||||
In the case of icount, before the flag is checked we subtract the
|
||||
number of instructions the translation block would execute. If this
|
||||
would cause the instruction budget to go negative we exit the main
|
||||
loop and regenerate a new translation block with exactly the right
|
||||
number of instructions to take the budget to 0 meaning whatever timer
|
||||
was due to expire will expire exactly when we exit the main run loop.
|
||||
|
||||
Dealing with MMIO
|
||||
-----------------
|
||||
|
||||
While we can adjust the instruction budget for known events like timer
|
||||
expiry we cannot do the same for MMIO. Every load/store we execute
|
||||
might potentially trigger an I/O event, at which point we will need an
|
||||
up to date and accurate reading of the icount number.
|
||||
|
||||
To deal with this case, when an I/O access is made we:
|
||||
|
||||
- restore un-executed instructions to the icount budget
|
||||
- re-compile a single [1]_ instruction block for the current PC
|
||||
- exit the cpu loop and execute the re-compiled block
|
||||
|
||||
The new block is created with the CF_LAST_IO compile flag which
|
||||
ensures the final instruction translation starts with a call to
|
||||
gen_io_start() so we don't enter a perpetual loop constantly
|
||||
recompiling a single instruction block. For translators using the
|
||||
common translator_loop this is done automatically.
|
||||
|
||||
.. [1] sometimes two instructions if dealing with delay slots
|
||||
|
||||
Other I/O operations
|
||||
--------------------
|
||||
|
||||
MMIO isn't the only type of operation for which we might need a
|
||||
correct and accurate clock. IO port instructions and accesses to
|
||||
system registers are the common examples here. These instructions have
|
||||
to be handled by the individual translators which have the knowledge
|
||||
of which operations are I/O operations.
|
||||
|
||||
When the translator is handling an instruction of this kind:
|
||||
|
||||
* it must call gen_io_start() if icount is enabled, at some
|
||||
point before the generation of the code which actually does
|
||||
the I/O, using a code fragment similar to:
|
||||
|
||||
.. code:: c
|
||||
|
||||
if (tb_cflags(s->base.tb) & CF_USE_ICOUNT) {
|
||||
gen_io_start();
|
||||
}
|
||||
|
||||
* it must end the TB immediately after this instruction
|
||||
|
||||
Note that some older front-ends call a "gen_io_end()" function:
|
||||
this is obsolete and should not be used.
|
||||
@@ -87,3 +87,23 @@ three commands you can query and set the single step behavior:
|
||||
(gdb) maintenance packet Qqemu.sstep=0x5
|
||||
sending: "qemu.sstep=0x5"
|
||||
received: "OK"
|
||||
|
||||
|
||||
Another feature that QEMU gdbstub provides is to toggle the memory GDB
|
||||
works with, by default GDB will show the current process memory respecting
|
||||
the virtual address translation.
|
||||
|
||||
If you want to examine/change the physical memory you can set the gdbstub
|
||||
to work with the physical memory rather with the virtual one.
|
||||
|
||||
The memory mode can be checked by sending the following command:
|
||||
|
||||
``maintenance packet qqemu.PhyMemMode``
|
||||
This will return either 0 or 1, 1 indicates you are currently in the
|
||||
physical memory mode.
|
||||
|
||||
``maintenance packet Qqemu.PhyMemMode:1``
|
||||
This will change the memory mode to physical memory.
|
||||
|
||||
``maintenance packet Qqemu.PhyMemMode:0``
|
||||
This will change it back to normal memory mode.
|
||||
|
||||
+10
-13
@@ -49,19 +49,16 @@ common-obj-m += qxl.mo
|
||||
qxl.mo-objs = qxl.o qxl-logger.o qxl-render.o
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_VIRTIO_GPU),y)
|
||||
common-obj-m += virtio-gpu.mo
|
||||
virtio-gpu-obj-$(CONFIG_VIRTIO_GPU) += virtio-gpu-base.o virtio-gpu.o virtio-gpu-3d.o
|
||||
virtio-gpu-obj-$(CONFIG_VHOST_USER_GPU) += vhost-user-gpu.o
|
||||
virtio-gpu-obj-$(call land,$(CONFIG_VIRTIO_GPU),$(CONFIG_VIRTIO_PCI)) += virtio-gpu-pci.o
|
||||
virtio-gpu-obj-$(call land,$(CONFIG_VHOST_USER_GPU),$(CONFIG_VIRTIO_PCI)) += vhost-user-gpu-pci.o
|
||||
virtio-gpu-obj-$(CONFIG_VIRTIO_VGA) += virtio-vga.o
|
||||
virtio-gpu-obj-$(CONFIG_VHOST_USER_VGA) += vhost-user-vga.o
|
||||
virtio-gpu.mo-objs := $(virtio-gpu-obj-y)
|
||||
virtio-gpu.mo-cflags := $(VIRGL_CFLAGS)
|
||||
virtio-gpu.mo-libs := $(VIRGL_LIBS)
|
||||
endif
|
||||
|
||||
common-obj-$(CONFIG_VIRTIO_GPU) += virtio-gpu-base.o virtio-gpu.o virtio-gpu-3d.o
|
||||
common-obj-$(CONFIG_VHOST_USER_GPU) += vhost-user-gpu.o
|
||||
common-obj-$(call land,$(CONFIG_VIRTIO_GPU),$(CONFIG_VIRTIO_PCI)) += virtio-gpu-pci.o
|
||||
common-obj-$(call land,$(CONFIG_VHOST_USER_GPU),$(CONFIG_VIRTIO_PCI)) += vhost-user-gpu-pci.o
|
||||
common-obj-$(CONFIG_VIRTIO_VGA) += virtio-vga.o
|
||||
common-obj-$(CONFIG_VHOST_USER_VGA) += vhost-user-vga.o
|
||||
virtio-gpu.o-cflags := $(VIRGL_CFLAGS)
|
||||
virtio-gpu.o-libs += $(VIRGL_LIBS)
|
||||
virtio-gpu-3d.o-cflags := $(VIRGL_CFLAGS)
|
||||
virtio-gpu-3d.o-libs += $(VIRGL_LIBS)
|
||||
common-obj-$(CONFIG_DPCD) += dpcd.o
|
||||
common-obj-$(CONFIG_XLNX_ZYNQMP_ARM) += xlnx_dp.o
|
||||
|
||||
|
||||
@@ -2294,7 +2294,7 @@ static void pgb_dynamic(const char *image_name, long align)
|
||||
static void pgb_reserved_va(const char *image_name, abi_ulong guest_loaddr,
|
||||
abi_ulong guest_hiaddr, long align)
|
||||
{
|
||||
const int flags = MAP_ANONYMOUS | MAP_PRIVATE | MAP_NORESERVE;
|
||||
int flags = MAP_ANONYMOUS | MAP_PRIVATE | MAP_NORESERVE;
|
||||
void *addr, *test;
|
||||
|
||||
if (guest_hiaddr > reserved_va) {
|
||||
@@ -2307,15 +2307,19 @@ static void pgb_reserved_va(const char *image_name, abi_ulong guest_loaddr,
|
||||
/* Widen the "image" to the entire reserved address space. */
|
||||
pgb_static(image_name, 0, reserved_va, align);
|
||||
|
||||
#ifdef MAP_FIXED_NOREPLACE
|
||||
flags |= MAP_FIXED_NOREPLACE;
|
||||
#endif
|
||||
|
||||
/* Reserve the memory on the host. */
|
||||
assert(guest_base != 0);
|
||||
test = g2h(0);
|
||||
addr = mmap(test, reserved_va, PROT_NONE, flags, -1, 0);
|
||||
if (addr == MAP_FAILED) {
|
||||
error_report("Unable to reserve 0x%lx bytes of virtual address "
|
||||
"space for use as guest address space (check your "
|
||||
"space (%s) for use as guest address space (check your "
|
||||
"virtual memory ulimit setting or reserve less "
|
||||
"using -R option)", reserved_va);
|
||||
"using -R option)", reserved_va, strerror(errno));
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
assert(addr == test);
|
||||
|
||||
@@ -0,0 +1,110 @@
|
||||
#!/usr/bin/env python3
|
||||
#
|
||||
# This python module implements a ConsoleSocket object which is
|
||||
# designed always drain the socket itself, and place
|
||||
# the bytes into a in memory buffer for later processing.
|
||||
#
|
||||
# Optionally a file path can be passed in and we will also
|
||||
# dump the characters to this file for debug.
|
||||
#
|
||||
# Copyright 2020 Linaro
|
||||
#
|
||||
# Authors:
|
||||
# Robert Foley <robert.foley@linaro.org>
|
||||
#
|
||||
# This code is licensed under the GPL version 2 or later. See
|
||||
# the COPYING file in the top-level directory.
|
||||
#
|
||||
import asyncore
|
||||
import socket
|
||||
import threading
|
||||
import io
|
||||
import os
|
||||
import sys
|
||||
from collections import deque
|
||||
import time
|
||||
import traceback
|
||||
|
||||
class ConsoleSocket(asyncore.dispatcher):
|
||||
|
||||
def __init__(self, address, file=None):
|
||||
self._recv_timeout_sec = 300
|
||||
self._buffer = deque()
|
||||
self._asyncore_thread = None
|
||||
self._sock = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM)
|
||||
self._sock.connect(address)
|
||||
self._logfile = None
|
||||
if file:
|
||||
self._logfile = open(file, "w")
|
||||
asyncore.dispatcher.__init__(self, sock=self._sock)
|
||||
self._open = True
|
||||
self._thread_start()
|
||||
|
||||
def _thread_start(self):
|
||||
"""Kick off a thread to wait on the asyncore.loop"""
|
||||
if self._asyncore_thread is not None:
|
||||
return
|
||||
self._asyncore_thread = threading.Thread(target=asyncore.loop,
|
||||
kwargs={'timeout':1})
|
||||
self._asyncore_thread.daemon = True
|
||||
self._asyncore_thread.start()
|
||||
|
||||
def handle_close(self):
|
||||
"""redirect close to base class"""
|
||||
# Call the base class close, but not self.close() since
|
||||
# handle_close() occurs in the context of the thread which
|
||||
# self.close() attempts to join.
|
||||
asyncore.dispatcher.close(self)
|
||||
|
||||
def close(self):
|
||||
"""Close the base object and wait for the thread to terminate"""
|
||||
if self._open:
|
||||
self._open = False
|
||||
asyncore.dispatcher.close(self)
|
||||
if self._asyncore_thread is not None:
|
||||
thread, self._asyncore_thread = self._asyncore_thread, None
|
||||
thread.join()
|
||||
if self._logfile:
|
||||
self._logfile.close()
|
||||
self._logfile = None
|
||||
|
||||
def handle_read(self):
|
||||
"""process arriving characters into in memory _buffer"""
|
||||
try:
|
||||
data = asyncore.dispatcher.recv(self, 1)
|
||||
# latin1 is needed since there are some chars
|
||||
# we are receiving that cannot be encoded to utf-8
|
||||
# such as 0xe2, 0x80, 0xA6.
|
||||
string = data.decode("latin1")
|
||||
except:
|
||||
print("Exception seen.")
|
||||
traceback.print_exc()
|
||||
return
|
||||
if self._logfile:
|
||||
self._logfile.write("{}".format(string))
|
||||
self._logfile.flush()
|
||||
for c in string:
|
||||
self._buffer.extend(c)
|
||||
|
||||
def recv(self, n=1, sleep_delay_s=0.1):
|
||||
"""Return chars from in memory buffer"""
|
||||
start_time = time.time()
|
||||
while len(self._buffer) < n:
|
||||
time.sleep(sleep_delay_s)
|
||||
elapsed_sec = time.time() - start_time
|
||||
if elapsed_sec > self._recv_timeout_sec:
|
||||
raise socket.timeout
|
||||
chars = ''.join([self._buffer.popleft() for i in range(n)])
|
||||
# We choose to use latin1 to remain consistent with
|
||||
# handle_read() and give back the same data as the user would
|
||||
# receive if they were reading directly from the
|
||||
# socket w/o our intervention.
|
||||
return chars.encode("latin1")
|
||||
|
||||
def set_blocking(self):
|
||||
"""Maintain compatibility with socket API"""
|
||||
pass
|
||||
|
||||
def settimeout(self, seconds):
|
||||
"""Set current timeout on recv"""
|
||||
self._recv_timeout_sec = seconds
|
||||
+19
-4
@@ -26,6 +26,7 @@ import socket
|
||||
import tempfile
|
||||
from typing import Optional, Type
|
||||
from types import TracebackType
|
||||
from qemu.console_socket import ConsoleSocket
|
||||
|
||||
from . import qmp
|
||||
|
||||
@@ -75,7 +76,8 @@ class QEMUMachine:
|
||||
|
||||
def __init__(self, binary, args=None, wrapper=None, name=None,
|
||||
test_dir="/var/tmp", monitor_address=None,
|
||||
socket_scm_helper=None, sock_dir=None):
|
||||
socket_scm_helper=None, sock_dir=None,
|
||||
drain_console=False, console_log=None):
|
||||
'''
|
||||
Initialize a QEMUMachine
|
||||
|
||||
@@ -86,6 +88,9 @@ class QEMUMachine:
|
||||
@param test_dir: where to create socket and log file
|
||||
@param monitor_address: address for QMP monitor
|
||||
@param socket_scm_helper: helper program, required for send_fd_scm()
|
||||
@param sock_dir: where to create socket (overrides test_dir for sock)
|
||||
@param console_log: (optional) path to console log file
|
||||
@param drain_console: (optional) True to drain console socket to buffer
|
||||
@note: Qemu process is not started until launch() is used.
|
||||
'''
|
||||
if args is None:
|
||||
@@ -122,6 +127,12 @@ class QEMUMachine:
|
||||
self._console_address = None
|
||||
self._console_socket = None
|
||||
self._remove_files = []
|
||||
self._console_log_path = console_log
|
||||
if self._console_log_path:
|
||||
# In order to log the console, buffering needs to be enabled.
|
||||
self._drain_console = True
|
||||
else:
|
||||
self._drain_console = drain_console
|
||||
|
||||
def __enter__(self):
|
||||
return self
|
||||
@@ -580,7 +591,11 @@ class QEMUMachine:
|
||||
Returns a socket connected to the console
|
||||
"""
|
||||
if self._console_socket is None:
|
||||
self._console_socket = socket.socket(socket.AF_UNIX,
|
||||
socket.SOCK_STREAM)
|
||||
self._console_socket.connect(self._console_address)
|
||||
if self._drain_console:
|
||||
self._console_socket = ConsoleSocket(self._console_address,
|
||||
file=self._console_log_path)
|
||||
else:
|
||||
self._console_socket = socket.socket(socket.AF_UNIX,
|
||||
socket.SOCK_STREAM)
|
||||
self._console_socket.connect(self._console_address)
|
||||
return self._console_socket
|
||||
|
||||
+14
-5
@@ -22,6 +22,8 @@ endif
|
||||
@echo " $(MAKE) check-venv Creates a Python venv for tests"
|
||||
@echo " $(MAKE) check-clean Clean the tests and related data"
|
||||
@echo
|
||||
@echo "The following are useful for CI builds"
|
||||
@echo " $(MAKE) check-build Build most test binaris"
|
||||
@echo " $(MAKE) get-vm-images Downloads all images used by acceptance tests, according to configured targets (~350 MB each, 1.5 GB max)"
|
||||
@echo
|
||||
@echo
|
||||
@@ -649,6 +651,10 @@ $(patsubst %, check-qtest-%, $(QTEST_TARGETS)): check-qtest-%: %-softmmu/all $(c
|
||||
QTEST_QEMU_BINARY=$*-softmmu/qemu-system-$* \
|
||||
QTEST_QEMU_IMG=qemu-img$(EXESUF))
|
||||
|
||||
build-qtest: $(patsubst %, %-softmmu/all, $(QTEST_TARGETS)) $(check-qtest-y)
|
||||
|
||||
build-unit: $(check-unit-y)
|
||||
|
||||
check-unit: $(check-unit-y)
|
||||
$(call do_test_human, $^)
|
||||
|
||||
@@ -680,7 +686,6 @@ check-report.tap: $(patsubst %,check-report-qtest-%.tap, $(QTEST_TARGETS)) check
|
||||
FP_TEST_BIN=$(BUILD_DIR)/tests/fp/fp-test
|
||||
|
||||
# the build dir is created by configure
|
||||
.PHONY: $(FP_TEST_BIN)
|
||||
$(FP_TEST_BIN): config-host.h $(test-util-obj-y)
|
||||
$(call quiet-command, \
|
||||
$(MAKE) $(SUBDIR_MAKEFLAGS) -C $(dir $@) V="$(V)" $(notdir $@), \
|
||||
@@ -814,9 +819,10 @@ check-softfloat-ops: $(SF_MATH_RULES)
|
||||
|
||||
.PHONY: check-softfloat
|
||||
ifeq ($(CONFIG_TCG),y)
|
||||
check-softfloat: check-softfloat-conv check-softfloat-compare check-softfloat-ops
|
||||
build-softfloat: $(FP_TEST_BIN)
|
||||
check-softfloat: build-softfloat check-softfloat-conv check-softfloat-compare check-softfloat-ops
|
||||
else
|
||||
check-softfloat:
|
||||
build-softfloat check-softfloat:
|
||||
$(call quiet-command, /bin/true, "FLOAT TEST", \
|
||||
"SKIPPED for non-TCG builds")
|
||||
endif
|
||||
@@ -944,7 +950,7 @@ check-acceptance: check-venv $(TESTS_RESULTS_DIR) get-vm-images
|
||||
--show=$(AVOCADO_SHOW) run --job-results-dir=$(TESTS_RESULTS_DIR) \
|
||||
--filter-by-tags-include-empty --filter-by-tags-include-empty-key \
|
||||
$(AVOCADO_TAGS) \
|
||||
--failfast=on tests/acceptance, \
|
||||
$(if $(GITLAB_CI),,--failfast=on) tests/acceptance, \
|
||||
"AVOCADO", "tests/acceptance")
|
||||
|
||||
# Consolidated targets
|
||||
@@ -955,7 +961,8 @@ check-qtest: $(patsubst %,check-qtest-%, $(QTEST_TARGETS))
|
||||
ifeq ($(CONFIG_TOOLS),y)
|
||||
check-block: $(patsubst %,check-%, $(check-block-y))
|
||||
endif
|
||||
check: check-block check-qapi-schema check-unit check-softfloat check-qtest check-decodetree
|
||||
check-build: build-unit build-softfloat build-qtest
|
||||
|
||||
check-clean:
|
||||
rm -rf $(check-unit-y) tests/*.o tests/*/*.o $(QEMU_IOTESTS_HELPERS-y)
|
||||
rm -rf $(sort $(foreach target,$(SYSEMU_TARGET_LIST), $(check-qtest-$(target)-y:%=tests/qtest/%$(EXESUF))) $(check-qtest-generic-y:%=tests/qtest/%$(EXESUF)))
|
||||
@@ -963,6 +970,8 @@ check-clean:
|
||||
rm -f tests/qtest/dbus-vmstate1-gen-timestamp
|
||||
rm -rf $(TESTS_VENV_DIR) $(TESTS_RESULTS_DIR)
|
||||
|
||||
check: check-block check-qapi-schema check-unit check-softfloat check-qtest check-decodetree
|
||||
|
||||
clean: check-clean
|
||||
|
||||
# Build the help program automatically
|
||||
|
||||
@@ -20,6 +20,7 @@ from avocado.utils import network
|
||||
from avocado.utils import vmimage
|
||||
from avocado.utils import datadrainer
|
||||
from avocado.utils.path import find_command
|
||||
from avocado import skipIf
|
||||
|
||||
ACCEL_NOT_AVAILABLE_FMT = "%s accelerator does not seem to be available"
|
||||
KVM_NOT_AVAILABLE = ACCEL_NOT_AVAILABLE_FMT % "KVM"
|
||||
@@ -220,6 +221,7 @@ class BootLinuxS390X(BootLinux):
|
||||
|
||||
chksum = '4caaab5a434fd4d1079149a072fdc7891e354f834d355069ca982fdcaf5a122d'
|
||||
|
||||
@skipIf(os.getenv('GITLAB_CI'), 'Running on GitLab')
|
||||
def test_s390_ccw_virtio_tcg(self):
|
||||
"""
|
||||
:avocado: tags=machine:s390-ccw-virtio
|
||||
|
||||
@@ -8,10 +8,12 @@
|
||||
# This work is licensed under the terms of the GNU GPL, version 2 or
|
||||
# later. See the COPYING file in the top-level directory.
|
||||
|
||||
import os
|
||||
import logging
|
||||
import tempfile
|
||||
|
||||
from avocado_qemu import Test
|
||||
from avocado import skipIf
|
||||
|
||||
|
||||
class LinuxInitrd(Test):
|
||||
@@ -51,6 +53,7 @@ class LinuxInitrd(Test):
|
||||
max_size + 1)
|
||||
self.assertRegex(self.vm.get_log(), expected_msg)
|
||||
|
||||
@skipIf(os.getenv('GITLAB_CI'), 'Running on GitLab')
|
||||
def test_with_2gib_file_should_work_with_linux_v4_16(self):
|
||||
"""
|
||||
QEMU has supported up to 4 GiB initrd for recent kernel
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user