mirror of
https://github.com/izzy2lost/xemu.git
synced 2026-07-06 00:20:22 -07:00
Merge tag 'pull-fixes-for-7.1-200422-1' of https://github.com/stsquad/qemu into staging
Testing, docs and gdbstub updates: - make -M virt test exercise -cpu max - document how binfmt_misc docker works - clean-up the devel TOC generation - clean-up check-tcg cross-compile behaviour - fix byte swap error in xmm gdbstub access - add float_convd test with reference files - more reference files for float_convs - more cleanly handle gdb crashing during check-tcg # -----BEGIN PGP SIGNATURE----- # # iQEzBAABCgAdFiEEZoWumedRZ7yvyN81+9DbCVqeKkQFAmJgIgsACgkQ+9DbCVqe # KkRs3Qf/WnL4YV3l8jO/wEVbls/57aLPk+ak1GuvXJ+iM9gH8Qz6WZxIJIEhhHlu # ZEixCewahTn8POMMRo4JAr0bRgtfBuh717GerXObiHcS3OuLsGM8rYP2Z1xqKL3L # 4pR8VqhyUq/Jyl/6MPN5OZB0AdEPIdI5MuflckCeDcFaowpthLjwHao07hG/FU0s # wQYS7aYTZT33V2Xm6xlePEEMq8YMPCJj00HF3Ljg4eUOmb+C+csFXMQtotsBJRCg # mC/T2U0IFbrQUkkWJqVmRCPwKraQGDMn6POk298siRWE0kV4BmH8mnmN+/Jxhqgl # QfFhQrsBxmPPG5TfQhEmlHfQ5EARLQ== # =8q12 # -----END PGP SIGNATURE----- # gpg: Signature made Wed 20 Apr 2022 08:08:59 AM PDT # gpg: using RSA key 6685AE99E75167BCAFC8DF35FBD0DB095A9E2A44 # gpg: Good signature from "Alex Bennée (Master Work Key) <alex.bennee@linaro.org>" [undefined] # gpg: WARNING: This key is not certified with a trusted signature! # gpg: There is no indication that the signature belongs to the owner. # Primary key fingerprint: 6685 AE99 E751 67BC AFC8 DF35 FBD0 DB09 5A9E 2A44 * tag 'pull-fixes-for-7.1-200422-1' of https://github.com/stsquad/qemu: (25 commits) tests/guest-debug: better handle gdb crashes target/i386: fix byte swap issue with XMM register access tests/tcg: add missing reference files for float_convs tests/tcg: add float_convd test tests/tcg: remove duplicate sha512-sse case tests/tcg: fix non-static build tests/docker: remove SKIP_DOCKER_BUILD tests/tcg: isolate from QEMU's config-host.mak tests/tcg: invoke Makefile.target directly from QEMU's makefile tests/tcg: list test targets in Makefile.prereqs tests/tcg: prepare Makefile.prereqs at configure time tests/tcg: remove CONFIG_USER_ONLY from config-target.mak tests/tcg: remove CONFIG_LINUX_USER from config-target.mak tests/tcg: add compiler test variables when using containers tests/docker: do not duplicate rules for hexagon-cross tests/docker: simplify docker-TEST@IMAGE targets tests/docker: remove unnecessary filtering of $(DOCKER_IMAGES) tests/docker: inline variable definitions or move close to use tests/docker: remove unnecessary default definitions tests/docker: remove dead variable ... Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
This commit is contained in:
@@ -942,6 +942,7 @@ S: Maintained
|
||||
F: hw/arm/virt*
|
||||
F: include/hw/arm/virt.h
|
||||
F: docs/system/arm/virt.rst
|
||||
F: tests/avocado/machine_aarch64_virt.py
|
||||
|
||||
Xilinx Zynq
|
||||
M: Edgar E. Iglesias <edgar.iglesias@gmail.com>
|
||||
|
||||
@@ -2937,7 +2937,6 @@ echo "GENISOIMAGE=$genisoimage" >> $config_host_mak
|
||||
echo "MESON=$meson" >> $config_host_mak
|
||||
echo "NINJA=$ninja" >> $config_host_mak
|
||||
echo "CC=$cc" >> $config_host_mak
|
||||
echo "HOST_CC=$host_cc" >> $config_host_mak
|
||||
echo "AR=$ar" >> $config_host_mak
|
||||
echo "AS=$as" >> $config_host_mak
|
||||
echo "CCAS=$ccas" >> $config_host_mak
|
||||
@@ -3057,7 +3056,7 @@ done
|
||||
(for i in $cross_cc_vars; do
|
||||
export $i
|
||||
done
|
||||
export target_list source_path use_containers cpu
|
||||
export target_list source_path use_containers cpu host_cc
|
||||
$source_path/tests/tcg/configure.sh)
|
||||
|
||||
# temporary config to build submodules
|
||||
|
||||
@@ -6,7 +6,6 @@ generated from in-code annotations to function prototypes.
|
||||
|
||||
.. toctree::
|
||||
:maxdepth: 2
|
||||
:includehidden:
|
||||
|
||||
bitops
|
||||
loads-stores
|
||||
|
||||
@@ -6,8 +6,7 @@ into our testing infrastructure. You will need to understand some of
|
||||
the basics if you are adding new files and targets to the build.
|
||||
|
||||
.. toctree::
|
||||
:maxdepth: 2
|
||||
:includehidden:
|
||||
:maxdepth: 3
|
||||
|
||||
build-system
|
||||
kconfig
|
||||
|
||||
@@ -5,7 +5,6 @@ Details about QEMU's various subsystems including how to add features to them.
|
||||
|
||||
.. toctree::
|
||||
:maxdepth: 2
|
||||
:includehidden:
|
||||
|
||||
qom
|
||||
atomics
|
||||
|
||||
@@ -5,7 +5,6 @@ Notes about how to interact with the community and how and where to submit patch
|
||||
|
||||
.. toctree::
|
||||
:maxdepth: 2
|
||||
:includehidden:
|
||||
|
||||
code-of-conduct
|
||||
conflict-resolution
|
||||
|
||||
@@ -7,7 +7,6 @@ are only implementing things for HW accelerated hypervisors.
|
||||
|
||||
.. toctree::
|
||||
:maxdepth: 2
|
||||
:includehidden:
|
||||
|
||||
tcg
|
||||
decodetree
|
||||
|
||||
@@ -8,8 +8,6 @@ modifying QEMU's source code.
|
||||
|
||||
.. toctree::
|
||||
:maxdepth: 1
|
||||
:includehidden:
|
||||
|
||||
|
||||
index-process
|
||||
index-build
|
||||
|
||||
@@ -3,7 +3,6 @@ QTest Device Emulation Testing Framework
|
||||
========================================
|
||||
|
||||
.. toctree::
|
||||
:hidden:
|
||||
|
||||
qgraph
|
||||
|
||||
|
||||
@@ -637,6 +637,44 @@ The full set of annotations can be found here:
|
||||
|
||||
https://github.com/llvm/llvm-project/blob/master/compiler-rt/lib/tsan/rtl/tsan_interface_ann.cpp
|
||||
|
||||
docker-binfmt-image-debian-% targets
|
||||
------------------------------------
|
||||
|
||||
It is possible to combine Debian's bootstrap scripts with a configured
|
||||
``binfmt_misc`` to bootstrap a number of Debian's distros including
|
||||
experimental ports not yet supported by a released OS. This can
|
||||
simplify setting up a rootfs by using docker to contain the foreign
|
||||
rootfs rather than manually invoking chroot.
|
||||
|
||||
Setting up ``binfmt_misc``
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
You can use the script ``qemu-binfmt-conf.sh`` to configure a QEMU
|
||||
user binary to automatically run binaries for the foreign
|
||||
architecture. While the scripts will try their best to work with
|
||||
dynamically linked QEMU's a statically linked one will present less
|
||||
potential complications when copying into the docker image. Modern
|
||||
kernels support the ``F`` (fix binary) flag which will open the QEMU
|
||||
executable on setup and avoids the need to find and re-open in the
|
||||
chroot environment. This is triggered with the ``--persistent`` flag.
|
||||
|
||||
Example invocation
|
||||
~~~~~~~~~~~~~~~~~~
|
||||
|
||||
For example to setup the HPPA ports builds of Debian::
|
||||
|
||||
make docker-binfmt-image-debian-sid-hppa \
|
||||
DEB_TYPE=sid DEB_ARCH=hppa \
|
||||
DEB_URL=http://ftp.ports.debian.org/debian-ports/ \
|
||||
DEB_KEYRING=/usr/share/keyrings/debian-ports-archive-keyring.gpg \
|
||||
EXECUTABLE=(pwd)/qemu-hppa V=1
|
||||
|
||||
The ``DEB_`` variables are substitutions used by
|
||||
``debian-boostrap.pre`` which is called to do the initial debootstrap
|
||||
of the rootfs before it is copied into the container. The second stage
|
||||
is run as part of the build. The final image will be tagged as
|
||||
``qemu/debian-sid-hppa``.
|
||||
|
||||
VM testing
|
||||
----------
|
||||
|
||||
|
||||
@@ -129,8 +129,8 @@ int x86_cpu_gdb_read_register(CPUState *cs, GByteArray *mem_buf, int n)
|
||||
n -= IDX_XMM_REGS;
|
||||
if (n < CPU_NB_REGS32 || TARGET_LONG_BITS == 64) {
|
||||
return gdb_get_reg128(mem_buf,
|
||||
env->xmm_regs[n].ZMM_Q(0),
|
||||
env->xmm_regs[n].ZMM_Q(1));
|
||||
env->xmm_regs[n].ZMM_Q(1),
|
||||
env->xmm_regs[n].ZMM_Q(0));
|
||||
}
|
||||
} else {
|
||||
switch (n) {
|
||||
|
||||
+30
-25
@@ -36,37 +36,39 @@ export SRC_PATH
|
||||
|
||||
SPEED = quick
|
||||
|
||||
# Build up our target list from the filtered list of ninja targets
|
||||
TARGETS=$(patsubst libqemu-%.fa, %, $(filter libqemu-%.fa, $(ninja-targets)))
|
||||
-include tests/tcg/Makefile.prereqs
|
||||
config-host.mak: $(SRC_PATH)/tests/tcg/configure.sh
|
||||
tests/tcg/Makefile.prereqs: config-host.mak
|
||||
|
||||
# Per guest TCG tests
|
||||
BUILD_TCG_TARGET_RULES=$(patsubst %,build-tcg-tests-%, $(TARGETS))
|
||||
CLEAN_TCG_TARGET_RULES=$(patsubst %,clean-tcg-tests-%, $(TARGETS))
|
||||
RUN_TCG_TARGET_RULES=$(patsubst %,run-tcg-tests-%, $(TARGETS))
|
||||
BUILD_TCG_TARGET_RULES=$(patsubst %,build-tcg-tests-%, $(TCG_TESTS_TARGETS))
|
||||
CLEAN_TCG_TARGET_RULES=$(patsubst %,clean-tcg-tests-%, $(TCG_TESTS_TARGETS))
|
||||
RUN_TCG_TARGET_RULES=$(patsubst %,run-tcg-tests-%, $(TCG_TESTS_TARGETS))
|
||||
|
||||
# Probe for the Docker Builds needed for each build
|
||||
$(foreach PROBE_TARGET,$(TARGET_DIRS), \
|
||||
$(eval -include $(SRC_PATH)/tests/tcg/Makefile.prereqs))
|
||||
$(foreach TARGET,$(TCG_TESTS_TARGETS), \
|
||||
$(eval $(BUILD_DIR)/tests/tcg/config-$(TARGET).mak: config-host.mak))
|
||||
|
||||
$(BUILD_TCG_TARGET_RULES): build-tcg-tests-%: $(if $(CONFIG_PLUGIN),test-plugins)
|
||||
$(call quiet-command,$(MAKE) $(SUBDIR_MAKEFLAGS) \
|
||||
-f $(SRC_PATH)/tests/tcg/Makefile.qemu \
|
||||
SRC_PATH=$(SRC_PATH) \
|
||||
V="$(V)" TARGET="$*" guest-tests, \
|
||||
"BUILD", "TCG tests for $*")
|
||||
.PHONY: $(TCG_TESTS_TARGETS:%=build-tcg-tests-%)
|
||||
$(TCG_TESTS_TARGETS:%=build-tcg-tests-%): build-tcg-tests-%: $(BUILD_DIR)/tests/tcg/config-%.mak
|
||||
$(call quiet-command, \
|
||||
$(MAKE) -C tests/tcg/$* -f ../Makefile.target $(SUBDIR_MAKEFLAGS) \
|
||||
DOCKER_SCRIPT="$(DOCKER_SCRIPT)" \
|
||||
TARGET="$*" SRC_PATH="$(SRC_PATH)", \
|
||||
"BUILD","$* guest-tests")
|
||||
|
||||
$(RUN_TCG_TARGET_RULES): run-tcg-tests-%: build-tcg-tests-% all
|
||||
$(call quiet-command,$(MAKE) $(SUBDIR_MAKEFLAGS) \
|
||||
-f $(SRC_PATH)/tests/tcg/Makefile.qemu \
|
||||
SRC_PATH=$(SRC_PATH) SPEED="$(SPEED)" \
|
||||
V="$(V)" TARGET="$*" run-guest-tests, \
|
||||
"RUN", "TCG tests for $*")
|
||||
.PHONY: $(TCG_TESTS_TARGETS:%=run-tcg-tests-%)
|
||||
$(TCG_TESTS_TARGETS:%=run-tcg-tests-%): run-tcg-tests-%: build-tcg-tests-% $(if $(CONFIG_PLUGIN),test-plugins)
|
||||
$(call quiet-command, \
|
||||
$(MAKE) -C tests/tcg/$* -f ../Makefile.target $(SUBDIR_MAKEFLAGS) \
|
||||
TARGET="$*" SRC_PATH="$(SRC_PATH)" SPEED=$(SPEED) run, \
|
||||
"RUN", "$* guest-tests")
|
||||
|
||||
$(CLEAN_TCG_TARGET_RULES): clean-tcg-tests-%:
|
||||
$(call quiet-command,$(MAKE) $(SUBDIR_MAKEFLAGS) \
|
||||
-f $(SRC_PATH)/tests/tcg/Makefile.qemu \
|
||||
SRC_PATH=$(SRC_PATH) TARGET="$*" clean-guest-tests, \
|
||||
"CLEAN", "TCG tests for $*")
|
||||
.PHONY: $(TCG_TESTS_TARGETS:%=clean-tcg-tests-%)
|
||||
$(TCG_TESTS_TARGETS:%=clean-tcg-tests-%): clean-tcg-tests-%:
|
||||
$(call quiet-command, \
|
||||
$(MAKE) -C tests/tcg/$* -f ../Makefile.target $(SUBDIR_MAKEFLAGS) \
|
||||
TARGET="$*" SRC_PATH="$(SRC_PATH)" clean, \
|
||||
"CLEAN", "$* guest-tests")
|
||||
|
||||
.PHONY: build-tcg
|
||||
build-tcg: $(BUILD_TCG_TARGET_RULES)
|
||||
@@ -81,6 +83,9 @@ clean-tcg: $(CLEAN_TCG_TARGET_RULES)
|
||||
|
||||
.PHONY: check-venv check-avocado check-acceptance check-acceptance-deprecated-warning
|
||||
|
||||
# Build up our target list from the filtered list of ninja targets
|
||||
TARGETS=$(patsubst libqemu-%.fa, %, $(filter libqemu-%.fa, $(ninja-targets)))
|
||||
|
||||
TESTS_VENV_DIR=$(BUILD_DIR)/tests/venv
|
||||
TESTS_VENV_REQ=$(SRC_PATH)/tests/requirements.txt
|
||||
TESTS_RESULTS_DIR=$(BUILD_DIR)/tests/results
|
||||
|
||||
@@ -325,31 +325,6 @@ class BootLinuxConsole(LinuxKernelTest):
|
||||
kernel_hash = '18d1c68f2e23429e266ca39ba5349ccd0aeb7180'
|
||||
self.do_test_mips_malta32el_nanomips(kernel_url, kernel_hash)
|
||||
|
||||
def test_aarch64_virt(self):
|
||||
"""
|
||||
:avocado: tags=arch:aarch64
|
||||
:avocado: tags=machine:virt
|
||||
:avocado: tags=accel:tcg
|
||||
:avocado: tags=cpu:cortex-a53
|
||||
"""
|
||||
kernel_url = ('https://archives.fedoraproject.org/pub/archive/fedora'
|
||||
'/linux/releases/29/Everything/aarch64/os/images/pxeboot'
|
||||
'/vmlinuz')
|
||||
kernel_hash = '8c73e469fc6ea06a58dc83a628fc695b693b8493'
|
||||
kernel_path = self.fetch_asset(kernel_url, asset_hash=kernel_hash)
|
||||
|
||||
self.vm.set_console()
|
||||
kernel_command_line = (self.KERNEL_COMMON_COMMAND_LINE +
|
||||
'console=ttyAMA0')
|
||||
self.require_accelerator("tcg")
|
||||
self.vm.add_args('-cpu', 'cortex-a53',
|
||||
'-accel', 'tcg',
|
||||
'-kernel', kernel_path,
|
||||
'-append', kernel_command_line)
|
||||
self.vm.launch()
|
||||
console_pattern = 'Kernel command line: %s' % kernel_command_line
|
||||
self.wait_for_console_pattern(console_pattern)
|
||||
|
||||
def test_aarch64_xlnx_versal_virt(self):
|
||||
"""
|
||||
:avocado: tags=arch:aarch64
|
||||
|
||||
@@ -0,0 +1,51 @@
|
||||
# Functional test that boots a Linux kernel and checks the console
|
||||
#
|
||||
# Copyright (c) 2022 Linaro Ltd.
|
||||
#
|
||||
# Author:
|
||||
# Alex Bennée <alex.bennee@linaro.org>
|
||||
#
|
||||
# SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
import time
|
||||
|
||||
from avocado_qemu import QemuSystemTest
|
||||
from avocado_qemu import wait_for_console_pattern
|
||||
from avocado_qemu import exec_command
|
||||
|
||||
class Aarch64VirtMachine(QemuSystemTest):
|
||||
KERNEL_COMMON_COMMAND_LINE = 'printk.time=0 '
|
||||
|
||||
def wait_for_console_pattern(self, success_message, vm=None):
|
||||
wait_for_console_pattern(self, success_message,
|
||||
failure_message='Kernel panic - not syncing',
|
||||
vm=vm)
|
||||
|
||||
def test_aarch64_virt(self):
|
||||
"""
|
||||
:avocado: tags=arch:aarch64
|
||||
:avocado: tags=machine:virt
|
||||
:avocado: tags=accel:tcg
|
||||
:avocado: tags=cpu:max
|
||||
"""
|
||||
kernel_url = ('https://fileserver.linaro.org/s/'
|
||||
'z6B2ARM7DQT3HWN/download')
|
||||
|
||||
kernel_hash = 'ed11daab50c151dde0e1e9c9cb8b2d9bd3215347'
|
||||
kernel_path = self.fetch_asset(kernel_url, asset_hash=kernel_hash)
|
||||
|
||||
self.vm.set_console()
|
||||
kernel_command_line = (self.KERNEL_COMMON_COMMAND_LINE +
|
||||
'console=ttyAMA0')
|
||||
self.require_accelerator("tcg")
|
||||
self.vm.add_args('-cpu', 'max,pauth-impdef=on',
|
||||
'-accel', 'tcg',
|
||||
'-kernel', kernel_path,
|
||||
'-append', kernel_command_line)
|
||||
self.vm.launch()
|
||||
self.wait_for_console_pattern('Welcome to Buildroot')
|
||||
time.sleep(0.1)
|
||||
exec_command(self, 'root')
|
||||
time.sleep(0.1)
|
||||
exec_command(self, 'cat /proc/self/maps')
|
||||
time.sleep(0.1)
|
||||
@@ -8,33 +8,13 @@ COMMA := ,
|
||||
|
||||
HOST_ARCH = $(if $(ARCH),$(ARCH),$(shell uname -m))
|
||||
|
||||
# These variables can be set by the user to limit the set of docker
|
||||
# images and tests to a more restricted subset
|
||||
TESTS ?= %
|
||||
IMAGES ?= %
|
||||
|
||||
DOCKER_SUFFIX := .docker
|
||||
DOCKER_FILES_DIR := $(SRC_PATH)/tests/docker/dockerfiles
|
||||
# we don't run tests on intermediate images (used as base by another image)
|
||||
DOCKER_PARTIAL_IMAGES := debian10 debian11
|
||||
# we don't directly build virtual images (they are used to build other images)
|
||||
DOCKER_VIRTUAL_IMAGES := debian-bootstrap debian-toolchain empty
|
||||
__IMAGES := $(sort $(filter-out $(DOCKER_VIRTUAL_IMAGES), $(notdir $(basename $(wildcard $(DOCKER_FILES_DIR)/*.docker)))))
|
||||
DOCKER_IMAGES := $(if $(IMAGES), $(filter $(IMAGES), $(__IMAGES)), $(__IMAGES))
|
||||
DOCKER_TARGETS := $(patsubst %,docker-image-%,$(DOCKER_IMAGES))
|
||||
# Use a global constant ccache directory to speed up repetitive builds
|
||||
DOCKER_CCACHE_DIR := $$HOME/.cache/qemu-docker-ccache
|
||||
ifeq ($(HOST_ARCH),x86_64)
|
||||
DOCKER_DEFAULT_REGISTRY := registry.gitlab.com/qemu-project/qemu
|
||||
endif
|
||||
DOCKER_REGISTRY := $(if $(REGISTRY),$(REGISTRY),$(DOCKER_DEFAULT_REGISTRY))
|
||||
|
||||
__TESTS := $(notdir $(shell \
|
||||
find $(SRC_PATH)/tests/docker/ -name 'test-*' -type f))
|
||||
DOCKER_TESTS := $(if $(TESTS), $(filter $(TESTS), $(__TESTS)), $(__TESTS))
|
||||
|
||||
ENGINE := auto
|
||||
|
||||
DOCKER_SCRIPT=$(SRC_PATH)/tests/docker/docker.py --engine $(ENGINE)
|
||||
|
||||
CUR_TIME := $(shell date +%Y-%m-%d-%H.%M.%S.$$$$)
|
||||
@@ -53,17 +33,7 @@ $(DOCKER_SRC_COPY):
|
||||
|
||||
docker-qemu-src: $(DOCKER_SRC_COPY)
|
||||
|
||||
docker-image: ${DOCKER_TARGETS}
|
||||
|
||||
# General rule for building docker images. If we are a sub-make
|
||||
# invoked with SKIP_DOCKER_BUILD we still check the image is up to date
|
||||
# though
|
||||
ifdef SKIP_DOCKER_BUILD
|
||||
docker-image-%: $(DOCKER_FILES_DIR)/%.docker
|
||||
$(call quiet-command, \
|
||||
$(DOCKER_SCRIPT) check --quiet qemu/$* $<, \
|
||||
"CHECK", "$*")
|
||||
else
|
||||
# General rule for building docker images.
|
||||
docker-image-%: $(DOCKER_FILES_DIR)/%.docker
|
||||
$(call quiet-command,\
|
||||
$(DOCKER_SCRIPT) build -t qemu/$* -f $< \
|
||||
@@ -99,27 +69,9 @@ docker-binfmt-image-debian-%: $(DOCKER_FILES_DIR)/debian-bootstrap.docker
|
||||
{ echo "You will need to build $(EXECUTABLE)"; exit 1;},\
|
||||
"CHECK", "debian-$* exists"))
|
||||
|
||||
# These are test targets
|
||||
USER_TCG_TARGETS=$(patsubst %-linux-user,qemu-%,$(filter %-linux-user,$(TARGET_DIRS)))
|
||||
EXEC_COPY_TESTS=$(patsubst %,docker-exec-copy-test-%, $(USER_TCG_TARGETS))
|
||||
|
||||
$(EXEC_COPY_TESTS): docker-exec-copy-test-%: $(DOCKER_FILES_DIR)/empty.docker
|
||||
$(call quiet-command, \
|
||||
$(DOCKER_SCRIPT) build -t qemu/exec-copy-test-$* -f $< \
|
||||
$(if $V,,--quiet) --no-cache \
|
||||
--include-executable=$* \
|
||||
--skip-binfmt, \
|
||||
"TEST","copy $* to container")
|
||||
$(call quiet-command, \
|
||||
$(DOCKER_SCRIPT) run qemu/exec-copy-test-$* \
|
||||
/$* -version > tests/docker-exec-copy-test-$*.out, \
|
||||
"TEST","check $* works in container")
|
||||
|
||||
docker-exec-copy-test: $(EXEC_COPY_TESTS)
|
||||
|
||||
endif
|
||||
|
||||
# Enforce dependencies for composite images
|
||||
# we don't run tests on intermediate images (used as base by another image)
|
||||
DOCKER_PARTIAL_IMAGES := debian10 debian11
|
||||
ifeq ($(HOST_ARCH),x86_64)
|
||||
docker-image-debian-amd64: docker-image-debian10
|
||||
DOCKER_PARTIAL_IMAGES += debian-amd64-cross
|
||||
@@ -159,28 +111,6 @@ docker-image-debian11: NOUSER=1
|
||||
# alpine has no adduser
|
||||
docker-image-alpine: NOUSER=1
|
||||
|
||||
#
|
||||
# The build rule for hexagon-cross is special in so far for most of
|
||||
# the time we don't want to build it. While dockers caching does avoid
|
||||
# this most of the time sometimes we want to force the issue.
|
||||
#
|
||||
docker-image-debian-hexagon-cross: $(DOCKER_FILES_DIR)/debian-hexagon-cross.docker
|
||||
$(if $(NOCACHE), \
|
||||
$(call quiet-command, \
|
||||
$(DOCKER_SCRIPT) build -t qemu/debian-hexagon-cross -f $< \
|
||||
$(if $V,,--quiet) --no-cache \
|
||||
--registry $(DOCKER_REGISTRY) --extra-files \
|
||||
$(DOCKER_FILES_DIR)/debian-hexagon-cross.docker.d/build-toolchain.sh, \
|
||||
"BUILD", "debian-hexagon-cross"), \
|
||||
$(call quiet-command, \
|
||||
$(DOCKER_SCRIPT) fetch $(if $V,,--quiet) \
|
||||
qemu/debian-hexagon-cross $(DOCKER_REGISTRY), \
|
||||
"FETCH", "debian-hexagon-cross") \
|
||||
$(call quiet-command, \
|
||||
$(DOCKER_SCRIPT) update $(if $V,,--quiet) \
|
||||
qemu/debian-hexagon-cross --add-current-user, \
|
||||
"PREPARE", "debian-hexagon-cross"))
|
||||
|
||||
debian-toolchain-run = \
|
||||
$(if $(NOCACHE), \
|
||||
$(call quiet-command, \
|
||||
@@ -200,6 +130,10 @@ debian-toolchain-run = \
|
||||
"PREPARE", $1))
|
||||
debian-toolchain = $(call debian-toolchain-run,$(patsubst docker-image-%,%,$1))
|
||||
|
||||
docker-image-debian-hexagon-cross: $(DOCKER_FILES_DIR)/debian-hexagon-cross.docker \
|
||||
$(DOCKER_FILES_DIR)/debian-hexagon-cross.d/build-toolchain.sh
|
||||
$(call debian-toolchain, $@)
|
||||
|
||||
docker-image-debian-microblaze-cross: $(DOCKER_FILES_DIR)/debian-toolchain.docker \
|
||||
$(DOCKER_FILES_DIR)/debian-microblaze-cross.d/build-toolchain.sh
|
||||
$(call debian-toolchain, $@)
|
||||
@@ -229,17 +163,20 @@ DOCKER_PARTIAL_IMAGES += debian-tricore-cross
|
||||
DOCKER_PARTIAL_IMAGES += debian-xtensa-cross
|
||||
DOCKER_PARTIAL_IMAGES += fedora-cris-cross
|
||||
|
||||
# Rules for building linux-user powered images
|
||||
#
|
||||
# These are slower than using native cross compiler setups but can
|
||||
# work around issues with poorly working multi-arch systems and broken
|
||||
# packages.
|
||||
# images that are only used to build other images
|
||||
DOCKER_VIRTUAL_IMAGES := debian-bootstrap debian-toolchain
|
||||
|
||||
__IMAGES := $(sort $(filter-out $(DOCKER_VIRTUAL_IMAGES), $(notdir $(basename $(wildcard $(DOCKER_FILES_DIR)/*.docker)))))
|
||||
DOCKER_IMAGES := $(if $(IMAGES), $(filter $(IMAGES), $(__IMAGES)), $(__IMAGES))
|
||||
|
||||
__TESTS := $(notdir $(shell find $(SRC_PATH)/tests/docker/ -name 'test-*' -type f))
|
||||
DOCKER_TESTS := $(if $(TESTS), $(filter $(TESTS), $(__TESTS)), $(__TESTS))
|
||||
|
||||
# Expand all the pre-requistes for each docker image and test combination
|
||||
$(foreach i,$(filter-out $(DOCKER_PARTIAL_IMAGES) $(DOCKER_VIRTUAL_IMAGES),$(DOCKER_IMAGES)), \
|
||||
$(foreach i,$(filter-out $(DOCKER_PARTIAL_IMAGES),$(DOCKER_IMAGES)), \
|
||||
$(foreach t,$(DOCKER_TESTS), \
|
||||
$(eval .PHONY: docker-$t@$i) \
|
||||
$(eval docker-$t@$i: docker-image-$i docker-run-$t@$i) \
|
||||
$(eval docker-$t@$i: docker-image-$i; @$(MAKE) docker-run TEST=$t IMAGE=$i) \
|
||||
) \
|
||||
$(foreach t,$(DOCKER_TESTS), \
|
||||
$(eval docker-all-tests: docker-$t@$i) \
|
||||
@@ -266,11 +203,6 @@ docker:
|
||||
@echo
|
||||
@echo 'Available container images:'
|
||||
@echo ' $(DOCKER_IMAGES)'
|
||||
ifneq ($(DOCKER_USER_IMAGES),)
|
||||
@echo
|
||||
@echo 'Available linux-user images (docker-binfmt-image-debian-%):'
|
||||
@echo ' $(DOCKER_USER_IMAGES)'
|
||||
endif
|
||||
@echo
|
||||
@echo 'Available tests:'
|
||||
@echo ' $(DOCKER_TESTS)'
|
||||
@@ -298,9 +230,12 @@ endif
|
||||
|
||||
docker-help: docker
|
||||
|
||||
# Use a global constant ccache directory to speed up repetitive builds
|
||||
DOCKER_CCACHE_DIR := $$HOME/.cache/qemu-docker-ccache
|
||||
|
||||
# This rule if for directly running against an arbitrary docker target.
|
||||
# It is called by the expanded docker targets (e.g. make
|
||||
# docker-test-foo@bar) which will do additional verification.
|
||||
# docker-test-foo@bar) which will also ensure the image is up to date.
|
||||
#
|
||||
# For example: make docker-run TEST="test-quick" IMAGE="debian:arm64" EXECUTABLE=./aarch64-linux-user/qemu-aarch64
|
||||
#
|
||||
@@ -335,13 +270,7 @@ docker-run: docker-qemu-src
|
||||
$(call quiet-command, rm -r $(DOCKER_SRC_COPY), \
|
||||
" CLEANUP $(DOCKER_SRC_COPY)")
|
||||
|
||||
# Run targets:
|
||||
#
|
||||
# Of the form docker-TEST-FOO@IMAGE-BAR which will then be expanded into a call to "make docker-run"
|
||||
docker-run-%: CMD = $(shell echo '$@' | sed -e 's/docker-run-\([^@]*\)@\(.*\)/\1/')
|
||||
docker-run-%: IMAGE = $(shell echo '$@' | sed -e 's/docker-run-\([^@]*\)@\(.*\)/\2/')
|
||||
docker-run-%:
|
||||
@$(MAKE) docker-run TEST=$(CMD) IMAGE=qemu/$(IMAGE)
|
||||
docker-image: ${DOCKER_IMAGES:%=docker-image-%}
|
||||
|
||||
docker-clean:
|
||||
$(call quiet-command, $(DOCKER_SCRIPT) clean)
|
||||
|
||||
@@ -676,63 +676,6 @@ class CcCommand(SubCommand):
|
||||
as_user=True)
|
||||
|
||||
|
||||
class CheckCommand(SubCommand):
|
||||
"""Check if we need to re-build a docker image out of a dockerfile.
|
||||
Arguments: <tag> <dockerfile>"""
|
||||
name = "check"
|
||||
|
||||
def args(self, parser):
|
||||
parser.add_argument("tag",
|
||||
help="Image Tag")
|
||||
parser.add_argument("dockerfile", default=None,
|
||||
help="Dockerfile name", nargs='?')
|
||||
parser.add_argument("--checktype", choices=["checksum", "age"],
|
||||
default="checksum", help="check type")
|
||||
parser.add_argument("--olderthan", default=60, type=int,
|
||||
help="number of minutes")
|
||||
|
||||
def run(self, args, argv):
|
||||
tag = args.tag
|
||||
|
||||
try:
|
||||
dkr = Docker()
|
||||
except subprocess.CalledProcessError:
|
||||
print("Docker not set up")
|
||||
return 1
|
||||
|
||||
info = dkr.inspect_tag(tag)
|
||||
if info is None:
|
||||
print("Image does not exist")
|
||||
return 1
|
||||
|
||||
if args.checktype == "checksum":
|
||||
if not args.dockerfile:
|
||||
print("Need a dockerfile for tag:%s" % (tag))
|
||||
return 1
|
||||
|
||||
dockerfile = _read_dockerfile(args.dockerfile)
|
||||
|
||||
if dkr.image_matches_dockerfile(tag, dockerfile):
|
||||
if not args.quiet:
|
||||
print("Image is up to date")
|
||||
return 0
|
||||
else:
|
||||
print("Image needs updating")
|
||||
return 1
|
||||
elif args.checktype == "age":
|
||||
timestr = dkr.get_image_creation_time(info).split(".")[0]
|
||||
created = datetime.strptime(timestr, "%Y-%m-%dT%H:%M:%S")
|
||||
past = datetime.now() - timedelta(minutes=args.olderthan)
|
||||
if created < past:
|
||||
print ("Image created @ %s more than %d minutes old" %
|
||||
(timestr, args.olderthan))
|
||||
return 1
|
||||
else:
|
||||
if not args.quiet:
|
||||
print ("Image less than %d minutes old" % (args.olderthan))
|
||||
return 0
|
||||
|
||||
|
||||
def main():
|
||||
global USE_ENGINE
|
||||
|
||||
|
||||
@@ -1,8 +0,0 @@
|
||||
#
|
||||
# Empty Dockerfile
|
||||
#
|
||||
|
||||
FROM scratch
|
||||
|
||||
# Add everything from the context into the container
|
||||
ADD . /
|
||||
@@ -92,17 +92,18 @@ if __name__ == '__main__':
|
||||
|
||||
result = subprocess.call(gdb_cmd, shell=True, stdout=output)
|
||||
|
||||
# A negative result is the result of an internal gdb failure like
|
||||
# a crash. We force a return of 0 so we don't fail the test on
|
||||
# A result of greater than 128 indicates a fatal signal (likely a
|
||||
# crash due to gdb internal failure). That's a problem for GDB and
|
||||
# not the test so we force a return of 0 so we don't fail the test on
|
||||
# account of broken external tools.
|
||||
if result < 0:
|
||||
print("GDB crashed? SKIPPING")
|
||||
if result > 128:
|
||||
log(output, "GDB crashed? (%d, %d) SKIPPING" % (result, result - 128))
|
||||
exit(0)
|
||||
|
||||
try:
|
||||
inferior.wait(2)
|
||||
except subprocess.TimeoutExpired:
|
||||
print("GDB never connected? Killed guest")
|
||||
log(output, "GDB never connected? Killed guest")
|
||||
inferior.kill()
|
||||
|
||||
exit(result)
|
||||
|
||||
@@ -1,18 +0,0 @@
|
||||
# -*- Mode: makefile -*-
|
||||
#
|
||||
# TCG Compiler Probe
|
||||
#
|
||||
# This Makefile fragment is included multiple times in the main make
|
||||
# script to probe for available compilers. This is used to build up a
|
||||
# selection of required docker targets before we invoke a sub-make for
|
||||
# each target.
|
||||
|
||||
DOCKER_IMAGE:=
|
||||
|
||||
-include $(BUILD_DIR)/tests/tcg/config-$(PROBE_TARGET).mak
|
||||
|
||||
ifneq ($(DOCKER_IMAGE),)
|
||||
build-tcg-tests-$(PROBE_TARGET): docker-image-$(DOCKER_IMAGE)
|
||||
endif
|
||||
$(BUILD_DIR)/tests/tcg/config_$(PROBE_TARGET).mak: config-host.mak
|
||||
config-host.mak: $(SRC_PATH)/tests/tcg/configure.sh
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user