* finish atomics revamp

* meson.build tweaks
 * revert avocado update
 * always upgrade/downgrade locally installed Python packages
 * switch from submodules to subprojects
 * remove --with-git= option
 * rename --enable-pypi to --enable-download, control submodules and subprojects too
 -----BEGIN PGP SIGNATURE-----
 
 iQFIBAABCAAyFiEE8TM4V0tmI4mGbHaCv/vSX3jHroMFAmR/Qu8UHHBib256aW5p
 QHJlZGhhdC5jb20ACgkQv/vSX3jHroMmSwgAj5SHD8R+5D1UmptzBvI/72CfgqVv
 MJa4O1LvHwUkuSmxX1MFFhRa0mo0bu6j+bPpvJ29zKS61ybVwJl87gnsRcDAMXe7
 08YbcG35Chox6aZxbidUQtXm18JZ3F2aMtmxUuP0PR7LDjVXLV5FsjrHTIt8KuEZ
 vUqq3IsVbc4FxCCC0ke2DzrtgpRCxYSdfPrj/t5WzAztAXId9r1zvUlCLN+FUpri
 E3KIZYpkXZyOnJQ9W30KnsZo5QtDACwlIMBK6whSdoCjyNN7TwDdhNW8QkOueNO6
 q3tLfwf5+u6uyEoaQTW+teE2oMXT8N4IJllRJj2RyQ1BFD49XhUUJmc33Q==
 =b9QD
 -----END PGP SIGNATURE-----

Merge tag 'for-upstream' of https://gitlab.com/bonzini/qemu into staging

* finish atomics revamp
* meson.build tweaks
* revert avocado update
* always upgrade/downgrade locally installed Python packages
* switch from submodules to subprojects
* remove --with-git= option
* rename --enable-pypi to --enable-download, control submodules and subprojects too

# -----BEGIN PGP SIGNATURE-----
#
# iQFIBAABCAAyFiEE8TM4V0tmI4mGbHaCv/vSX3jHroMFAmR/Qu8UHHBib256aW5p
# QHJlZGhhdC5jb20ACgkQv/vSX3jHroMmSwgAj5SHD8R+5D1UmptzBvI/72CfgqVv
# MJa4O1LvHwUkuSmxX1MFFhRa0mo0bu6j+bPpvJ29zKS61ybVwJl87gnsRcDAMXe7
# 08YbcG35Chox6aZxbidUQtXm18JZ3F2aMtmxUuP0PR7LDjVXLV5FsjrHTIt8KuEZ
# vUqq3IsVbc4FxCCC0ke2DzrtgpRCxYSdfPrj/t5WzAztAXId9r1zvUlCLN+FUpri
# E3KIZYpkXZyOnJQ9W30KnsZo5QtDACwlIMBK6whSdoCjyNN7TwDdhNW8QkOueNO6
# q3tLfwf5+u6uyEoaQTW+teE2oMXT8N4IJllRJj2RyQ1BFD49XhUUJmc33Q==
# =b9QD
# -----END PGP SIGNATURE-----
# gpg: Signature made Tue 06 Jun 2023 07:30:07 AM PDT
# gpg:                using RSA key F13338574B662389866C7682BFFBD25F78C7AE83
# gpg:                issuer "pbonzini@redhat.com"
# gpg: Good signature from "Paolo Bonzini <bonzini@gnu.org>" [unknown]
# gpg:                 aka "Paolo Bonzini <pbonzini@redhat.com>" [unknown]
# 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: 46F5 9FBD 57D6 12E7 BFD4  E2F7 7E15 100C CD36 69B1
#      Subkey fingerprint: F133 3857 4B66 2389 866C  7682 BFFB D25F 78C7 AE83

* tag 'for-upstream' of https://gitlab.com/bonzini/qemu: (21 commits)
  configure: remove --with-git-submodules=
  build: remove git submodule handling from main makefile
  meson: subprojects: replace berkeley-{soft,test}float-3 with wraps
  pc-bios/s390-ccw: always build network bootloader
  configure: move SLOF submodule handling to pc-bios/s390-ccw
  meson: subprojects: replace submodules with wrap files
  build: log submodule update from git-submodule.sh
  git-submodule: allow partial update of .git-submodule-status
  configure: rename --enable-pypi to --enable-download, control subprojects too
  configure: remove --with-git= option
  mkvenv: always pass locally-installed packages to pip
  tests: Use separate virtual environment for avocado
  Revert "tests/requirements.txt: bump up avocado-framework version to 101.0"
  scsi/qemu-pr-helper: Drop support for 'old' libmultipath API
  meson.build: Use -Wno-undef only for SDL2 versions that need it
  meson.build: Group the audio backend entries in a separate summary section
  meson.build: Group the network backend entries in a separate summary section
  meson.build: Group the UI entries in a separate summary section
  scripts: remove dead file
  atomics: eliminate mb_read/mb_set
  ...

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
This commit is contained in:
Richard Henderson 2023-06-06 10:17:20 -07:00
commit 80bdd58ae4
47 changed files with 900 additions and 947 deletions

2
.gitignore vendored
View file

@ -20,5 +20,3 @@ GTAGS
*.swp *.swp
*.patch *.patch
*.gcov *.gcov
/subprojects/slirp

View file

@ -42,8 +42,8 @@
stage: test stage: test
image: $CI_REGISTRY_IMAGE/qemu/$IMAGE:latest image: $CI_REGISTRY_IMAGE/qemu/$IMAGE:latest
script: script:
- scripts/git-submodule.sh update - scripts/git-submodule.sh update roms/SLOF
$(sed -n '/GIT_SUBMODULES=/ s/.*=// p' build/config-host.mak) - meson subprojects download $(cd build/subprojects && echo *)
- cd build - cd build
- find . -type f -exec touch {} + - find . -type f -exec touch {} +
# Avoid recompiling by hiding ninja with NINJA=":" # Avoid recompiling by hiding ninja with NINJA=":"

View file

@ -103,7 +103,7 @@ crash-test-debian:
script: script:
- cd build - cd build
- make NINJA=":" check-venv - make NINJA=":" check-venv
- pyvenv/bin/python3 scripts/device-crash-test -q --tcg-only ./qemu-system-i386 - tests/venv/bin/python3 scripts/device-crash-test -q --tcg-only ./qemu-system-i386
build-system-fedora: build-system-fedora:
extends: extends:
@ -146,8 +146,8 @@ crash-test-fedora:
script: script:
- cd build - cd build
- make NINJA=":" check-venv - make NINJA=":" check-venv
- pyvenv/bin/python3 scripts/device-crash-test -q ./qemu-system-ppc - tests/venv/bin/python3 scripts/device-crash-test -q ./qemu-system-ppc
- pyvenv/bin/python3 scripts/device-crash-test -q ./qemu-system-riscv32 - tests/venv/bin/python3 scripts/device-crash-test -q ./qemu-system-riscv32
build-system-centos: build-system-centos:
extends: extends:

15
.gitmodules vendored
View file

@ -13,9 +13,6 @@
[submodule "roms/qemu-palcode"] [submodule "roms/qemu-palcode"]
path = roms/qemu-palcode path = roms/qemu-palcode
url = https://gitlab.com/qemu-project/qemu-palcode.git url = https://gitlab.com/qemu-project/qemu-palcode.git
[submodule "subprojects/dtc"]
path = subprojects/dtc
url = https://gitlab.com/qemu-project/dtc.git
[submodule "roms/u-boot"] [submodule "roms/u-boot"]
path = roms/u-boot path = roms/u-boot
url = https://gitlab.com/qemu-project/u-boot.git url = https://gitlab.com/qemu-project/u-boot.git
@ -25,21 +22,12 @@
[submodule "roms/QemuMacDrivers"] [submodule "roms/QemuMacDrivers"]
path = roms/QemuMacDrivers path = roms/QemuMacDrivers
url = https://gitlab.com/qemu-project/QemuMacDrivers.git url = https://gitlab.com/qemu-project/QemuMacDrivers.git
[submodule "subprojects/keycodemapdb"]
path = subprojects/keycodemapdb
url = https://gitlab.com/qemu-project/keycodemapdb.git
[submodule "roms/seabios-hppa"] [submodule "roms/seabios-hppa"]
path = roms/seabios-hppa path = roms/seabios-hppa
url = https://gitlab.com/qemu-project/seabios-hppa.git url = https://gitlab.com/qemu-project/seabios-hppa.git
[submodule "roms/u-boot-sam460ex"] [submodule "roms/u-boot-sam460ex"]
path = roms/u-boot-sam460ex path = roms/u-boot-sam460ex
url = https://gitlab.com/qemu-project/u-boot-sam460ex.git url = https://gitlab.com/qemu-project/u-boot-sam460ex.git
[submodule "tests/fp/berkeley-testfloat-3"]
path = tests/fp/berkeley-testfloat-3
url = https://gitlab.com/qemu-project/berkeley-testfloat-3.git
[submodule "tests/fp/berkeley-softfloat-3"]
path = tests/fp/berkeley-softfloat-3
url = https://gitlab.com/qemu-project/berkeley-softfloat-3.git
[submodule "roms/edk2"] [submodule "roms/edk2"]
path = roms/edk2 path = roms/edk2
url = https://gitlab.com/qemu-project/edk2.git url = https://gitlab.com/qemu-project/edk2.git
@ -55,6 +43,3 @@
[submodule "tests/lcitool/libvirt-ci"] [submodule "tests/lcitool/libvirt-ci"]
path = tests/lcitool/libvirt-ci path = tests/lcitool/libvirt-ci
url = https://gitlab.com/libvirt/libvirt-ci.git url = https://gitlab.com/libvirt/libvirt-ci.git
[submodule "subprojects/libvfio-user"]
path = subprojects/libvfio-user
url = https://gitlab.com/qemu-project/libvfio-user.git

View file

@ -45,18 +45,6 @@ include config-host.mak
include Makefile.prereqs include Makefile.prereqs
Makefile.prereqs: config-host.mak Makefile.prereqs: config-host.mak
git-submodule-update:
.git-submodule-status: git-submodule-update config-host.mak
Makefile: .git-submodule-status
.PHONY: git-submodule-update
git-submodule-update:
ifneq ($(GIT_SUBMODULES_ACTION),ignore)
$(call quiet-command, \
(GIT="$(GIT)" "$(SRC_PATH)/scripts/git-submodule.sh" $(GIT_SUBMODULES_ACTION) $(GIT_SUBMODULES)), \
"GIT","$(GIT_SUBMODULES)")
endif
# 0. ensure the build tree is okay # 0. ensure the build tree is okay
# Check that we're not trying to do an out-of-tree build from # Check that we're not trying to do an out-of-tree build from

View file

@ -774,7 +774,7 @@ static inline bool cpu_handle_interrupt(CPUState *cpu,
* Ensure zeroing happens before reading cpu->exit_request or * Ensure zeroing happens before reading cpu->exit_request or
* cpu->interrupt_request (see also smp_wmb in cpu_exit()) * cpu->interrupt_request (see also smp_wmb in cpu_exit())
*/ */
qatomic_mb_set(&cpu_neg(cpu)->icount_decr.u16.high, 0); qatomic_set_mb(&cpu_neg(cpu)->icount_decr.u16.high, 0);
if (unlikely(qatomic_read(&cpu->interrupt_request))) { if (unlikely(qatomic_read(&cpu->interrupt_request))) {
int interrupt_request; int interrupt_request;

View file

@ -119,7 +119,7 @@ static void *mttcg_cpu_thread_fn(void *arg)
} }
} }
qatomic_mb_set(&cpu->exit_request, 0); qatomic_set_mb(&cpu->exit_request, 0);
qemu_wait_io_event(cpu); qemu_wait_io_event(cpu);
} while (!cpu->unplug || cpu_can_run(cpu)); } while (!cpu->unplug || cpu_can_run(cpu));

View file

@ -244,7 +244,7 @@ static void *rr_cpu_thread_fn(void *arg)
while (cpu && cpu_work_list_empty(cpu) && !cpu->exit_request) { while (cpu && cpu_work_list_empty(cpu) && !cpu->exit_request) {
/* Store rr_current_cpu before evaluating cpu_can_run(). */ /* Store rr_current_cpu before evaluating cpu_can_run(). */
qatomic_mb_set(&rr_current_cpu, cpu); qatomic_set_mb(&rr_current_cpu, cpu);
current_cpu = cpu; current_cpu = cpu;
@ -287,7 +287,7 @@ static void *rr_cpu_thread_fn(void *arg)
qatomic_set(&rr_current_cpu, NULL); qatomic_set(&rr_current_cpu, NULL);
if (cpu && cpu->exit_request) { if (cpu && cpu->exit_request) {
qatomic_mb_set(&cpu->exit_request, 0); qatomic_set_mb(&cpu->exit_request, 0);
} }
if (icount_enabled() && all_cpu_threads_idle()) { if (icount_enabled() && all_cpu_threads_idle()) {

169
configure vendored
View file

@ -246,14 +246,7 @@ for opt do
done done
if test -e "$source_path/.git" git_submodules_action="update"
then
git_submodules_action="update"
else
git_submodules_action="ignore"
fi
git_submodules="subprojects/keycodemapdb"
git="git" git="git"
debug_tcg="no" debug_tcg="no"
docs="auto" docs="auto"
@ -266,10 +259,9 @@ bsd_user=""
plugins="$default_feature" plugins="$default_feature"
ninja="" ninja=""
python= python=
pypi="enabled" download="enabled"
bindir="bin" bindir="bin"
skip_meson=no skip_meson=no
vfio_user_server="disabled"
use_containers="yes" use_containers="yes"
gdb_bin=$(command -v "gdb-multiarch" || command -v "gdb") gdb_bin=$(command -v "gdb-multiarch" || command -v "gdb")
gdb_arches="" gdb_arches=""
@ -281,16 +273,13 @@ unset target_list_exclude
# The following Meson options are handled manually (still they # The following Meson options are handled manually (still they
# are included in the automatically generated help message) # are included in the automatically generated help message)
# because they automatically enable/disable other options
# 1. Track which submodules are needed
fdt="auto"
# 2. Automatically enable/disable other options
tcg="auto" tcg="auto"
cfi="false" cfi="false"
# 3. Need to check for -static-pie before Meson runs. Also, # Meson has PIE as a boolean rather than enabled/disabled/auto,
# Meson has PIE as a boolean rather than enabled/disabled/auto. # and we also need to check for -static-pie before Meson runs
# which requires knowing whether --static is enabled.
pie="" pie=""
static="no" static="no"
@ -743,22 +732,9 @@ for opt do
;; ;;
--disable-cfi) cfi="false" --disable-cfi) cfi="false"
;; ;;
--disable-fdt) fdt="disabled" --disable-download) download="disabled"; git_submodules_action=validate;
;; ;;
--enable-fdt) fdt="enabled" --enable-download) download="enabled"; git_submodules_action=update;
;;
--enable-fdt=git) fdt="internal"
;;
--enable-fdt=*) fdt="$optarg"
;;
--with-git=*) git="$optarg"
;;
--with-git-submodules=*)
git_submodules_action="$optarg"
;;
--disable-pypi) pypi="disabled"
;;
--enable-pypi) pypi="enabled"
;; ;;
--enable-plugins) if test "$mingw32" = "yes"; then --enable-plugins) if test "$mingw32" = "yes"; then
error_exit "TCG plugins not currently supported on Windows platforms" error_exit "TCG plugins not currently supported on Windows platforms"
@ -774,57 +750,47 @@ for opt do
;; ;;
--gdb=*) gdb_bin="$optarg" --gdb=*) gdb_bin="$optarg"
;; ;;
--enable-vfio-user-server) vfio_user_server="enabled"
;;
--disable-vfio-user-server) vfio_user_server="disabled"
;;
# everything else has the same name in configure and meson # everything else has the same name in configure and meson
--*) meson_option_parse "$opt" "$optarg" --*) meson_option_parse "$opt" "$optarg"
;; ;;
esac esac
done done
if ! test -e "$source_path/.git"
then
git_submodules_action="ignore"
fi
# test for any invalid configuration combinations # test for any invalid configuration combinations
if test "$plugins" = "yes" -a "$tcg" = "disabled"; then if test "$plugins" = "yes" -a "$tcg" = "disabled"; then
error_exit "Can't enable plugins on non-TCG builds" error_exit "Can't enable plugins on non-TCG builds"
fi fi
case $git_submodules_action in if ! test -f "$source_path/subprojects/keycodemapdb/README" \
update|validate) && test -f "$download" = disabled
if test ! -e "$source_path/.git"; then then
echo "ERROR: cannot $git_submodules_action git submodules without .git" echo
exit 1 echo "ERROR: missing subprojects"
fi echo
;; if test -e "$source_path/.git"; then
ignore) echo "--disable-download specified but subprojects were not"
if ! test -f "$source_path/subprojects/keycodemapdb/README" echo 'checked out. Please invoke "meson subprojects download"'
then echo "before configuring QEMU, or remove --disable-download"
echo echo "from the command line."
echo "ERROR: missing GIT submodules" else
echo echo "This is not a GIT checkout but subproject content appears to"
if test -e "$source_path/.git"; then echo "be missing. Do not use 'git archive' or GitHub download links"
echo "--with-git-submodules=ignore specified but submodules were not" echo "to acquire QEMU source archives. Non-GIT builds are only"
echo "checked out. Please initialize and update submodules." echo "supported with source archives linked from:"
else echo
echo "This is not a GIT checkout but module content appears to" echo " https://www.qemu.org/download/#source"
echo "be missing. Do not use 'git archive' or GitHub download links" echo
echo "to acquire QEMU source archives. Non-GIT builds are only" echo "Developers working with GIT can use scripts/archive-source.sh"
echo "supported with source archives linked from:" echo "if they need to create valid source archives."
echo fi
echo " https://www.qemu.org/download/#source" echo
echo exit 1
echo "Developers working with GIT can use scripts/archive-source.sh" fi
echo "if they need to create valid source archives."
fi
echo
exit 1
fi
;;
*)
echo "ERROR: invalid --with-git-submodules= value '$git_submodules_action'"
exit 1
;;
esac
default_target_list="" default_target_list=""
mak_wilds="" mak_wilds=""
@ -892,10 +858,6 @@ Advanced options (experts only):
--python=PYTHON use specified python [$python] --python=PYTHON use specified python [$python]
--ninja=NINJA use specified ninja [$ninja] --ninja=NINJA use specified ninja [$ninja]
--smbd=SMBD use specified smbd [$smbd] --smbd=SMBD use specified smbd [$smbd]
--with-git=GIT use specified git [$git]
--with-git-submodules=update update git submodules (default if .git dir exists)
--with-git-submodules=validate fail if git submodules are not up to date
--with-git-submodules=ignore do not update or check git submodules (default if no .git dir)
--static enable static build [$static] --static enable static build [$static]
--bindir=PATH install binaries in PATH --bindir=PATH install binaries in PATH
--with-suffix=SUFFIX suffix for QEMU data inside datadir/libdir/sysconfdir/docdir [$qemu_suffix] --with-suffix=SUFFIX suffix for QEMU data inside datadir/libdir/sysconfdir/docdir [$qemu_suffix]
@ -963,7 +925,7 @@ python="$(command -v "$python")"
# - venv is allowed to use system packages; # - venv is allowed to use system packages;
# - all setup can be performed offline; # - all setup can be performed offline;
# - missing packages may be fetched from PyPI, # - missing packages may be fetched from PyPI,
# unless --disable-pypi is passed. # unless --disable-download is passed.
# - pip is not installed into the venv when possible, # - pip is not installed into the venv when possible,
# but ensurepip is called as a fallback when necessary. # but ensurepip is called as a fallback when necessary.
@ -980,7 +942,7 @@ python="$python -B"
mkvenv="$python ${source_path}/python/scripts/mkvenv.py" mkvenv="$python ${source_path}/python/scripts/mkvenv.py"
mkvenv_flags="" mkvenv_flags=""
if test "$pypi" = "enabled" ; then if test "$download" = "enabled" ; then
mkvenv_flags="--online" mkvenv_flags="--online"
fi fi
@ -1003,7 +965,7 @@ meson="$(cd pyvenv/bin; pwd)/meson"
# Conditionally ensure Sphinx is installed. # Conditionally ensure Sphinx is installed.
mkvenv_flags="" mkvenv_flags=""
if test "$pypi" = "enabled" -a "$docs" = "enabled" ; then if test "$download" = "enabled" -a "$docs" = "enabled" ; then
mkvenv_flags="--online" mkvenv_flags="--online"
fi fi
@ -1040,7 +1002,7 @@ fi
# Consult white-list to determine whether to enable werror # Consult white-list to determine whether to enable werror
# by default. Only enable by default for git builds # by default. Only enable by default for git builds
if test -z "$werror" ; then if test -z "$werror" ; then
if test "$git_submodules_action" != "ignore" && \ if test -e "$source_path/.git" && \
{ test "$linux" = "yes" || test "$mingw32" = "yes"; }; then { test "$linux" = "yes" || test "$mingw32" = "yes"; }; then
werror="yes" werror="yes"
else else
@ -1135,11 +1097,6 @@ if test "$tcg" = "auto"; then
fi fi
fi fi
if test "$tcg" = "enabled"; then
git_submodules="$git_submodules tests/fp/berkeley-testfloat-3"
git_submodules="$git_submodules tests/fp/berkeley-softfloat-3"
fi
########################################## ##########################################
# big/little endian test # big/little endian test
cat > $TMPC << EOF cat > $TMPC << EOF
@ -1167,16 +1124,6 @@ EOF
fi fi
fi fi
##########################################
# fdt probe
case "$fdt" in
auto | enabled | internal)
# Simpler to always update submodule, even if not needed.
git_submodules="${git_submodules} subprojects/dtc"
;;
esac
######################################## ########################################
# check if ccache is interfering with # check if ccache is interfering with
# semantic analysis of macros # semantic analysis of macros
@ -1612,17 +1559,6 @@ write_target_makefile() {
fi fi
} }
##########################################
# check for vfio_user_server
case "$vfio_user_server" in
enabled )
if test "$git_submodules_action" != "ignore"; then
git_submodules="${git_submodules} subprojects/libvfio-user"
fi
;;
esac
####################################### #######################################
# cross-compiled firmware targets # cross-compiled firmware targets
@ -1676,7 +1612,8 @@ fi
# Only build s390-ccw bios if the compiler has -march=z900 or -march=z10 # Only build s390-ccw bios if the compiler has -march=z900 or -march=z10
# (which is the lowest architecture level that Clang supports) # (which is the lowest architecture level that Clang supports)
if have_target s390x-softmmu && probe_target_compiler s390x-softmmu; then if have_target s390x-softmmu && probe_target_compiler s390x-softmmu && \
GIT=git "$source_path/scripts/git-submodule.sh" "$git_submodules_action" roms/SLOF >> config.log 2>&1; then
write_c_skeleton write_c_skeleton
do_compiler "$target_cc" $target_cc_cflags -march=z900 -o $TMPO -c $TMPC do_compiler "$target_cc" $target_cc_cflags -march=z900 -o $TMPO -c $TMPC
has_z900=$? has_z900=$?
@ -1689,29 +1626,20 @@ if have_target s390x-softmmu && probe_target_compiler s390x-softmmu; then
config_mak=pc-bios/s390-ccw/config-host.mak config_mak=pc-bios/s390-ccw/config-host.mak
echo "# Automatically generated by configure - do not modify" > $config_mak echo "# Automatically generated by configure - do not modify" > $config_mak
echo "SRC_PATH=$source_path/pc-bios/s390-ccw" >> $config_mak echo "SRC_PATH=$source_path/pc-bios/s390-ccw" >> $config_mak
echo "GIT_SUBMODULES_ACTION=$git_submodules_action" >> $config_mak
write_target_makefile >> $config_mak write_target_makefile >> $config_mak
# SLOF is required for building the s390-ccw firmware on s390x,
# since it is using the libnet code from SLOF for network booting.
git_submodules="${git_submodules} roms/SLOF"
fi fi
fi fi
####################################### #######################################
# generate config-host.mak # generate config-host.mak
if ! (GIT="$git" "$source_path/scripts/git-submodule.sh" "$git_submodules_action" "$git_submodules"); then
exit 1
fi
config_host_mak="config-host.mak" config_host_mak="config-host.mak"
echo "# Automatically generated by configure - do not modify" > $config_host_mak echo "# Automatically generated by configure - do not modify" > $config_host_mak
echo >> $config_host_mak echo >> $config_host_mak
echo all: >> $config_host_mak echo all: >> $config_host_mak
echo "GIT=$git" >> $config_host_mak
echo "GIT_SUBMODULES=$git_submodules" >> $config_host_mak
echo "GIT_SUBMODULES_ACTION=$git_submodules_action" >> $config_host_mak
if test "$debug_tcg" = "yes" ; then if test "$debug_tcg" = "yes" ; then
echo "CONFIG_DEBUG_TCG=y" >> $config_host_mak echo "CONFIG_DEBUG_TCG=y" >> $config_host_mak
@ -1944,11 +1872,8 @@ if test "$skip_meson" = no; then
rm -rf meson-private meson-info meson-logs rm -rf meson-private meson-info meson-logs
# Prevent meson from automatically downloading wrapped subprojects when missing.
# You can use 'meson subprojects download' before running configure.
meson_option_add "--wrap-mode=nodownload"
# Built-in options # Built-in options
test "$download" = "disabled" && meson_option_add "--wrap-mode=nodownload"
test "$bindir" != "bin" && meson_option_add "-Dbindir=$bindir" test "$bindir" != "bin" && meson_option_add "-Dbindir=$bindir"
test "$default_feature" = no && meson_option_add -Dauto_features=disabled test "$default_feature" = no && meson_option_add -Dauto_features=disabled
test "$static" = yes && meson_option_add -Dprefer_static=true test "$static" = yes && meson_option_add -Dprefer_static=true
@ -1958,12 +1883,10 @@ if test "$skip_meson" = no; then
# QEMU options # QEMU options
test "$cfi" != false && meson_option_add "-Dcfi=$cfi" test "$cfi" != false && meson_option_add "-Dcfi=$cfi"
test "$docs" != auto && meson_option_add "-Ddocs=$docs" test "$docs" != auto && meson_option_add "-Ddocs=$docs"
test "$fdt" != auto && meson_option_add "-Dfdt=$fdt"
test -n "${LIB_FUZZING_ENGINE+xxx}" && meson_option_add "-Dfuzzing_engine=$LIB_FUZZING_ENGINE" test -n "${LIB_FUZZING_ENGINE+xxx}" && meson_option_add "-Dfuzzing_engine=$LIB_FUZZING_ENGINE"
test "$qemu_suffix" != qemu && meson_option_add "-Dqemu_suffix=$qemu_suffix" test "$qemu_suffix" != qemu && meson_option_add "-Dqemu_suffix=$qemu_suffix"
test "$smbd" != '' && meson_option_add "-Dsmbd=$smbd" test "$smbd" != '' && meson_option_add "-Dsmbd=$smbd"
test "$tcg" != enabled && meson_option_add "-Dtcg=$tcg" test "$tcg" != enabled && meson_option_add "-Dtcg=$tcg"
test "$vfio_user_server" != auto && meson_option_add "-Dvfio_user_server=$vfio_user_server"
run_meson() { run_meson() {
NINJA=$ninja $meson setup --prefix "$prefix" "$@" $cross_arg "$PWD" "$source_path" NINJA=$ninja $meson setup --prefix "$prefix" "$@" $cross_arg "$PWD" "$source_path"
} }

View file

@ -61,19 +61,19 @@ Under ``tests/avocado/`` as the root we have:
:: ::
$ make check-venv (needed only the first time to create the venv) $ make check-venv (needed only the first time to create the venv)
$ ./pyvenv/bin/avocado run -t acpi tests/avocado $ ./tests/venv/bin/avocado run -t acpi tests/avocado
The above will run all acpi avocado tests including this one. The above will run all acpi avocado tests including this one.
In order to run the individual tests, perform the following: In order to run the individual tests, perform the following:
:: ::
$ ./pyvenv/bin/avocado run tests/avocado/acpi-bits.py --tap - $ ./tests/venv/bin/avocado run tests/avocado/acpi-bits.py --tap -
The above will produce output in tap format. You can omit "--tap -" in the The above will produce output in tap format. You can omit "--tap -" in the
end and it will produce output like the following: end and it will produce output like the following:
:: ::
$ ./pyvenv/bin/avocado run tests/avocado/acpi-bits.py $ ./tests/venv/bin/avocado run tests/avocado/acpi-bits.py
Fetching asset from tests/avocado/acpi-bits.py:AcpiBitsTest.test_acpi_smbios_bits Fetching asset from tests/avocado/acpi-bits.py:AcpiBitsTest.test_acpi_smbios_bits
JOB ID : eab225724da7b64c012c65705dc2fa14ab1defef JOB ID : eab225724da7b64c012c65705dc2fa14ab1defef
JOB LOG : /home/anisinha/avocado/job-results/job-2022-10-10T17.58-eab2257/job.log JOB LOG : /home/anisinha/avocado/job-results/job-2022-10-10T17.58-eab2257/job.log

View file

@ -102,28 +102,10 @@ Similar operations return the new value of ``*ptr``::
typeof(*ptr) qatomic_or_fetch(ptr, val) typeof(*ptr) qatomic_or_fetch(ptr, val)
typeof(*ptr) qatomic_xor_fetch(ptr, val) typeof(*ptr) qatomic_xor_fetch(ptr, val)
``qemu/atomic.h`` also provides loads and stores that cannot be reordered ``qemu/atomic.h`` also provides an optimized shortcut for
with each other:: ``qatomic_set`` followed by ``smp_mb``::
typeof(*ptr) qatomic_mb_read(ptr) void qatomic_set_mb(ptr, val)
void qatomic_mb_set(ptr, val)
However these do not provide sequential consistency and, in particular,
they do not participate in the total ordering enforced by
sequentially-consistent operations. For this reason they are deprecated.
They should instead be replaced with any of the following (ordered from
easiest to hardest):
- accesses inside a mutex or spinlock
- lightweight synchronization primitives such as ``QemuEvent``
- RCU operations (``qatomic_rcu_read``, ``qatomic_rcu_set``) when publishing
or accessing a new version of a data structure
- other atomic accesses: ``qatomic_read`` and ``qatomic_load_acquire`` for
loads, ``qatomic_set`` and ``qatomic_store_release`` for stores, ``smp_mb``
to forbid reordering subsequent loads before a store.
Weak atomic access and manual memory barriers Weak atomic access and manual memory barriers
@ -523,8 +505,7 @@ and memory barriers, and the equivalents in QEMU:
| :: | | :: |
| | | |
| a = qatomic_read(&x); | | a = qatomic_read(&x); |
| qatomic_set(&x, a + 2); | | qatomic_set_mb(&x, a + 2); |
| smp_mb(); |
| b = qatomic_read(&y); | | b = qatomic_read(&y); |
+--------------------------------+ +--------------------------------+

View file

@ -888,9 +888,9 @@ You can run the avocado tests simply by executing:
make check-avocado make check-avocado
This involves the automatic installation, from PyPI, of all the This involves the automatic creation of Python virtual environment
necessary avocado-framework dependencies into the QEMU venv within the within the build tree (at ``tests/venv``) which will have all the
build tree (at ``./pyvenv``). Test results are also saved within the right dependencies, and will save tests results also within the
build tree (at ``tests/results``). build tree (at ``tests/results``).
Note: the build environment must be using a Python 3 stack, and have Note: the build environment must be using a Python 3 stack, and have
@ -947,7 +947,7 @@ may be invoked by running:
.. code:: .. code::
pyvenv/bin/avocado run $OPTION1 $OPTION2 tests/avocado/ tests/venv/bin/avocado run $OPTION1 $OPTION2 tests/avocado/
Note that if ``make check-avocado`` was not executed before, it is Note that if ``make check-avocado`` was not executed before, it is
possible to create the Python virtual environment with the dependencies possible to create the Python virtual environment with the dependencies
@ -962,20 +962,20 @@ a test file. To run tests from a single file within the build tree, use:
.. code:: .. code::
pyvenv/bin/avocado run tests/avocado/$TESTFILE tests/venv/bin/avocado run tests/avocado/$TESTFILE
To run a single test within a test file, use: To run a single test within a test file, use:
.. code:: .. code::
pyvenv/bin/avocado run tests/avocado/$TESTFILE:$TESTCLASS.$TESTNAME tests/venv/bin/avocado run tests/avocado/$TESTFILE:$TESTCLASS.$TESTNAME
Valid test names are visible in the output from any previous execution Valid test names are visible in the output from any previous execution
of Avocado or ``make check-avocado``, and can also be queried using: of Avocado or ``make check-avocado``, and can also be queried using:
.. code:: .. code::
pyvenv/bin/avocado list tests/avocado tests/venv/bin/avocado list tests/avocado
Manual Installation Manual Installation
~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~

View file

@ -259,24 +259,17 @@
# define smp_mb__after_rmw() smp_mb() # define smp_mb__after_rmw() smp_mb()
#endif #endif
/* qatomic_mb_read/set semantics map Java volatile variables. They are /*
* less expensive on some platforms (notably POWER) than fully * On some architectures, qatomic_set_mb is more efficient than a store
* sequentially consistent operations. * plus a fence.
*
* As long as they are used as paired operations they are safe to
* use. See docs/devel/atomics.rst for more discussion.
*/ */
#define qatomic_mb_read(ptr) \
qatomic_load_acquire(ptr)
#if !defined(QEMU_SANITIZE_THREAD) && \ #if !defined(QEMU_SANITIZE_THREAD) && \
(defined(__i386__) || defined(__x86_64__) || defined(__s390x__)) (defined(__i386__) || defined(__x86_64__) || defined(__s390x__))
/* This is more efficient than a store plus a fence. */ # define qatomic_set_mb(ptr, i) \
# define qatomic_mb_set(ptr, i) \
({ (void)qatomic_xchg(ptr, i); smp_mb__after_rmw(); }) ({ (void)qatomic_xchg(ptr, i); smp_mb__after_rmw(); })
#else #else
# define qatomic_mb_set(ptr, i) \ # define qatomic_set_mb(ptr, i) \
({ qatomic_store_release(ptr, i); smp_mb(); }) ({ qatomic_store_release(ptr, i); smp_mb(); })
#endif #endif

View file

@ -1092,9 +1092,8 @@ endif
mpathlibs = [libudev] mpathlibs = [libudev]
mpathpersist = not_found mpathpersist = not_found
mpathpersist_new_api = false
if targetos == 'linux' and have_tools and get_option('mpath').allowed() if targetos == 'linux' and have_tools and get_option('mpath').allowed()
mpath_test_source_new = ''' mpath_test_source = '''
#include <libudev.h> #include <libudev.h>
#include <mpath_persist.h> #include <mpath_persist.h>
unsigned mpath_mx_alloc_len = 1024; unsigned mpath_mx_alloc_len = 1024;
@ -1111,16 +1110,6 @@ if targetos == 'linux' and have_tools and get_option('mpath').allowed()
multipath_conf = mpath_lib_init(); multipath_conf = mpath_lib_init();
return 0; return 0;
}''' }'''
mpath_test_source_old = '''
#include <libudev.h>
#include <mpath_persist.h>
unsigned mpath_mx_alloc_len = 1024;
int logsink;
int main(void) {
struct udev *udev = udev_new();
mpath_lib_init(udev);
return 0;
}'''
libmpathpersist = cc.find_library('mpathpersist', libmpathpersist = cc.find_library('mpathpersist',
required: get_option('mpath')) required: get_option('mpath'))
if libmpathpersist.found() if libmpathpersist.found()
@ -1139,10 +1128,7 @@ if targetos == 'linux' and have_tools and get_option('mpath').allowed()
endforeach endforeach
if mpathlibs.length() == 0 if mpathlibs.length() == 0
msg = 'Dependencies missing for libmpathpersist' msg = 'Dependencies missing for libmpathpersist'
elif cc.links(mpath_test_source_new, dependencies: mpathlibs) elif cc.links(mpath_test_source, dependencies: mpathlibs)
mpathpersist = declare_dependency(dependencies: mpathlibs)
mpathpersist_new_api = true
elif cc.links(mpath_test_source_old, dependencies: mpathlibs)
mpathpersist = declare_dependency(dependencies: mpathlibs) mpathpersist = declare_dependency(dependencies: mpathlibs)
else else
msg = 'Cannot detect libmpathpersist API' msg = 'Cannot detect libmpathpersist API'
@ -1273,10 +1259,16 @@ if not get_option('sdl').auto() or have_system
sdl_image = not_found sdl_image = not_found
endif endif
if sdl.found() if sdl.found()
# work around 2.0.8 bug # Some versions of SDL have problems with -Wundef
sdl = declare_dependency(compile_args: '-Wno-undef', if not cc.compiles('''
dependencies: sdl, #include <SDL.h>
version: sdl.version()) #include <SDL_syswm.h>
int main(int argc, char *argv[]) { return 0; }
''', dependencies: sdl, args: '-Werror=undef')
sdl = declare_dependency(compile_args: '-Wno-undef',
dependencies: sdl,
version: sdl.version())
endif
sdl_image = dependency('SDL2_image', required: get_option('sdl_image'), sdl_image = dependency('SDL2_image', required: get_option('sdl_image'),
method: 'pkg-config') method: 'pkg-config')
else else
@ -1799,8 +1791,7 @@ malloc = []
if get_option('malloc') == 'system' if get_option('malloc') == 'system'
has_malloc_trim = \ has_malloc_trim = \
get_option('malloc_trim').allowed() and \ get_option('malloc_trim').allowed() and \
cc.links('''#include <malloc.h> cc.has_function('malloc_trim', prefix: '#include <malloc.h>')
int main(void) { malloc_trim(0); return 0; }''')
else else
has_malloc_trim = false has_malloc_trim = false
malloc = cc.find_library(get_option('malloc'), required: true) malloc = cc.find_library(get_option('malloc'), required: true)
@ -1813,34 +1804,19 @@ if not has_malloc_trim and get_option('malloc_trim').enabled()
endif endif
endif endif
# Check whether the glibc provides statx()
gnu_source_prefix = ''' gnu_source_prefix = '''
#ifndef _GNU_SOURCE #ifndef _GNU_SOURCE
#define _GNU_SOURCE #define _GNU_SOURCE
#endif #endif
''' '''
statx_test = gnu_source_prefix + '''
#include <sys/stat.h>
int main(void) {
struct statx statxbuf;
statx(0, "", 0, STATX_BASIC_STATS, &statxbuf);
return 0;
}'''
has_statx = cc.links(statx_test) # Check whether the glibc provides STATX_BASIC_STATS
has_statx = cc.has_header_symbol('sys/stat.h', 'STATX_BASIC_STATS', prefix: gnu_source_prefix)
# Check whether statx() provides mount ID information # Check whether statx() provides mount ID information
statx_mnt_id_test = gnu_source_prefix + ''' has_statx_mnt_id = cc.has_header_symbol('sys/stat.h', 'STATX_MNT_ID', prefix: gnu_source_prefix)
#include <sys/stat.h>
int main(void) {
struct statx statxbuf;
statx(0, "", 0, STATX_BASIC_STATS | STATX_MNT_ID, &statxbuf);
return statxbuf.stx_mnt_id;
}'''
has_statx_mnt_id = cc.links(statx_mnt_id_test)
have_vhost_user_blk_server = get_option('vhost_user_blk_server') \ have_vhost_user_blk_server = get_option('vhost_user_blk_server') \
.require(targetos == 'linux', .require(targetos == 'linux',
@ -2106,7 +2082,6 @@ config_host_data.set('CONFIG_GCOV', get_option('b_coverage'))
config_host_data.set('CONFIG_LIBUDEV', libudev.found()) config_host_data.set('CONFIG_LIBUDEV', libudev.found())
config_host_data.set('CONFIG_LZO', lzo.found()) config_host_data.set('CONFIG_LZO', lzo.found())
config_host_data.set('CONFIG_MPATH', mpathpersist.found()) config_host_data.set('CONFIG_MPATH', mpathpersist.found())
config_host_data.set('CONFIG_MPATH_NEW_API', mpathpersist_new_api)
config_host_data.set('CONFIG_BLKIO', blkio.found()) config_host_data.set('CONFIG_BLKIO', blkio.found())
if blkio.found() if blkio.found()
config_host_data.set('CONFIG_BLKIO_VHOST_VDPA_FD', config_host_data.set('CONFIG_BLKIO_VHOST_VDPA_FD',
@ -3058,14 +3033,7 @@ endif
libvfio_user_dep = not_found libvfio_user_dep = not_found
if have_system and vfio_user_server_allowed if have_system and vfio_user_server_allowed
have_internal = fs.exists(meson.current_source_dir() / 'subprojects/libvfio-user/meson.build') libvfio_user_proj = subproject('libvfio-user', required: true)
if not have_internal
error('libvfio-user source not found - please pull git submodule')
endif
libvfio_user_proj = subproject('libvfio-user')
libvfio_user_dep = libvfio_user_proj.get_variable('libvfio_user_dep') libvfio_user_dep = libvfio_user_proj.get_variable('libvfio_user_dep')
endif endif
@ -3093,12 +3061,6 @@ if fdt_required.length() > 0 or fdt_opt == 'enabled'
endif endif
if not fdt.found() if not fdt.found()
assert(fdt_opt == 'internal') assert(fdt_opt == 'internal')
have_internal = fs.exists(meson.current_source_dir() / 'subprojects/dtc/meson.build')
if not have_internal
error('libfdt source not found - please pull git submodule')
endif
libfdt_proj = subproject('dtc', required: true, libfdt_proj = subproject('dtc', required: true,
default_options: ['tools=false', 'yaml=disabled', default_options: ['tools=false', 'yaml=disabled',
'python=disabled', 'default_library=static']) 'python=disabled', 'default_library=static'])
@ -4012,8 +3974,14 @@ endif
# Configuration summary # # Configuration summary #
######################### #########################
# Directories # Build environment
summary_info = {} summary_info = {}
summary_info += {'Build directory': meson.current_build_dir()}
summary_info += {'Source path': meson.current_source_dir()}
summary_info += {'Download dependencies': get_option('wrap_mode') != 'nodownload'}
summary(summary_info, bool_yn: true, section: 'Build environment')
# Directories
summary_info += {'Install prefix': get_option('prefix')} summary_info += {'Install prefix': get_option('prefix')}
summary_info += {'BIOS directory': qemu_datadir} summary_info += {'BIOS directory': qemu_datadir}
pathsep = targetos == 'windows' ? ';' : ':' pathsep = targetos == 'windows' ? ';' : ':'
@ -4031,14 +3999,10 @@ else
summary_info += {'local state directory': 'queried at runtime'} summary_info += {'local state directory': 'queried at runtime'}
endif endif
summary_info += {'Doc directory': get_option('prefix') / get_option('docdir')} summary_info += {'Doc directory': get_option('prefix') / get_option('docdir')}
summary_info += {'Build directory': meson.current_build_dir()}
summary_info += {'Source path': meson.current_source_dir()}
summary_info += {'GIT submodules': config_host['GIT_SUBMODULES']}
summary(summary_info, bool_yn: true, section: 'Directories') summary(summary_info, bool_yn: true, section: 'Directories')
# Host binaries # Host binaries
summary_info = {} summary_info = {}
summary_info += {'git': config_host['GIT']}
summary_info += {'python': '@0@ (version: @1@)'.format(python.full_path(), python.language_version())} summary_info += {'python': '@0@ (version: @1@)'.format(python.full_path(), python.language_version())}
summary_info += {'sphinx-build': sphinx_build} summary_info += {'sphinx-build': sphinx_build}
if config_host.has_key('HAVE_GDB_BIN') if config_host.has_key('HAVE_GDB_BIN')
@ -4245,32 +4209,32 @@ summary_info += {'rng-none': get_option('rng_none')}
summary_info += {'Linux keyring': have_keyring} summary_info += {'Linux keyring': have_keyring}
summary(summary_info, bool_yn: true, section: 'Crypto') summary(summary_info, bool_yn: true, section: 'Crypto')
# Libraries # UI
summary_info = {} summary_info = {}
if targetos == 'darwin' if targetos == 'darwin'
summary_info += {'Cocoa support': cocoa} summary_info += {'Cocoa support': cocoa}
summary_info += {'vmnet.framework support': vmnet}
endif endif
summary_info += {'SDL support': sdl} summary_info += {'SDL support': sdl}
summary_info += {'SDL image support': sdl_image} summary_info += {'SDL image support': sdl_image}
summary_info += {'GTK support': gtk} summary_info += {'GTK support': gtk}
summary_info += {'pixman': pixman} summary_info += {'pixman': pixman}
summary_info += {'VTE support': vte} summary_info += {'VTE support': vte}
summary_info += {'slirp support': slirp}
summary_info += {'libtasn1': tasn1}
summary_info += {'PAM': pam}
summary_info += {'iconv support': iconv}
summary_info += {'curses support': curses}
summary_info += {'virgl support': virgl}
summary_info += {'blkio support': blkio}
summary_info += {'curl support': curl}
summary_info += {'Multipath support': mpathpersist}
summary_info += {'PNG support': png} summary_info += {'PNG support': png}
summary_info += {'VNC support': vnc} summary_info += {'VNC support': vnc}
if vnc.found() if vnc.found()
summary_info += {'VNC SASL support': sasl} summary_info += {'VNC SASL support': sasl}
summary_info += {'VNC JPEG support': jpeg} summary_info += {'VNC JPEG support': jpeg}
endif endif
summary_info += {'spice protocol support': spice_protocol}
if spice_protocol.found()
summary_info += {' spice server support': spice}
endif
summary_info += {'curses support': curses}
summary_info += {'brlapi support': brlapi}
summary(summary_info, bool_yn: true, section: 'User interface')
# Audio backends
summary_info = {}
if targetos not in ['darwin', 'haiku', 'windows'] if targetos not in ['darwin', 'haiku', 'windows']
summary_info += {'OSS support': oss} summary_info += {'OSS support': oss}
summary_info += {'sndio support': sndio} summary_info += {'sndio support': sndio}
@ -4283,12 +4247,30 @@ if targetos == 'linux'
summary_info += {'ALSA support': alsa} summary_info += {'ALSA support': alsa}
summary_info += {'PulseAudio support': pulse} summary_info += {'PulseAudio support': pulse}
endif endif
summary_info += {'Pipewire support': pipewire} summary_info += {'Pipewire support': pipewire}
summary_info += {'JACK support': jack} summary_info += {'JACK support': jack}
summary_info += {'brlapi support': brlapi} summary(summary_info, bool_yn: true, section: 'Audio backends')
# Network backends
summary_info = {}
if targetos == 'darwin'
summary_info += {'vmnet.framework support': vmnet}
endif
summary_info += {'slirp support': slirp}
summary_info += {'vde support': vde} summary_info += {'vde support': vde}
summary_info += {'netmap support': have_netmap} summary_info += {'netmap support': have_netmap}
summary_info += {'l2tpv3 support': have_l2tpv3} summary_info += {'l2tpv3 support': have_l2tpv3}
summary(summary_info, bool_yn: true, section: 'Network backends')
# Libraries
summary_info = {}
summary_info += {'libtasn1': tasn1}
summary_info += {'PAM': pam}
summary_info += {'iconv support': iconv}
summary_info += {'virgl support': virgl}
summary_info += {'blkio support': blkio}
summary_info += {'curl support': curl}
summary_info += {'Multipath support': mpathpersist}
summary_info += {'Linux AIO support': libaio} summary_info += {'Linux AIO support': libaio}
summary_info += {'Linux io_uring support': linux_io_uring} summary_info += {'Linux io_uring support': linux_io_uring}
summary_info += {'ATTR/XATTR support': libattr} summary_info += {'ATTR/XATTR support': libattr}
@ -4297,10 +4279,6 @@ summary_info += {'PVRDMA support': have_pvrdma}
summary_info += {'fdt support': fdt_opt == 'disabled' ? false : fdt_opt} summary_info += {'fdt support': fdt_opt == 'disabled' ? false : fdt_opt}
summary_info += {'libcap-ng support': libcap_ng} summary_info += {'libcap-ng support': libcap_ng}
summary_info += {'bpf support': libbpf} summary_info += {'bpf support': libbpf}
summary_info += {'spice protocol support': spice_protocol}
if spice_protocol.found()
summary_info += {' spice server support': spice}
endif
summary_info += {'rbd support': rbd} summary_info += {'rbd support': rbd}
summary_info += {'smartcard support': cacard} summary_info += {'smartcard support': cacard}
summary_info += {'U2F support': u2f} summary_info += {'U2F support': u2f}

View file

@ -246,7 +246,7 @@ static QMPRequest *monitor_qmp_dispatcher_pop_any(void)
* *
* Clear qmp_dispatcher_co_busy before reading request. * Clear qmp_dispatcher_co_busy before reading request.
*/ */
qatomic_mb_set(&qmp_dispatcher_co_busy, false); qatomic_set_mb(&qmp_dispatcher_co_busy, false);
WITH_QEMU_LOCK_GUARD(&monitor_lock) { WITH_QEMU_LOCK_GUARD(&monitor_lock) {
QMPRequest *req_obj; QMPRequest *req_obj;

View file

@ -6,6 +6,8 @@ include config-host.mak
CFLAGS = -O2 -g CFLAGS = -O2 -g
MAKEFLAGS += -rR MAKEFLAGS += -rR
GIT_SUBMODULES = roms/SLOF
NULL := NULL :=
SPACE := $(NULL) # SPACE := $(NULL) #
TARGET_PREFIX := $(patsubst %/,%:$(SPACE),$(TARGET_DIR)) TARGET_PREFIX := $(patsubst %/,%:$(SPACE),$(TARGET_DIR))
@ -65,12 +67,7 @@ s390-ccw.img: s390-ccw.elf
$(OBJECTS): Makefile $(OBJECTS): Makefile
ifneq ($(wildcard $(SRC_PATH)/../../roms/SLOF/lib/libnet),)
include $(SRC_PATH)/netboot.mak include $(SRC_PATH)/netboot.mak
else
s390-netboot.img:
@echo "s390-netboot.img not built since roms/SLOF/ is not available."
endif
ALL_OBJS = $(sort $(OBJECTS) $(NETOBJS) $(LIBCOBJS) $(LIBNETOBJS)) ALL_OBJS = $(sort $(OBJECTS) $(NETOBJS) $(LIBCOBJS) $(LIBNETOBJS))
-include $(ALL_OBJS:%.o=%.d) -include $(ALL_OBJS:%.o=%.d)
@ -80,3 +77,12 @@ clean:
distclean: distclean:
rm -f config-cc.mak rm -f config-cc.mak
.PHONY: git-submodule-update
$(SRC_PATH)/../../.git-submodule-status: git-submodule-update config-host.mak
Makefile: $(SRC_PATH)/../../.git-submodule-status
git-submodule-update:
ifneq ($(GIT_SUBMODULES_ACTION),ignore)
$(quiet-@)GIT=git "$(SRC_PATH)/../../scripts/git-submodule.sh" $(GIT_SUBMODULES_ACTION) $(GIT_SUBMODULES)
endif

View file

@ -553,6 +553,74 @@ def pkgname_from_depspec(dep_spec: str) -> str:
return match.group(0) return match.group(0)
def _get_path_importlib(package: str) -> Optional[str]:
# pylint: disable=import-outside-toplevel
# pylint: disable=no-name-in-module
# pylint: disable=import-error
try:
# First preference: Python 3.8+ stdlib
from importlib.metadata import ( # type: ignore
PackageNotFoundError,
distribution,
)
except ImportError as exc:
logger.debug("%s", str(exc))
# Second preference: Commonly available PyPI backport
from importlib_metadata import ( # type: ignore
PackageNotFoundError,
distribution,
)
try:
return str(distribution(package).locate_file("."))
except PackageNotFoundError:
return None
def _get_path_pkg_resources(package: str) -> Optional[str]:
# pylint: disable=import-outside-toplevel
# Bundled with setuptools; has a good chance of being available.
import pkg_resources
try:
return str(pkg_resources.get_distribution(package).location)
except pkg_resources.DistributionNotFound:
return None
def _get_path(package: str) -> Optional[str]:
try:
return _get_path_importlib(package)
except ImportError as exc:
logger.debug("%s", str(exc))
try:
return _get_path_pkg_resources(package)
except ImportError as exc:
logger.debug("%s", str(exc))
raise Ouch(
"Neither importlib.metadata nor pkg_resources found. "
"Use Python 3.8+, or install importlib-metadata or setuptools."
) from exc
def _path_is_prefix(prefix: Optional[str], path: str) -> bool:
try:
return (
prefix is not None and os.path.commonpath([prefix, path]) == prefix
)
except ValueError:
return False
def _is_system_package(package: str) -> bool:
path = _get_path(package)
return path is not None and not (
_path_is_prefix(sysconfig.get_path("purelib"), path)
or _path_is_prefix(sysconfig.get_path("platlib"), path)
)
def _get_version_importlib(package: str) -> Optional[str]: def _get_version_importlib(package: str) -> Optional[str]:
# pylint: disable=import-outside-toplevel # pylint: disable=import-outside-toplevel
# pylint: disable=no-name-in-module # pylint: disable=no-name-in-module
@ -741,8 +809,12 @@ def _do_ensure(
for spec in dep_specs: for spec in dep_specs:
matcher = distlib.version.LegacyMatcher(spec) matcher = distlib.version.LegacyMatcher(spec)
ver = _get_version(matcher.name) ver = _get_version(matcher.name)
if ver is None or not matcher.match( if (
distlib.version.LegacyVersion(ver) ver is None
# Always pass installed package to pip, so that they can be
# updated if the requested version changes
or not _is_system_package(matcher.name)
or not matcher.match(distlib.version.LegacyVersion(ver))
): ):
absent.append(spec) absent.append(spec)
else: else:

View file

@ -26,8 +26,7 @@ sub_file="${sub_tdir}/submodule.tar"
# independent of what the developer currently has initialized # independent of what the developer currently has initialized
# in their checkout, because the build environment is completely # in their checkout, because the build environment is completely
# different to the host OS. # different to the host OS.
submodules="subprojects/dtc subprojects/keycodemapdb" subprojects="dtc keycodemapdb libvfio-user berkeley-softfloat-3 berkeley-testfloat-3"
submodules="$submodules tests/fp/berkeley-softfloat-3 tests/fp/berkeley-testfloat-3"
sub_deinit="" sub_deinit=""
function cleanup() { function cleanup() {
@ -51,23 +50,11 @@ function tree_ish() {
git archive --format tar "$(tree_ish)" > "$tar_file" git archive --format tar "$(tree_ish)" > "$tar_file"
test $? -ne 0 && error "failed to archive qemu" test $? -ne 0 && error "failed to archive qemu"
for sm in $submodules; do
status="$(git submodule status "$sm")" for sp in $subprojects; do
smhash="${status#[ +-]}" meson subprojects download $sp
smhash="${smhash%% *}" test $? -ne 0 && error "failed to download subproject $sp"
case "$status" in tar --append --file "$tar_file" --exclude=.git subprojects/$sp
-*) test $? -ne 0 && error "failed to append subproject $sp to $tar_file"
sub_deinit="$sub_deinit $sm"
git submodule update --init "$sm"
test $? -ne 0 && error "failed to update submodule $sm"
;;
+*)
echo "WARNING: submodule $sm is out of sync"
;;
esac
(cd $sm; git archive --format tar --prefix "$sm/" $(tree_ish)) > "$sub_file"
test $? -ne 0 && error "failed to archive submodule $sm ($smhash)"
tar --concatenate --file "$tar_file" "$sub_file"
test $? -ne 0 && error "failed append submodule $sm to $tar_file"
done done
exit 0 exit 0

View file

@ -29,14 +29,11 @@
--extra-cflags="-O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection" \ --extra-cflags="-O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection" \
--with-suffix="qemu-kvm" \ --with-suffix="qemu-kvm" \
--firmwarepath=/usr/share/qemu-firmware \ --firmwarepath=/usr/share/qemu-firmware \
--with-git=meson \
--with-git-submodules=update \
--target-list="x86_64-softmmu" \ --target-list="x86_64-softmmu" \
--block-drv-rw-whitelist="qcow2,raw,file,host_device,nbd,iscsi,rbd,blkdebug,luks,null-co,nvme,copy-on-read,throttle,gluster" \ --block-drv-rw-whitelist="qcow2,raw,file,host_device,nbd,iscsi,rbd,blkdebug,luks,null-co,nvme,copy-on-read,throttle,gluster" \
--audio-drv-list="" \ --audio-drv-list="" \
--block-drv-ro-whitelist="vmdk,vhdx,vpc,https,ssh" \ --block-drv-ro-whitelist="vmdk,vhdx,vpc,https,ssh" \
--with-coroutine=ucontext \ --with-coroutine=ucontext \
--with-git=git \
--tls-priority=@QEMU,SYSTEM \ --tls-priority=@QEMU,SYSTEM \
--disable-attr \ --disable-attr \
--disable-auth-pam \ --disable-auth-pam \

View file

@ -4,7 +4,7 @@
# KVM and x86_64, or tests that are generic enough to be valid for all # KVM and x86_64, or tests that are generic enough to be valid for all
# targets. Such a test list can be generated with: # targets. Such a test list can be generated with:
# #
# ./pyvenv/bin/avocado list --filter-by-tags-include-empty \ # ./tests/venv/bin/avocado list --filter-by-tags-include-empty \
# --filter-by-tags-include-empty-key -t accel:kvm,arch:x86_64 \ # --filter-by-tags-include-empty-key -t accel:kvm,arch:x86_64 \
# tests/avocado/ # tests/avocado/
# #
@ -22,7 +22,7 @@
# - tests/avocado/virtio_check_params.py:VirtioMaxSegSettingsCheck.test_machine_types # - tests/avocado/virtio_check_params.py:VirtioMaxSegSettingsCheck.test_machine_types
# #
make get-vm-images make get-vm-images
./pyvenv/bin/avocado run \ ./tests/venv/bin/avocado run \
--job-results-dir=tests/results/ \ --job-results-dir=tests/results/ \
tests/avocado/boot_linux.py:BootLinuxX8664.test_pc_i440fx_kvm \ tests/avocado/boot_linux.py:BootLinuxX8664.test_pc_i440fx_kvm \
tests/avocado/boot_linux.py:BootLinuxX8664.test_pc_q35_kvm \ tests/avocado/boot_linux.py:BootLinuxX8664.test_pc_q35_kvm \

View file

@ -43,7 +43,7 @@ except ModuleNotFoundError as exc:
print(f"Module '{exc.name}' not found.") print(f"Module '{exc.name}' not found.")
print(" Try 'make check-venv' from your build directory,") print(" Try 'make check-venv' from your build directory,")
print(" and then one way to run this script is like so:") print(" and then one way to run this script is like so:")
print(f' > $builddir/pyvenv/bin/python3 "{path}"') print(f' > $builddir/tests/venv/bin/python3 "{path}"')
sys.exit(1) sys.exit(1)
logger = logging.getLogger('device-crash-test') logger = logging.getLogger('device-crash-test')

View file

@ -9,10 +9,10 @@ command=$1
shift shift
maybe_modules="$@" maybe_modules="$@"
# if --with-git-submodules=ignore, do nothing # if not running in a git checkout, do nothing
test "$command" = "ignore" && exit 0 test "$command" = "ignore" && exit 0
test -z "$GIT" && GIT=git test -z "$GIT" && GIT=$(command -v git)
cd "$(dirname "$0")/.." cd "$(dirname "$0")/.."
@ -21,19 +21,14 @@ update_error() {
echo echo
echo "Unable to automatically checkout GIT submodules '$modules'." echo "Unable to automatically checkout GIT submodules '$modules'."
echo "If you require use of an alternative GIT binary (for example to" echo "If you require use of an alternative GIT binary (for example to"
echo "enable use of a transparent proxy), then please specify it by" echo "enable use of a transparent proxy), please disable automatic"
echo "running configure by with the '--with-git' argument. e.g." echo "GIT submodule checkout with:"
echo echo
echo " $ ./configure --with-git='tsocks git'" echo " $ ./configure --disable-download"
echo
echo "Alternatively you may disable automatic GIT submodule checkout"
echo "with:"
echo
echo " $ ./configure --with-git-submodules=validate"
echo echo
echo "and then manually update submodules prior to running make, with:" echo "and then manually update submodules prior to running make, with:"
echo echo
echo " $ scripts/git-submodule.sh update $modules" echo " $ GIT='tsocks git' scripts/git-submodule.sh update $modules"
echo echo
exit 1 exit 1
} }
@ -44,19 +39,30 @@ validate_error() {
echo "configured for validate only. Please run" echo "configured for validate only. Please run"
echo " scripts/git-submodule.sh update $maybe_modules" echo " scripts/git-submodule.sh update $maybe_modules"
echo "from the source directory or call configure with" echo "from the source directory or call configure with"
echo " --with-git-submodules=update" echo " --enable-download"
echo "To disable GIT submodules validation, use"
echo " --with-git-submodules=ignore"
fi fi
exit 1 exit 1
} }
check_updated() {
local CURSTATUS OLDSTATUS
CURSTATUS=$($GIT submodule status $module)
OLDSTATUS=$(grep $module $substat)
test "$CURSTATUS" = "$OLDSTATUS"
}
if test -n "$maybe_modules" && ! test -e ".git" if test -n "$maybe_modules" && ! test -e ".git"
then then
echo "$0: unexpectedly called with submodules but no git checkout exists" echo "$0: unexpectedly called with submodules but no git checkout exists"
exit 1 exit 1
fi fi
if test -n "$maybe_modules" && test -z "$GIT"
then
echo "$0: unexpectedly called with submodules but git binary not found"
exit 1
fi
modules="" modules=""
for m in $maybe_modules for m in $maybe_modules
do do
@ -71,33 +77,34 @@ done
case "$command" in case "$command" in
status|validate) status|validate)
if test -z "$maybe_modules"
then
test -s ${substat} && validate_error "$command" || exit 0
fi
test -f "$substat" || validate_error "$command" test -f "$substat" || validate_error "$command"
test -z "$maybe_modules" && exit 0
for module in $modules; do for module in $modules; do
CURSTATUS=$($GIT submodule status $module) check_updated $module || validate_error "$command"
OLDSTATUS=$(cat $substat | grep $module)
if test "$CURSTATUS" != "$OLDSTATUS"; then
validate_error "$command"
fi
done done
exit 0 exit 0
;; ;;
update) update)
if test -z "$maybe_modules" test -e $substat || touch $substat
then test -z "$maybe_modules" && exit 0
test -e $substat || touch $substat
exit 0
fi
$GIT submodule update --init $modules 1>/dev/null $GIT submodule update --init $modules 1>/dev/null
test $? -ne 0 && update_error "failed to update modules" test $? -ne 0 && update_error "failed to update modules"
for module in $modules; do
check_updated $module || echo Updated "$module"
done
$GIT submodule status $modules > "${substat}" (while read -r; do
test $? -ne 0 && update_error "failed to save git submodule status" >&2 for module in $modules; do
case $REPLY in
*" $module "*) continue 2 ;;
esac
done
printf '%s\n' "$REPLY"
done
$GIT submodule status $modules
test $? -ne 0 && update_error "failed to save git submodule status" >&2) < $substat > $substat.new
mv -f $substat.new $substat
;; ;;
esac esac

View file

@ -16,6 +16,9 @@ if [ $# -ne 2 ]; then
exit 0 exit 0
fi fi
# Only include wraps that are invoked with subproject()
SUBPROJECTS="dtc libvfio-user keycodemapdb berkeley-softfloat-3 berkeley-testfloat-3"
src="$1" src="$1"
version="$2" version="$2"
destination=qemu-${version} destination=qemu-${version}
@ -26,6 +29,8 @@ git clone --single-branch -b "v${version}" -c advice.detachedHead=false \
pushd ${destination} pushd ${destination}
git submodule update --init --single-branch git submodule update --init --single-branch
meson subprojects download $SUBPROJECTS
(cd roms/seabios && git describe --tags --long --dirty > .version) (cd roms/seabios && git describe --tags --long --dirty > .version)
(cd roms/skiboot && ./make_version.sh > .version) (cd roms/skiboot && ./make_version.sh > .version)
# Fetch edk2 submodule's submodules, since it won't have access to them via # Fetch edk2 submodule's submodules, since it won't have access to them via

View file

@ -1,35 +0,0 @@
#! /usr/bin/env python3
# Wrapper for tests that hides the output if they succeed.
# Used by "make check"
#
# Copyright (C) 2020 Red Hat, Inc.
#
# Author: Paolo Bonzini <pbonzini@redhat.com>
import subprocess
import sys
import os
import argparse
parser = argparse.ArgumentParser(description='Test driver for QEMU')
parser.add_argument('-C', metavar='DIR', dest='dir', default='.',
help='change to DIR before doing anything else')
parser.add_argument('-v', '--verbose', dest='verbose', action='store_true',
help='be more verbose')
parser.add_argument('test_args', nargs=argparse.REMAINDER)
args = parser.parse_args()
os.chdir(args.dir)
test_args = args.test_args
if test_args[0] == '--':
test_args = test_args[1:]
if args.verbose:
result = subprocess.run(test_args, stdout=None, stderr=None)
else:
result = subprocess.run(test_args, stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
if result.returncode:
sys.stdout.buffer.write(result.stdout)
sys.exit(result.returncode)

View file

@ -280,11 +280,7 @@ void put_multipath_config(struct config *conf)
static void multipath_pr_init(void) static void multipath_pr_init(void)
{ {
udev = udev_new(); udev = udev_new();
#ifdef CONFIG_MPATH_NEW_API
multipath_conf = mpath_lib_init(); multipath_conf = mpath_lib_init();
#else
mpath_lib_init(udev);
#endif
} }
static int is_mpath(int fd) static int is_mpath(int fd)

View file

@ -405,7 +405,7 @@ static void qemu_cpu_stop(CPUState *cpu, bool exit)
void qemu_wait_io_event_common(CPUState *cpu) void qemu_wait_io_event_common(CPUState *cpu)
{ {
qatomic_mb_set(&cpu->thread_kicked, false); qatomic_set_mb(&cpu->thread_kicked, false);
if (cpu->stop) { if (cpu->stop) {
qemu_cpu_stop(cpu, false); qemu_cpu_stop(cpu, false);
} }

View file

@ -3132,7 +3132,7 @@ void address_space_unmap(AddressSpace *as, void *buffer, hwaddr len,
bounce.buffer = NULL; bounce.buffer = NULL;
memory_region_unref(bounce.mr); memory_region_unref(bounce.mr);
/* Clear in_use before reading map_client_list. */ /* Clear in_use before reading map_client_list. */
qatomic_mb_set(&bounce.in_use, false); qatomic_set_mb(&bounce.in_use, false);
cpu_notify_map_clients(); cpu_notify_map_clients();
} }

8
subprojects/.gitignore vendored Normal file
View file

@ -0,0 +1,8 @@
/packagecache
/berkeley-softfloat-3
/berkeley-testfloat-3
/dtc
/keycodemapdb
/libvfio-user
/slirp

View file

@ -0,0 +1,5 @@
[wrap-git]
url = https://gitlab.com/qemu-project/berkeley-softfloat-3
revision = b64af41c3276f97f0e181920400ee056b9c88037
patch_directory = berkeley-softfloat-3
depth = 1

View file

@ -0,0 +1,5 @@
[wrap-git]
url = https://gitlab.com/qemu-project/berkeley-testfloat-3
revision = 40619cbb3bf32872df8c53cc457039229428a263
patch_directory = berkeley-testfloat-3
depth = 1

@ -1 +0,0 @@
Subproject commit b6910bec11614980a21e46fbccc35934b671bd81

4
subprojects/dtc.wrap Normal file
View file

@ -0,0 +1,4 @@
[wrap-git]
url = https://gitlab.com/qemu-project/dtc.git
revision = b6910bec11614980a21e46fbccc35934b671bd81
depth = 1

@ -1 +0,0 @@
Subproject commit f5772a62ec52591ff6870b7e8ef32482371f22c6

View file

@ -0,0 +1,4 @@
[wrap-git]
url = https://gitlab.com/qemu-project/keycodemapdb.git
revision = f5772a62ec52591ff6870b7e8ef32482371f22c6
depth = 1

@ -1 +0,0 @@
Subproject commit 0b28d205572c80b568a1003db2c8f37ca333e4d7

View file

@ -0,0 +1,4 @@
[wrap-git]
url = https://gitlab.com/qemu-project/libvfio-user.git
revision = 0b28d205572c80b568a1003db2c8f37ca333e4d7
depth = 1

View file

@ -0,0 +1,339 @@
project('berkeley-softfloat-3', 'c',
default_options: ['warning_level=1', 'c_std=gnu99'])
fpcflags = get_option('defines')
platform_data = configuration_data()
platform_data.set('INLINE', 'static inline')
platform_data.set('LITTLEENDIAN', host_machine.endian() == 'little')
configure_file(output: 'platform.h', configuration: platform_data)
sfdir = 'source'
sfspedir = sfdir / '8086-SSE'
sfinc = include_directories('.', sfdir / 'include', sfspedir)
add_project_arguments([
'-Wno-implicit-fallthrough',
'-Wno-missing-prototypes',
'-Wno-redundant-decls',
'-Wno-return-type',
'-Wno-error',
], native: false, language: 'c')
libsoftfloat = static_library(
'softfloat',
files(
# primitives
sfdir / 's_eq128.c',
sfdir / 's_le128.c',
sfdir / 's_lt128.c',
sfdir / 's_shortShiftLeft128.c',
sfdir / 's_shortShiftRight128.c',
sfdir / 's_shortShiftRightJam64.c',
sfdir / 's_shortShiftRightJam64Extra.c',
sfdir / 's_shortShiftRightJam128.c',
sfdir / 's_shortShiftRightJam128Extra.c',
sfdir / 's_shiftRightJam32.c',
sfdir / 's_shiftRightJam64.c',
sfdir / 's_shiftRightJam64Extra.c',
sfdir / 's_shiftRightJam128.c',
sfdir / 's_shiftRightJam128Extra.c',
sfdir / 's_shiftRightJam256M.c',
sfdir / 's_countLeadingZeros8.c',
sfdir / 's_countLeadingZeros16.c',
sfdir / 's_countLeadingZeros32.c',
sfdir / 's_countLeadingZeros64.c',
sfdir / 's_add128.c',
sfdir / 's_add256M.c',
sfdir / 's_sub128.c',
sfdir / 's_sub256M.c',
sfdir / 's_mul64ByShifted32To128.c',
sfdir / 's_mul64To128.c',
sfdir / 's_mul128By32.c',
sfdir / 's_mul128To256M.c',
sfdir / 's_approxRecip_1Ks.c',
sfdir / 's_approxRecip32_1.c',
sfdir / 's_approxRecipSqrt_1Ks.c',
sfdir / 's_approxRecipSqrt32_1.c',
# others
sfdir / 's_roundToUI32.c',
sfdir / 's_roundToUI64.c',
sfdir / 's_roundToI32.c',
sfdir / 's_roundToI64.c',
sfdir / 's_normSubnormalF16Sig.c',
sfdir / 's_roundPackToF16.c',
sfdir / 's_normRoundPackToF16.c',
sfdir / 's_addMagsF16.c',
sfdir / 's_subMagsF16.c',
sfdir / 's_mulAddF16.c',
sfdir / 's_normSubnormalF32Sig.c',
sfdir / 's_roundPackToF32.c',
sfdir / 's_normRoundPackToF32.c',
sfdir / 's_addMagsF32.c',
sfdir / 's_subMagsF32.c',
sfdir / 's_mulAddF32.c',
sfdir / 's_normSubnormalF64Sig.c',
sfdir / 's_roundPackToF64.c',
sfdir / 's_normRoundPackToF64.c',
sfdir / 's_addMagsF64.c',
sfdir / 's_subMagsF64.c',
sfdir / 's_mulAddF64.c',
sfdir / 's_normSubnormalExtF80Sig.c',
sfdir / 's_roundPackToExtF80.c',
sfdir / 's_normRoundPackToExtF80.c',
sfdir / 's_addMagsExtF80.c',
sfdir / 's_subMagsExtF80.c',
sfdir / 's_normSubnormalF128Sig.c',
sfdir / 's_roundPackToF128.c',
sfdir / 's_normRoundPackToF128.c',
sfdir / 's_addMagsF128.c',
sfdir / 's_subMagsF128.c',
sfdir / 's_mulAddF128.c',
sfdir / 'softfloat_state.c',
sfdir / 'ui32_to_f16.c',
sfdir / 'ui32_to_f32.c',
sfdir / 'ui32_to_f64.c',
sfdir / 'ui32_to_extF80.c',
sfdir / 'ui32_to_extF80M.c',
sfdir / 'ui32_to_f128.c',
sfdir / 'ui32_to_f128M.c',
sfdir / 'ui64_to_f16.c',
sfdir / 'ui64_to_f32.c',
sfdir / 'ui64_to_f64.c',
sfdir / 'ui64_to_extF80.c',
sfdir / 'ui64_to_extF80M.c',
sfdir / 'ui64_to_f128.c',
sfdir / 'ui64_to_f128M.c',
sfdir / 'i32_to_f16.c',
sfdir / 'i32_to_f32.c',
sfdir / 'i32_to_f64.c',
sfdir / 'i32_to_extF80.c',
sfdir / 'i32_to_extF80M.c',
sfdir / 'i32_to_f128.c',
sfdir / 'i32_to_f128M.c',
sfdir / 'i64_to_f16.c',
sfdir / 'i64_to_f32.c',
sfdir / 'i64_to_f64.c',
sfdir / 'i64_to_extF80.c',
sfdir / 'i64_to_extF80M.c',
sfdir / 'i64_to_f128.c',
sfdir / 'i64_to_f128M.c',
sfdir / 'f16_to_ui32.c',
sfdir / 'f16_to_ui64.c',
sfdir / 'f16_to_i32.c',
sfdir / 'f16_to_i64.c',
sfdir / 'f16_to_ui32_r_minMag.c',
sfdir / 'f16_to_ui64_r_minMag.c',
sfdir / 'f16_to_i32_r_minMag.c',
sfdir / 'f16_to_i64_r_minMag.c',
sfdir / 'f16_to_f32.c',
sfdir / 'f16_to_f64.c',
sfdir / 'f16_to_extF80.c',
sfdir / 'f16_to_extF80M.c',
sfdir / 'f16_to_f128.c',
sfdir / 'f16_to_f128M.c',
sfdir / 'f16_roundToInt.c',
sfdir / 'f16_add.c',
sfdir / 'f16_sub.c',
sfdir / 'f16_mul.c',
sfdir / 'f16_mulAdd.c',
sfdir / 'f16_div.c',
sfdir / 'f16_rem.c',
sfdir / 'f16_sqrt.c',
sfdir / 'f16_eq.c',
sfdir / 'f16_le.c',
sfdir / 'f16_lt.c',
sfdir / 'f16_eq_signaling.c',
sfdir / 'f16_le_quiet.c',
sfdir / 'f16_lt_quiet.c',
sfdir / 'f16_isSignalingNaN.c',
sfdir / 'f32_to_ui32.c',
sfdir / 'f32_to_ui64.c',
sfdir / 'f32_to_i32.c',
sfdir / 'f32_to_i64.c',
sfdir / 'f32_to_ui32_r_minMag.c',
sfdir / 'f32_to_ui64_r_minMag.c',
sfdir / 'f32_to_i32_r_minMag.c',
sfdir / 'f32_to_i64_r_minMag.c',
sfdir / 'f32_to_f16.c',
sfdir / 'f32_to_f64.c',
sfdir / 'f32_to_extF80.c',
sfdir / 'f32_to_extF80M.c',
sfdir / 'f32_to_f128.c',
sfdir / 'f32_to_f128M.c',
sfdir / 'f32_roundToInt.c',
sfdir / 'f32_add.c',
sfdir / 'f32_sub.c',
sfdir / 'f32_mul.c',
sfdir / 'f32_mulAdd.c',
sfdir / 'f32_div.c',
sfdir / 'f32_rem.c',
sfdir / 'f32_sqrt.c',
sfdir / 'f32_eq.c',
sfdir / 'f32_le.c',
sfdir / 'f32_lt.c',
sfdir / 'f32_eq_signaling.c',
sfdir / 'f32_le_quiet.c',
sfdir / 'f32_lt_quiet.c',
sfdir / 'f32_isSignalingNaN.c',
sfdir / 'f64_to_ui32.c',
sfdir / 'f64_to_ui64.c',
sfdir / 'f64_to_i32.c',
sfdir / 'f64_to_i64.c',
sfdir / 'f64_to_ui32_r_minMag.c',
sfdir / 'f64_to_ui64_r_minMag.c',
sfdir / 'f64_to_i32_r_minMag.c',
sfdir / 'f64_to_i64_r_minMag.c',
sfdir / 'f64_to_f16.c',
sfdir / 'f64_to_f32.c',
sfdir / 'f64_to_extF80.c',
sfdir / 'f64_to_extF80M.c',
sfdir / 'f64_to_f128.c',
sfdir / 'f64_to_f128M.c',
sfdir / 'f64_roundToInt.c',
sfdir / 'f64_add.c',
sfdir / 'f64_sub.c',
sfdir / 'f64_mul.c',
sfdir / 'f64_mulAdd.c',
sfdir / 'f64_div.c',
sfdir / 'f64_rem.c',
sfdir / 'f64_sqrt.c',
sfdir / 'f64_eq.c',
sfdir / 'f64_le.c',
sfdir / 'f64_lt.c',
sfdir / 'f64_eq_signaling.c',
sfdir / 'f64_le_quiet.c',
sfdir / 'f64_lt_quiet.c',
sfdir / 'f64_isSignalingNaN.c',
sfdir / 'extF80_to_ui32.c',
sfdir / 'extF80_to_ui64.c',
sfdir / 'extF80_to_i32.c',
sfdir / 'extF80_to_i64.c',
sfdir / 'extF80_to_ui32_r_minMag.c',
sfdir / 'extF80_to_ui64_r_minMag.c',
sfdir / 'extF80_to_i32_r_minMag.c',
sfdir / 'extF80_to_i64_r_minMag.c',
sfdir / 'extF80_to_f16.c',
sfdir / 'extF80_to_f32.c',
sfdir / 'extF80_to_f64.c',
sfdir / 'extF80_to_f128.c',
sfdir / 'extF80_roundToInt.c',
sfdir / 'extF80_add.c',
sfdir / 'extF80_sub.c',
sfdir / 'extF80_mul.c',
sfdir / 'extF80_div.c',
sfdir / 'extF80_rem.c',
sfdir / 'extF80_sqrt.c',
sfdir / 'extF80_eq.c',
sfdir / 'extF80_le.c',
sfdir / 'extF80_lt.c',
sfdir / 'extF80_eq_signaling.c',
sfdir / 'extF80_le_quiet.c',
sfdir / 'extF80_lt_quiet.c',
sfdir / 'extF80_isSignalingNaN.c',
sfdir / 'extF80M_to_ui32.c',
sfdir / 'extF80M_to_ui64.c',
sfdir / 'extF80M_to_i32.c',
sfdir / 'extF80M_to_i64.c',
sfdir / 'extF80M_to_ui32_r_minMag.c',
sfdir / 'extF80M_to_ui64_r_minMag.c',
sfdir / 'extF80M_to_i32_r_minMag.c',
sfdir / 'extF80M_to_i64_r_minMag.c',
sfdir / 'extF80M_to_f16.c',
sfdir / 'extF80M_to_f32.c',
sfdir / 'extF80M_to_f64.c',
sfdir / 'extF80M_to_f128M.c',
sfdir / 'extF80M_roundToInt.c',
sfdir / 'extF80M_add.c',
sfdir / 'extF80M_sub.c',
sfdir / 'extF80M_mul.c',
sfdir / 'extF80M_div.c',
sfdir / 'extF80M_rem.c',
sfdir / 'extF80M_sqrt.c',
sfdir / 'extF80M_eq.c',
sfdir / 'extF80M_le.c',
sfdir / 'extF80M_lt.c',
sfdir / 'extF80M_eq_signaling.c',
sfdir / 'extF80M_le_quiet.c',
sfdir / 'extF80M_lt_quiet.c',
sfdir / 'f128_to_ui32.c',
sfdir / 'f128_to_ui64.c',
sfdir / 'f128_to_i32.c',
sfdir / 'f128_to_i64.c',
sfdir / 'f128_to_ui32_r_minMag.c',
sfdir / 'f128_to_ui64_r_minMag.c',
sfdir / 'f128_to_i32_r_minMag.c',
sfdir / 'f128_to_i64_r_minMag.c',
sfdir / 'f128_to_f16.c',
sfdir / 'f128_to_f32.c',
sfdir / 'f128_to_extF80.c',
sfdir / 'f128_to_f64.c',
sfdir / 'f128_roundToInt.c',
sfdir / 'f128_add.c',
sfdir / 'f128_sub.c',
sfdir / 'f128_mul.c',
sfdir / 'f128_mulAdd.c',
sfdir / 'f128_div.c',
sfdir / 'f128_rem.c',
sfdir / 'f128_sqrt.c',
sfdir / 'f128_eq.c',
sfdir / 'f128_le.c',
sfdir / 'f128_lt.c',
sfdir / 'f128_eq_signaling.c',
sfdir / 'f128_le_quiet.c',
sfdir / 'f128_lt_quiet.c',
sfdir / 'f128_isSignalingNaN.c',
sfdir / 'f128M_to_ui32.c',
sfdir / 'f128M_to_ui64.c',
sfdir / 'f128M_to_i32.c',
sfdir / 'f128M_to_i64.c',
sfdir / 'f128M_to_ui32_r_minMag.c',
sfdir / 'f128M_to_ui64_r_minMag.c',
sfdir / 'f128M_to_i32_r_minMag.c',
sfdir / 'f128M_to_i64_r_minMag.c',
sfdir / 'f128M_to_f16.c',
sfdir / 'f128M_to_f32.c',
sfdir / 'f128M_to_extF80M.c',
sfdir / 'f128M_to_f64.c',
sfdir / 'f128M_roundToInt.c',
sfdir / 'f128M_add.c',
sfdir / 'f128M_sub.c',
sfdir / 'f128M_mul.c',
sfdir / 'f128M_mulAdd.c',
sfdir / 'f128M_div.c',
sfdir / 'f128M_rem.c',
sfdir / 'f128M_sqrt.c',
sfdir / 'f128M_eq.c',
sfdir / 'f128M_le.c',
sfdir / 'f128M_lt.c',
sfdir / 'f128M_eq_signaling.c',
sfdir / 'f128M_le_quiet.c',
sfdir / 'f128M_lt_quiet.c',
# spe
sfspedir / 'softfloat_raiseFlags.c',
sfspedir / 's_f16UIToCommonNaN.c',
sfspedir / 's_commonNaNToF16UI.c',
sfspedir / 's_propagateNaNF16UI.c',
sfspedir / 's_f32UIToCommonNaN.c',
sfspedir / 's_commonNaNToF32UI.c',
sfspedir / 's_propagateNaNF32UI.c',
sfspedir / 's_f64UIToCommonNaN.c',
sfspedir / 's_commonNaNToF64UI.c',
sfspedir / 's_propagateNaNF64UI.c',
sfspedir / 'extF80M_isSignalingNaN.c',
sfspedir / 's_extF80UIToCommonNaN.c',
sfspedir / 's_commonNaNToExtF80UI.c',
sfspedir / 's_propagateNaNExtF80UI.c',
sfspedir / 'f128M_isSignalingNaN.c',
sfspedir / 's_f128UIToCommonNaN.c',
sfspedir / 's_commonNaNToF128UI.c',
sfspedir / 's_propagateNaNF128UI.c',
),
include_directories: sfinc,
c_args: fpcflags,
)
libsoftfloat_dep = declare_dependency(
link_with: libsoftfloat,
include_directories: sfinc,
compile_args: fpcflags)

View file

@ -0,0 +1 @@
option('defines', type : 'array', value : [])

View file

@ -0,0 +1,220 @@
project('berkeley-testfloat-3', 'c',
default_options: ['warning_level=1', 'c_std=gnu99'])
fpcflags = get_option('defines')
platform_data = configuration_data()
platform_data.set('INLINE', 'static inline')
platform_data.set('LITTLEENDIAN', host_machine.endian() == 'little')
configure_file(output: 'platform.h', configuration: platform_data)
tfdir = 'source'
tfinc = include_directories('.', tfdir)
add_project_arguments(
[
'-Wno-implicit-fallthrough',
'-Wno-strict-prototypes',
'-Wno-unknown-pragmas',
'-Wno-uninitialized',
'-Wno-missing-prototypes',
'-Wno-return-type',
'-Wno-unused-function',
'-Wno-missing-format-attribute',
'-Wno-error',
] + meson.get_compiler('c').get_supported_arguments('-Wno-ignored-pragmas'),
native: false, language: 'c')
tfgencases = [
tfdir / 'genCases_ui32.c',
tfdir / 'genCases_ui64.c',
tfdir / 'genCases_i32.c',
tfdir / 'genCases_i64.c',
tfdir / 'genCases_f16.c',
tfdir / 'genCases_f32.c',
tfdir / 'genCases_f64.c',
tfdir / 'genCases_extF80.c',
tfdir / 'genCases_f128.c',
]
tfwritecase = [
tfdir / 'writeCase_a_ui32.c',
tfdir / 'writeCase_a_ui64.c',
tfdir / 'writeCase_a_f16.c',
tfdir / 'writeCase_ab_f16.c',
tfdir / 'writeCase_abc_f16.c',
tfdir / 'writeCase_a_f32.c',
tfdir / 'writeCase_ab_f32.c',
tfdir / 'writeCase_abc_f32.c',
tfdir / 'writeCase_a_f64.c',
tfdir / 'writeCase_ab_f64.c',
tfdir / 'writeCase_abc_f64.c',
tfdir / 'writeCase_a_extF80M.c',
tfdir / 'writeCase_ab_extF80M.c',
tfdir / 'writeCase_a_f128M.c',
tfdir / 'writeCase_ab_f128M.c',
tfdir / 'writeCase_abc_f128M.c',
tfdir / 'writeCase_z_bool.c',
tfdir / 'writeCase_z_ui32.c',
tfdir / 'writeCase_z_ui64.c',
tfdir / 'writeCase_z_f16.c',
tfdir / 'writeCase_z_f32.c',
tfdir / 'writeCase_z_f64.c',
tfdir / 'writeCase_z_extF80M.c',
tfdir / 'writeCase_z_f128M.c',
]
tftest = [
tfdir / 'test_a_ui32_z_f16.c',
tfdir / 'test_a_ui32_z_f32.c',
tfdir / 'test_a_ui32_z_f64.c',
tfdir / 'test_a_ui32_z_extF80.c',
tfdir / 'test_a_ui32_z_f128.c',
tfdir / 'test_a_ui64_z_f16.c',
tfdir / 'test_a_ui64_z_f32.c',
tfdir / 'test_a_ui64_z_f64.c',
tfdir / 'test_a_ui64_z_extF80.c',
tfdir / 'test_a_ui64_z_f128.c',
tfdir / 'test_a_i32_z_f16.c',
tfdir / 'test_a_i32_z_f32.c',
tfdir / 'test_a_i32_z_f64.c',
tfdir / 'test_a_i32_z_extF80.c',
tfdir / 'test_a_i32_z_f128.c',
tfdir / 'test_a_i64_z_f16.c',
tfdir / 'test_a_i64_z_f32.c',
tfdir / 'test_a_i64_z_f64.c',
tfdir / 'test_a_i64_z_extF80.c',
tfdir / 'test_a_i64_z_f128.c',
tfdir / 'test_a_f16_z_ui32_rx.c',
tfdir / 'test_a_f16_z_ui64_rx.c',
tfdir / 'test_a_f16_z_i32_rx.c',
tfdir / 'test_a_f16_z_i64_rx.c',
tfdir / 'test_a_f16_z_ui32_x.c',
tfdir / 'test_a_f16_z_ui64_x.c',
tfdir / 'test_a_f16_z_i32_x.c',
tfdir / 'test_a_f16_z_i64_x.c',
tfdir / 'test_a_f16_z_f32.c',
tfdir / 'test_a_f16_z_f64.c',
tfdir / 'test_a_f16_z_extF80.c',
tfdir / 'test_a_f16_z_f128.c',
tfdir / 'test_az_f16.c',
tfdir / 'test_az_f16_rx.c',
tfdir / 'test_abz_f16.c',
tfdir / 'test_abcz_f16.c',
tfdir / 'test_ab_f16_z_bool.c',
tfdir / 'test_a_f32_z_ui32_rx.c',
tfdir / 'test_a_f32_z_ui64_rx.c',
tfdir / 'test_a_f32_z_i32_rx.c',
tfdir / 'test_a_f32_z_i64_rx.c',
tfdir / 'test_a_f32_z_ui32_x.c',
tfdir / 'test_a_f32_z_ui64_x.c',
tfdir / 'test_a_f32_z_i32_x.c',
tfdir / 'test_a_f32_z_i64_x.c',
tfdir / 'test_a_f32_z_f16.c',
tfdir / 'test_a_f32_z_f64.c',
tfdir / 'test_a_f32_z_extF80.c',
tfdir / 'test_a_f32_z_f128.c',
tfdir / 'test_az_f32.c',
tfdir / 'test_az_f32_rx.c',
tfdir / 'test_abz_f32.c',
tfdir / 'test_abcz_f32.c',
tfdir / 'test_ab_f32_z_bool.c',
tfdir / 'test_a_f64_z_ui32_rx.c',
tfdir / 'test_a_f64_z_ui64_rx.c',
tfdir / 'test_a_f64_z_i32_rx.c',
tfdir / 'test_a_f64_z_i64_rx.c',
tfdir / 'test_a_f64_z_ui32_x.c',
tfdir / 'test_a_f64_z_ui64_x.c',
tfdir / 'test_a_f64_z_i32_x.c',
tfdir / 'test_a_f64_z_i64_x.c',
tfdir / 'test_a_f64_z_f16.c',
tfdir / 'test_a_f64_z_f32.c',
tfdir / 'test_a_f64_z_extF80.c',
tfdir / 'test_a_f64_z_f128.c',
tfdir / 'test_az_f64.c',
tfdir / 'test_az_f64_rx.c',
tfdir / 'test_abz_f64.c',
tfdir / 'test_abcz_f64.c',
tfdir / 'test_ab_f64_z_bool.c',
tfdir / 'test_a_extF80_z_ui32_rx.c',
tfdir / 'test_a_extF80_z_ui64_rx.c',
tfdir / 'test_a_extF80_z_i32_rx.c',
tfdir / 'test_a_extF80_z_i64_rx.c',
tfdir / 'test_a_extF80_z_ui32_x.c',
tfdir / 'test_a_extF80_z_ui64_x.c',
tfdir / 'test_a_extF80_z_i32_x.c',
tfdir / 'test_a_extF80_z_i64_x.c',
tfdir / 'test_a_extF80_z_f16.c',
tfdir / 'test_a_extF80_z_f32.c',
tfdir / 'test_a_extF80_z_f64.c',
tfdir / 'test_a_extF80_z_f128.c',
tfdir / 'test_az_extF80.c',
tfdir / 'test_az_extF80_rx.c',
tfdir / 'test_abz_extF80.c',
tfdir / 'test_ab_extF80_z_bool.c',
tfdir / 'test_a_f128_z_ui32_rx.c',
tfdir / 'test_a_f128_z_ui64_rx.c',
tfdir / 'test_a_f128_z_i32_rx.c',
tfdir / 'test_a_f128_z_i64_rx.c',
tfdir / 'test_a_f128_z_ui32_x.c',
tfdir / 'test_a_f128_z_ui64_x.c',
tfdir / 'test_a_f128_z_i32_x.c',
tfdir / 'test_a_f128_z_i64_x.c',
tfdir / 'test_a_f128_z_f16.c',
tfdir / 'test_a_f128_z_f32.c',
tfdir / 'test_a_f128_z_f64.c',
tfdir / 'test_a_f128_z_extF80.c',
tfdir / 'test_az_f128.c',
tfdir / 'test_az_f128_rx.c',
tfdir / 'test_abz_f128.c',
tfdir / 'test_abcz_f128.c',
tfdir / 'test_ab_f128_z_bool.c',
]
libsoftfloat_proj = subproject('berkeley-softfloat-3', required: true)
libsoftfloat = libsoftfloat_proj.get_variable('libsoftfloat_dep')
libtestfloat = static_library(
'testfloat',
files(
tfdir / 'uint128_inline.c',
tfdir / 'uint128.c',
tfdir / 'fail.c',
tfdir / 'functions_common.c',
tfdir / 'functionInfos.c',
tfdir / 'standardFunctionInfos.c',
tfdir / 'random.c',
tfdir / 'genCases_common.c',
tfgencases,
tfdir / 'genCases_writeTestsTotal.c',
tfdir / 'verCases_inline.c',
tfdir / 'verCases_common.c',
tfdir / 'verCases_writeFunctionName.c',
tfdir / 'readHex.c',
tfdir / 'writeHex.c',
tfwritecase,
tfdir / 'testLoops_common.c',
tftest,
),
dependencies: libsoftfloat.partial_dependency(includes: true, compile_args: true),
c_args: fpcflags,
)
libtestfloat_dep = declare_dependency(
link_with: libtestfloat,
dependencies: libsoftfloat,
include_directories: tfinc,
compile_args: fpcflags)
libslowfloat = static_library(
'slowfloat',
tfdir / 'slowfloat.c',
dependencies: libsoftfloat.partial_dependency(includes: true, compile_args: true),
c_args: fpcflags,
)
libslowfloat_dep = declare_dependency(
link_with: libslowfloat,
dependencies: libsoftfloat,
include_directories: tfinc,
compile_args: fpcflags)

View file

@ -0,0 +1 @@
option('defines', type : 'array', value : [])

View file

@ -1229,7 +1229,7 @@ static void hvf_wait_for_ipi(CPUState *cpu, struct timespec *ts)
* Use pselect to sleep so that other threads can IPI us while we're * Use pselect to sleep so that other threads can IPI us while we're
* sleeping. * sleeping.
*/ */
qatomic_mb_set(&cpu->thread_kicked, false); qatomic_set_mb(&cpu->thread_kicked, false);
qemu_mutex_unlock_iothread(); qemu_mutex_unlock_iothread();
pselect(0, 0, 0, 0, ts, &cpu->hvf->unblock_ipi_mask); pselect(0, 0, 0, 0, ts, &cpu->hvf->unblock_ipi_mask);
qemu_mutex_lock_iothread(); qemu_mutex_lock_iothread();

View file

@ -89,9 +89,10 @@ distclean-tcg: $(DISTCLEAN_TCG_TARGET_RULES)
# Build up our target list from the filtered list of ninja targets # Build up our target list from the filtered list of ninja targets
TARGETS=$(patsubst libqemu-%.fa, %, $(filter libqemu-%.fa, $(ninja-targets))) TARGETS=$(patsubst libqemu-%.fa, %, $(filter libqemu-%.fa, $(ninja-targets)))
TESTS_VENV_TOKEN=$(BUILD_DIR)/pyvenv/tests.group TESTS_VENV_DIR=$(BUILD_DIR)/tests/venv
TESTS_VENV_REQ=$(SRC_PATH)/tests/requirements.txt TESTS_VENV_REQ=$(SRC_PATH)/tests/requirements.txt
TESTS_RESULTS_DIR=$(BUILD_DIR)/tests/results TESTS_RESULTS_DIR=$(BUILD_DIR)/tests/results
TESTS_PYTHON=$(TESTS_VENV_DIR)/bin/python3
ifndef AVOCADO_TESTS ifndef AVOCADO_TESTS
AVOCADO_TESTS=tests/avocado AVOCADO_TESTS=tests/avocado
endif endif
@ -107,10 +108,11 @@ else
endif endif
quiet-venv-pip = $(quiet-@)$(call quiet-command-run, \ quiet-venv-pip = $(quiet-@)$(call quiet-command-run, \
$(PYTHON) -m pip -q --disable-pip-version-check $1, \ $(TESTS_PYTHON) -m pip -q --disable-pip-version-check $1, \
"VENVPIP","$1") "VENVPIP","$1")
$(TESTS_VENV_TOKEN): $(TESTS_VENV_REQ) $(TESTS_VENV_DIR): $(TESTS_VENV_REQ)
$(call quiet-command, $(PYTHON) -m venv $@, VENV, $@)
$(call quiet-venv-pip,install -e "$(SRC_PATH)/python/") $(call quiet-venv-pip,install -e "$(SRC_PATH)/python/")
$(call quiet-venv-pip,install -r $(TESTS_VENV_REQ)) $(call quiet-venv-pip,install -r $(TESTS_VENV_REQ))
$(call quiet-command, touch $@) $(call quiet-command, touch $@)
@ -119,7 +121,7 @@ $(TESTS_RESULTS_DIR):
$(call quiet-command, mkdir -p $@, \ $(call quiet-command, mkdir -p $@, \
MKDIR, $@) MKDIR, $@)
check-venv: $(TESTS_VENV_TOKEN) check-venv: $(TESTS_VENV_DIR)
FEDORA_31_ARCHES_TARGETS=$(patsubst %-softmmu,%, $(filter %-softmmu,$(TARGETS))) FEDORA_31_ARCHES_TARGETS=$(patsubst %-softmmu,%, $(filter %-softmmu,$(TARGETS)))
FEDORA_31_ARCHES_CANDIDATES=$(patsubst ppc64,ppc64le,$(FEDORA_31_ARCHES_TARGETS)) FEDORA_31_ARCHES_CANDIDATES=$(patsubst ppc64,ppc64le,$(FEDORA_31_ARCHES_TARGETS))
@ -129,25 +131,21 @@ FEDORA_31_DOWNLOAD=$(filter $(FEDORA_31_ARCHES),$(FEDORA_31_ARCHES_CANDIDATES))
# download one specific Fedora 31 image # download one specific Fedora 31 image
get-vm-image-fedora-31-%: check-venv get-vm-image-fedora-31-%: check-venv
$(call quiet-command, \ $(call quiet-command, \
$(PYTHON) -m avocado vmimage get \ $(TESTS_PYTHON) -m avocado vmimage get \
--distro=fedora --distro-version=31 --arch=$*, \ --distro=fedora --distro-version=31 --arch=$*, \
"AVOCADO", "Downloading avocado tests VM image for $*") "AVOCADO", "Downloading avocado tests VM image for $*")
# download all vm images, according to defined targets # download all vm images, according to defined targets
get-vm-images: check-venv $(patsubst %,get-vm-image-fedora-31-%, $(FEDORA_31_DOWNLOAD)) get-vm-images: check-venv $(patsubst %,get-vm-image-fedora-31-%, $(FEDORA_31_DOWNLOAD))
JOBS_OPTION=$(lastword -j1 $(filter-out -j, $(filter -j%,$(MAKEFLAGS))))
check-avocado: check-venv $(TESTS_RESULTS_DIR) get-vm-images check-avocado: check-venv $(TESTS_RESULTS_DIR) get-vm-images
$(call quiet-command, \ $(call quiet-command, \
$(PYTHON) -m avocado \ $(TESTS_PYTHON) -m avocado \
--show=$(AVOCADO_SHOW) run --job-results-dir=$(TESTS_RESULTS_DIR) \ --show=$(AVOCADO_SHOW) run --job-results-dir=$(TESTS_RESULTS_DIR) \
$(if $(AVOCADO_TAGS),, \ $(if $(AVOCADO_TAGS),, --filter-by-tags-include-empty \
--filter-by-tags-include-empty \ --filter-by-tags-include-empty-key) \
--filter-by-tags-include-empty-key) \ $(AVOCADO_CMDLINE_TAGS) \
--max-parallel-tasks $(JOBS_OPTION:-j%=%) \ $(if $(GITLAB_CI),,--failfast) $(AVOCADO_TESTS), \
$(AVOCADO_CMDLINE_TAGS) \
$(if $(GITLAB_CI),,--failfast) $(AVOCADO_TESTS), \
"AVOCADO", "tests/avocado") "AVOCADO", "tests/avocado")
check-acceptance-deprecated-warning: check-acceptance-deprecated-warning:
@ -165,7 +163,7 @@ check:
check-build: run-ninja check-build: run-ninja
check-clean: check-clean:
rm -rf $(TESTS_RESULTS_DIR) rm -rf $(TESTS_VENV_DIR) $(TESTS_RESULTS_DIR)
clean: check-clean clean-tcg clean: check-clean clean-tcg
distclean: distclean-tcg distclean: distclean-tcg

View file

@ -7,13 +7,15 @@ if targetos == 'windows'
subdir_done() subdir_done()
endif endif
fpcflags = [ sfcflags = [
# softfloat defines # softfloat defines
'-DSOFTFLOAT_ROUND_ODD', '-DSOFTFLOAT_ROUND_ODD',
'-DINLINE_LEVEL=5', '-DINLINE_LEVEL=5',
'-DSOFTFLOAT_FAST_DIV32TO16', '-DSOFTFLOAT_FAST_DIV32TO16',
'-DSOFTFLOAT_FAST_DIV64TO32', '-DSOFTFLOAT_FAST_DIV64TO32',
'-DSOFTFLOAT_FAST_INT64', '-DSOFTFLOAT_FAST_INT64',
]
tfcflags = [
# testfloat defines # testfloat defines
'-DFLOAT16', '-DFLOAT16',
'-DFLOAT64', '-DFLOAT64',
@ -23,523 +25,16 @@ fpcflags = [
'-DLONG_DOUBLE_IS_EXTFLOAT80', '-DLONG_DOUBLE_IS_EXTFLOAT80',
] ]
sfdir = 'berkeley-softfloat-3/source' libsoftfloat_proj = subproject('berkeley-softfloat-3', required: true,
sfspedir = sfdir / '8086-SSE' default_options: 'defines=' + ','.join(sfcflags))
tfdir = 'berkeley-testfloat-3/source' libsoftfloat = libsoftfloat_proj.get_variable('libsoftfloat_dep')
sfinc = include_directories(sfdir / 'include', sfspedir) libtestfloat_proj = subproject('berkeley-testfloat-3', required: true,
default_options: 'defines=' + ','.join(tfcflags))
libtestfloat = libtestfloat_proj.get_variable('libtestfloat_dep')
libslowfloat = libtestfloat_proj.get_variable('libslowfloat_dep')
tfcflags = [ fpcflags = [
'-Wno-implicit-fallthrough',
'-Wno-strict-prototypes',
'-Wno-unknown-pragmas',
'-Wno-uninitialized',
'-Wno-missing-prototypes',
'-Wno-return-type',
'-Wno-unused-function',
'-Wno-missing-format-attribute',
'-Wno-error',
]
if cc.get_id() == 'clang'
# Clang does not support '#pragma STDC FENV_ACCESS'
tfcflags += [ '-Wno-ignored-pragmas' ]
endif
tfgencases = [
tfdir / 'genCases_ui32.c',
tfdir / 'genCases_ui64.c',
tfdir / 'genCases_i32.c',
tfdir / 'genCases_i64.c',
tfdir / 'genCases_f16.c',
tfdir / 'genCases_f32.c',
tfdir / 'genCases_f64.c',
tfdir / 'genCases_extF80.c',
tfdir / 'genCases_f128.c',
]
tfwritecase = [
tfdir / 'writeCase_a_ui32.c',
tfdir / 'writeCase_a_ui64.c',
tfdir / 'writeCase_a_f16.c',
tfdir / 'writeCase_ab_f16.c',
tfdir / 'writeCase_abc_f16.c',
tfdir / 'writeCase_a_f32.c',
tfdir / 'writeCase_ab_f32.c',
tfdir / 'writeCase_abc_f32.c',
tfdir / 'writeCase_a_f64.c',
tfdir / 'writeCase_ab_f64.c',
tfdir / 'writeCase_abc_f64.c',
tfdir / 'writeCase_a_extF80M.c',
tfdir / 'writeCase_ab_extF80M.c',
tfdir / 'writeCase_a_f128M.c',
tfdir / 'writeCase_ab_f128M.c',
tfdir / 'writeCase_abc_f128M.c',
tfdir / 'writeCase_z_bool.c',
tfdir / 'writeCase_z_ui32.c',
tfdir / 'writeCase_z_ui64.c',
tfdir / 'writeCase_z_f16.c',
tfdir / 'writeCase_z_f32.c',
tfdir / 'writeCase_z_f64.c',
tfdir / 'writeCase_z_extF80M.c',
tfdir / 'writeCase_z_f128M.c',
]
tftest = [
tfdir / 'test_a_ui32_z_f16.c',
tfdir / 'test_a_ui32_z_f32.c',
tfdir / 'test_a_ui32_z_f64.c',
tfdir / 'test_a_ui32_z_extF80.c',
tfdir / 'test_a_ui32_z_f128.c',
tfdir / 'test_a_ui64_z_f16.c',
tfdir / 'test_a_ui64_z_f32.c',
tfdir / 'test_a_ui64_z_f64.c',
tfdir / 'test_a_ui64_z_extF80.c',
tfdir / 'test_a_ui64_z_f128.c',
tfdir / 'test_a_i32_z_f16.c',
tfdir / 'test_a_i32_z_f32.c',
tfdir / 'test_a_i32_z_f64.c',
tfdir / 'test_a_i32_z_extF80.c',
tfdir / 'test_a_i32_z_f128.c',
tfdir / 'test_a_i64_z_f16.c',
tfdir / 'test_a_i64_z_f32.c',
tfdir / 'test_a_i64_z_f64.c',
tfdir / 'test_a_i64_z_extF80.c',
tfdir / 'test_a_i64_z_f128.c',
tfdir / 'test_a_f16_z_ui32_rx.c',
tfdir / 'test_a_f16_z_ui64_rx.c',
tfdir / 'test_a_f16_z_i32_rx.c',
tfdir / 'test_a_f16_z_i64_rx.c',
tfdir / 'test_a_f16_z_ui32_x.c',
tfdir / 'test_a_f16_z_ui64_x.c',
tfdir / 'test_a_f16_z_i32_x.c',
tfdir / 'test_a_f16_z_i64_x.c',
tfdir / 'test_a_f16_z_f32.c',
tfdir / 'test_a_f16_z_f64.c',
tfdir / 'test_a_f16_z_extF80.c',
tfdir / 'test_a_f16_z_f128.c',
tfdir / 'test_az_f16.c',
tfdir / 'test_az_f16_rx.c',
tfdir / 'test_abz_f16.c',
tfdir / 'test_abcz_f16.c',
tfdir / 'test_ab_f16_z_bool.c',
tfdir / 'test_a_f32_z_ui32_rx.c',
tfdir / 'test_a_f32_z_ui64_rx.c',
tfdir / 'test_a_f32_z_i32_rx.c',
tfdir / 'test_a_f32_z_i64_rx.c',
tfdir / 'test_a_f32_z_ui32_x.c',
tfdir / 'test_a_f32_z_ui64_x.c',
tfdir / 'test_a_f32_z_i32_x.c',
tfdir / 'test_a_f32_z_i64_x.c',
tfdir / 'test_a_f32_z_f16.c',
tfdir / 'test_a_f32_z_f64.c',
tfdir / 'test_a_f32_z_extF80.c',
tfdir / 'test_a_f32_z_f128.c',
tfdir / 'test_az_f32.c',
tfdir / 'test_az_f32_rx.c',
tfdir / 'test_abz_f32.c',
tfdir / 'test_abcz_f32.c',
tfdir / 'test_ab_f32_z_bool.c',
tfdir / 'test_a_f64_z_ui32_rx.c',
tfdir / 'test_a_f64_z_ui64_rx.c',
tfdir / 'test_a_f64_z_i32_rx.c',
tfdir / 'test_a_f64_z_i64_rx.c',
tfdir / 'test_a_f64_z_ui32_x.c',
tfdir / 'test_a_f64_z_ui64_x.c',
tfdir / 'test_a_f64_z_i32_x.c',
tfdir / 'test_a_f64_z_i64_x.c',
tfdir / 'test_a_f64_z_f16.c',
tfdir / 'test_a_f64_z_f32.c',
tfdir / 'test_a_f64_z_extF80.c',
tfdir / 'test_a_f64_z_f128.c',
tfdir / 'test_az_f64.c',
tfdir / 'test_az_f64_rx.c',
tfdir / 'test_abz_f64.c',
tfdir / 'test_abcz_f64.c',
tfdir / 'test_ab_f64_z_bool.c',
tfdir / 'test_a_extF80_z_ui32_rx.c',
tfdir / 'test_a_extF80_z_ui64_rx.c',
tfdir / 'test_a_extF80_z_i32_rx.c',
tfdir / 'test_a_extF80_z_i64_rx.c',
tfdir / 'test_a_extF80_z_ui32_x.c',
tfdir / 'test_a_extF80_z_ui64_x.c',
tfdir / 'test_a_extF80_z_i32_x.c',
tfdir / 'test_a_extF80_z_i64_x.c',
tfdir / 'test_a_extF80_z_f16.c',
tfdir / 'test_a_extF80_z_f32.c',
tfdir / 'test_a_extF80_z_f64.c',
tfdir / 'test_a_extF80_z_f128.c',
tfdir / 'test_az_extF80.c',
tfdir / 'test_az_extF80_rx.c',
tfdir / 'test_abz_extF80.c',
tfdir / 'test_ab_extF80_z_bool.c',
tfdir / 'test_a_f128_z_ui32_rx.c',
tfdir / 'test_a_f128_z_ui64_rx.c',
tfdir / 'test_a_f128_z_i32_rx.c',
tfdir / 'test_a_f128_z_i64_rx.c',
tfdir / 'test_a_f128_z_ui32_x.c',
tfdir / 'test_a_f128_z_ui64_x.c',
tfdir / 'test_a_f128_z_i32_x.c',
tfdir / 'test_a_f128_z_i64_x.c',
tfdir / 'test_a_f128_z_f16.c',
tfdir / 'test_a_f128_z_f32.c',
tfdir / 'test_a_f128_z_f64.c',
tfdir / 'test_a_f128_z_extF80.c',
tfdir / 'test_az_f128.c',
tfdir / 'test_az_f128_rx.c',
tfdir / 'test_abz_f128.c',
tfdir / 'test_abcz_f128.c',
tfdir / 'test_ab_f128_z_bool.c',
]
libtestfloat = static_library(
'testfloat',
files(
tfdir / 'uint128_inline.c',
tfdir / 'uint128.c',
tfdir / 'fail.c',
tfdir / 'functions_common.c',
tfdir / 'functionInfos.c',
tfdir / 'standardFunctionInfos.c',
tfdir / 'random.c',
tfdir / 'genCases_common.c',
tfgencases,
tfdir / 'genCases_writeTestsTotal.c',
tfdir / 'verCases_inline.c',
tfdir / 'verCases_common.c',
tfdir / 'verCases_writeFunctionName.c',
tfdir / 'readHex.c',
tfdir / 'writeHex.c',
tfwritecase,
tfdir / 'testLoops_common.c',
tftest,
),
include_directories: sfinc,
c_args: tfcflags + fpcflags,
)
sfcflags = [
'-Wno-implicit-fallthrough',
'-Wno-missing-prototypes',
'-Wno-redundant-decls',
'-Wno-return-type',
'-Wno-error',
]
libsoftfloat = static_library(
'softfloat',
files(
# primitives
sfdir / 's_eq128.c',
sfdir / 's_le128.c',
sfdir / 's_lt128.c',
sfdir / 's_shortShiftLeft128.c',
sfdir / 's_shortShiftRight128.c',
sfdir / 's_shortShiftRightJam64.c',
sfdir / 's_shortShiftRightJam64Extra.c',
sfdir / 's_shortShiftRightJam128.c',
sfdir / 's_shortShiftRightJam128Extra.c',
sfdir / 's_shiftRightJam32.c',
sfdir / 's_shiftRightJam64.c',
sfdir / 's_shiftRightJam64Extra.c',
sfdir / 's_shiftRightJam128.c',
sfdir / 's_shiftRightJam128Extra.c',
sfdir / 's_shiftRightJam256M.c',
sfdir / 's_countLeadingZeros8.c',
sfdir / 's_countLeadingZeros16.c',
sfdir / 's_countLeadingZeros32.c',
sfdir / 's_countLeadingZeros64.c',
sfdir / 's_add128.c',
sfdir / 's_add256M.c',
sfdir / 's_sub128.c',
sfdir / 's_sub256M.c',
sfdir / 's_mul64ByShifted32To128.c',
sfdir / 's_mul64To128.c',
sfdir / 's_mul128By32.c',
sfdir / 's_mul128To256M.c',
sfdir / 's_approxRecip_1Ks.c',
sfdir / 's_approxRecip32_1.c',
sfdir / 's_approxRecipSqrt_1Ks.c',
sfdir / 's_approxRecipSqrt32_1.c',
# others
sfdir / 's_roundToUI32.c',
sfdir / 's_roundToUI64.c',
sfdir / 's_roundToI32.c',
sfdir / 's_roundToI64.c',
sfdir / 's_normSubnormalF16Sig.c',
sfdir / 's_roundPackToF16.c',
sfdir / 's_normRoundPackToF16.c',
sfdir / 's_addMagsF16.c',
sfdir / 's_subMagsF16.c',
sfdir / 's_mulAddF16.c',
sfdir / 's_normSubnormalF32Sig.c',
sfdir / 's_roundPackToF32.c',
sfdir / 's_normRoundPackToF32.c',
sfdir / 's_addMagsF32.c',
sfdir / 's_subMagsF32.c',
sfdir / 's_mulAddF32.c',
sfdir / 's_normSubnormalF64Sig.c',
sfdir / 's_roundPackToF64.c',
sfdir / 's_normRoundPackToF64.c',
sfdir / 's_addMagsF64.c',
sfdir / 's_subMagsF64.c',
sfdir / 's_mulAddF64.c',
sfdir / 's_normSubnormalExtF80Sig.c',
sfdir / 's_roundPackToExtF80.c',
sfdir / 's_normRoundPackToExtF80.c',
sfdir / 's_addMagsExtF80.c',
sfdir / 's_subMagsExtF80.c',
sfdir / 's_normSubnormalF128Sig.c',
sfdir / 's_roundPackToF128.c',
sfdir / 's_normRoundPackToF128.c',
sfdir / 's_addMagsF128.c',
sfdir / 's_subMagsF128.c',
sfdir / 's_mulAddF128.c',
sfdir / 'softfloat_state.c',
sfdir / 'ui32_to_f16.c',
sfdir / 'ui32_to_f32.c',
sfdir / 'ui32_to_f64.c',
sfdir / 'ui32_to_extF80.c',
sfdir / 'ui32_to_extF80M.c',
sfdir / 'ui32_to_f128.c',
sfdir / 'ui32_to_f128M.c',
sfdir / 'ui64_to_f16.c',
sfdir / 'ui64_to_f32.c',
sfdir / 'ui64_to_f64.c',
sfdir / 'ui64_to_extF80.c',
sfdir / 'ui64_to_extF80M.c',
sfdir / 'ui64_to_f128.c',
sfdir / 'ui64_to_f128M.c',
sfdir / 'i32_to_f16.c',
sfdir / 'i32_to_f32.c',
sfdir / 'i32_to_f64.c',
sfdir / 'i32_to_extF80.c',
sfdir / 'i32_to_extF80M.c',
sfdir / 'i32_to_f128.c',
sfdir / 'i32_to_f128M.c',
sfdir / 'i64_to_f16.c',
sfdir / 'i64_to_f32.c',
sfdir / 'i64_to_f64.c',
sfdir / 'i64_to_extF80.c',
sfdir / 'i64_to_extF80M.c',
sfdir / 'i64_to_f128.c',
sfdir / 'i64_to_f128M.c',
sfdir / 'f16_to_ui32.c',
sfdir / 'f16_to_ui64.c',
sfdir / 'f16_to_i32.c',
sfdir / 'f16_to_i64.c',
sfdir / 'f16_to_ui32_r_minMag.c',
sfdir / 'f16_to_ui64_r_minMag.c',
sfdir / 'f16_to_i32_r_minMag.c',
sfdir / 'f16_to_i64_r_minMag.c',
sfdir / 'f16_to_f32.c',
sfdir / 'f16_to_f64.c',
sfdir / 'f16_to_extF80.c',
sfdir / 'f16_to_extF80M.c',
sfdir / 'f16_to_f128.c',
sfdir / 'f16_to_f128M.c',
sfdir / 'f16_roundToInt.c',
sfdir / 'f16_add.c',
sfdir / 'f16_sub.c',
sfdir / 'f16_mul.c',
sfdir / 'f16_mulAdd.c',
sfdir / 'f16_div.c',
sfdir / 'f16_rem.c',
sfdir / 'f16_sqrt.c',
sfdir / 'f16_eq.c',
sfdir / 'f16_le.c',
sfdir / 'f16_lt.c',
sfdir / 'f16_eq_signaling.c',
sfdir / 'f16_le_quiet.c',
sfdir / 'f16_lt_quiet.c',
sfdir / 'f16_isSignalingNaN.c',
sfdir / 'f32_to_ui32.c',
sfdir / 'f32_to_ui64.c',
sfdir / 'f32_to_i32.c',
sfdir / 'f32_to_i64.c',
sfdir / 'f32_to_ui32_r_minMag.c',
sfdir / 'f32_to_ui64_r_minMag.c',
sfdir / 'f32_to_i32_r_minMag.c',
sfdir / 'f32_to_i64_r_minMag.c',
sfdir / 'f32_to_f16.c',
sfdir / 'f32_to_f64.c',
sfdir / 'f32_to_extF80.c',
sfdir / 'f32_to_extF80M.c',
sfdir / 'f32_to_f128.c',
sfdir / 'f32_to_f128M.c',
sfdir / 'f32_roundToInt.c',
sfdir / 'f32_add.c',
sfdir / 'f32_sub.c',
sfdir / 'f32_mul.c',
sfdir / 'f32_mulAdd.c',
sfdir / 'f32_div.c',
sfdir / 'f32_rem.c',
sfdir / 'f32_sqrt.c',
sfdir / 'f32_eq.c',
sfdir / 'f32_le.c',
sfdir / 'f32_lt.c',
sfdir / 'f32_eq_signaling.c',
sfdir / 'f32_le_quiet.c',
sfdir / 'f32_lt_quiet.c',
sfdir / 'f32_isSignalingNaN.c',
sfdir / 'f64_to_ui32.c',
sfdir / 'f64_to_ui64.c',
sfdir / 'f64_to_i32.c',
sfdir / 'f64_to_i64.c',
sfdir / 'f64_to_ui32_r_minMag.c',
sfdir / 'f64_to_ui64_r_minMag.c',
sfdir / 'f64_to_i32_r_minMag.c',
sfdir / 'f64_to_i64_r_minMag.c',
sfdir / 'f64_to_f16.c',
sfdir / 'f64_to_f32.c',
sfdir / 'f64_to_extF80.c',
sfdir / 'f64_to_extF80M.c',
sfdir / 'f64_to_f128.c',
sfdir / 'f64_to_f128M.c',
sfdir / 'f64_roundToInt.c',
sfdir / 'f64_add.c',
sfdir / 'f64_sub.c',
sfdir / 'f64_mul.c',
sfdir / 'f64_mulAdd.c',
sfdir / 'f64_div.c',
sfdir / 'f64_rem.c',
sfdir / 'f64_sqrt.c',
sfdir / 'f64_eq.c',
sfdir / 'f64_le.c',
sfdir / 'f64_lt.c',
sfdir / 'f64_eq_signaling.c',
sfdir / 'f64_le_quiet.c',
sfdir / 'f64_lt_quiet.c',
sfdir / 'f64_isSignalingNaN.c',
sfdir / 'extF80_to_ui32.c',
sfdir / 'extF80_to_ui64.c',
sfdir / 'extF80_to_i32.c',
sfdir / 'extF80_to_i64.c',
sfdir / 'extF80_to_ui32_r_minMag.c',
sfdir / 'extF80_to_ui64_r_minMag.c',
sfdir / 'extF80_to_i32_r_minMag.c',
sfdir / 'extF80_to_i64_r_minMag.c',
sfdir / 'extF80_to_f16.c',
sfdir / 'extF80_to_f32.c',
sfdir / 'extF80_to_f64.c',
sfdir / 'extF80_to_f128.c',
sfdir / 'extF80_roundToInt.c',
sfdir / 'extF80_add.c',
sfdir / 'extF80_sub.c',
sfdir / 'extF80_mul.c',
sfdir / 'extF80_div.c',
sfdir / 'extF80_rem.c',
sfdir / 'extF80_sqrt.c',
sfdir / 'extF80_eq.c',
sfdir / 'extF80_le.c',
sfdir / 'extF80_lt.c',
sfdir / 'extF80_eq_signaling.c',
sfdir / 'extF80_le_quiet.c',
sfdir / 'extF80_lt_quiet.c',
sfdir / 'extF80_isSignalingNaN.c',
sfdir / 'extF80M_to_ui32.c',
sfdir / 'extF80M_to_ui64.c',
sfdir / 'extF80M_to_i32.c',
sfdir / 'extF80M_to_i64.c',
sfdir / 'extF80M_to_ui32_r_minMag.c',
sfdir / 'extF80M_to_ui64_r_minMag.c',
sfdir / 'extF80M_to_i32_r_minMag.c',
sfdir / 'extF80M_to_i64_r_minMag.c',
sfdir / 'extF80M_to_f16.c',
sfdir / 'extF80M_to_f32.c',
sfdir / 'extF80M_to_f64.c',
sfdir / 'extF80M_to_f128M.c',
sfdir / 'extF80M_roundToInt.c',
sfdir / 'extF80M_add.c',
sfdir / 'extF80M_sub.c',
sfdir / 'extF80M_mul.c',
sfdir / 'extF80M_div.c',
sfdir / 'extF80M_rem.c',
sfdir / 'extF80M_sqrt.c',
sfdir / 'extF80M_eq.c',
sfdir / 'extF80M_le.c',
sfdir / 'extF80M_lt.c',
sfdir / 'extF80M_eq_signaling.c',
sfdir / 'extF80M_le_quiet.c',
sfdir / 'extF80M_lt_quiet.c',
sfdir / 'f128_to_ui32.c',
sfdir / 'f128_to_ui64.c',
sfdir / 'f128_to_i32.c',
sfdir / 'f128_to_i64.c',
sfdir / 'f128_to_ui32_r_minMag.c',
sfdir / 'f128_to_ui64_r_minMag.c',
sfdir / 'f128_to_i32_r_minMag.c',
sfdir / 'f128_to_i64_r_minMag.c',
sfdir / 'f128_to_f16.c',
sfdir / 'f128_to_f32.c',
sfdir / 'f128_to_extF80.c',
sfdir / 'f128_to_f64.c',
sfdir / 'f128_roundToInt.c',
sfdir / 'f128_add.c',
sfdir / 'f128_sub.c',
sfdir / 'f128_mul.c',
sfdir / 'f128_mulAdd.c',
sfdir / 'f128_div.c',
sfdir / 'f128_rem.c',
sfdir / 'f128_sqrt.c',
sfdir / 'f128_eq.c',
sfdir / 'f128_le.c',
sfdir / 'f128_lt.c',
sfdir / 'f128_eq_signaling.c',
sfdir / 'f128_le_quiet.c',
sfdir / 'f128_lt_quiet.c',
sfdir / 'f128_isSignalingNaN.c',
sfdir / 'f128M_to_ui32.c',
sfdir / 'f128M_to_ui64.c',
sfdir / 'f128M_to_i32.c',
sfdir / 'f128M_to_i64.c',
sfdir / 'f128M_to_ui32_r_minMag.c',
sfdir / 'f128M_to_ui64_r_minMag.c',
sfdir / 'f128M_to_i32_r_minMag.c',
sfdir / 'f128M_to_i64_r_minMag.c',
sfdir / 'f128M_to_f16.c',
sfdir / 'f128M_to_f32.c',
sfdir / 'f128M_to_extF80M.c',
sfdir / 'f128M_to_f64.c',
sfdir / 'f128M_roundToInt.c',
sfdir / 'f128M_add.c',
sfdir / 'f128M_sub.c',
sfdir / 'f128M_mul.c',
sfdir / 'f128M_mulAdd.c',
sfdir / 'f128M_div.c',
sfdir / 'f128M_rem.c',
sfdir / 'f128M_sqrt.c',
sfdir / 'f128M_eq.c',
sfdir / 'f128M_le.c',
sfdir / 'f128M_lt.c',
sfdir / 'f128M_eq_signaling.c',
sfdir / 'f128M_le_quiet.c',
sfdir / 'f128M_lt_quiet.c',
# spe
sfspedir / 'softfloat_raiseFlags.c',
sfspedir / 's_f16UIToCommonNaN.c',
sfspedir / 's_commonNaNToF16UI.c',
sfspedir / 's_propagateNaNF16UI.c',
sfspedir / 's_f32UIToCommonNaN.c',
sfspedir / 's_commonNaNToF32UI.c',
sfspedir / 's_propagateNaNF32UI.c',
sfspedir / 's_f64UIToCommonNaN.c',
sfspedir / 's_commonNaNToF64UI.c',
sfspedir / 's_propagateNaNF64UI.c',
sfspedir / 'extF80M_isSignalingNaN.c',
sfspedir / 's_extF80UIToCommonNaN.c',
sfspedir / 's_commonNaNToExtF80UI.c',
sfspedir / 's_propagateNaNExtF80UI.c',
sfspedir / 'f128M_isSignalingNaN.c',
sfspedir / 's_f128UIToCommonNaN.c',
sfspedir / 's_commonNaNToF128UI.c',
sfspedir / 's_propagateNaNF128UI.c',
),
include_directories: sfinc,
c_args: sfcflags + fpcflags,
)
fpcflags += [
# work around TARGET_* poisoning # work around TARGET_* poisoning
'-DHW_POISON_H', '-DHW_POISON_H',
# define a target to match testfloat's implementation-defined choices, such as # define a target to match testfloat's implementation-defined choices, such as
@ -551,10 +46,8 @@ fpcflags += [
fptest = executable( fptest = executable(
'fp-test', 'fp-test',
['fp-test.c', tfdir / 'slowfloat.c', '../../fpu/softfloat.c'], ['fp-test.c', '../../fpu/softfloat.c'],
link_with: [libtestfloat, libsoftfloat], dependencies: [qemuutil, libsoftfloat, libtestfloat, libslowfloat],
dependencies: [qemuutil],
include_directories: [sfinc, include_directories(tfdir)],
c_args: fpcflags, c_args: fpcflags,
) )
softfloat_conv_tests = { softfloat_conv_tests = {
@ -636,18 +129,14 @@ test('fp-test-mulAdd', fptest,
executable( executable(
'fp-bench', 'fp-bench',
['fp-bench.c', '../../fpu/softfloat.c'], ['fp-bench.c', '../../fpu/softfloat.c'],
link_with: [libtestfloat, libsoftfloat], dependencies: [qemuutil, libtestfloat, libsoftfloat],
dependencies: [qemuutil],
include_directories: [sfinc, include_directories(tfdir)],
c_args: fpcflags, c_args: fpcflags,
) )
fptestlog2 = executable( fptestlog2 = executable(
'fp-test-log2', 'fp-test-log2',
['fp-test-log2.c', '../../fpu/softfloat.c'], ['fp-test-log2.c', '../../fpu/softfloat.c'],
link_with: [libsoftfloat], dependencies: [qemuutil, libsoftfloat],
dependencies: [qemuutil],
include_directories: [sfinc],
c_args: fpcflags, c_args: fpcflags,
) )
test('fp-test-log2', fptestlog2, test('fp-test-log2', fptestlog2,

View file

@ -1,9 +1,6 @@
# Add Python module requirements, one per line, to be installed # Add Python module requirements, one per line, to be installed
# in the qemu build_dir/pyvenv Python virtual environment. For more info, # in the tests/venv Python virtual environment. For more info,
# refer to: https://pip.pypa.io/en/stable/user_guide/#id1 # refer to: https://pip.pypa.io/en/stable/user_guide/#id1
# # Note that qemu.git/python/ is always implicitly installed.
# Note that qemu.git/python/ is implicitly installed to this venv when avocado-framework==88.1
# 'make check-venv' is run, and will persist until configure is run
# again.
avocado-framework==101.0
pycdlib==1.11.0 pycdlib==1.11.0

View file

@ -154,7 +154,7 @@ static coroutine_fn void test_multi_co_schedule_entry(void *opaque)
n = g_test_rand_int_range(0, NUM_CONTEXTS); n = g_test_rand_int_range(0, NUM_CONTEXTS);
schedule_next(n); schedule_next(n);
qatomic_mb_set(&to_schedule[id], qemu_coroutine_self()); qatomic_set_mb(&to_schedule[id], qemu_coroutine_self());
/* finish_cb can run here. */ /* finish_cb can run here. */
qemu_coroutine_yield(); qemu_coroutine_yield();
g_assert(to_schedule[id] == NULL); g_assert(to_schedule[id] == NULL);

View file

@ -5,7 +5,7 @@ ifeq ($(realpath $(SRC_PATH)),$(realpath .))
VM_PYTHON = PYTHONPATH=$(SRC_PATH)/python /usr/bin/env python3 VM_PYTHON = PYTHONPATH=$(SRC_PATH)/python /usr/bin/env python3
VM_VENV = VM_VENV =
else else
VM_PYTHON = $(PYTHON) VM_PYTHON = $(TESTS_PYTHON)
VM_VENV = check-venv VM_VENV = check-venv
endif endif

View file

@ -202,7 +202,7 @@ static void coroutine_fn qemu_co_mutex_lock_slowpath(AioContext *ctx,
push_waiter(mutex, &w); push_waiter(mutex, &w);
/* /*
* Add waiter before reading mutex->handoff. Pairs with qatomic_mb_set * Add waiter before reading mutex->handoff. Pairs with qatomic_set_mb
* in qemu_co_mutex_unlock. * in qemu_co_mutex_unlock.
*/ */
smp_mb__after_rmw(); smp_mb__after_rmw();
@ -310,7 +310,7 @@ void coroutine_fn qemu_co_mutex_unlock(CoMutex *mutex)
our_handoff = mutex->sequence; our_handoff = mutex->sequence;
/* Set handoff before checking for waiters. */ /* Set handoff before checking for waiters. */
qatomic_mb_set(&mutex->handoff, our_handoff); qatomic_set_mb(&mutex->handoff, our_handoff);
if (!has_waiters(mutex)) { if (!has_waiters(mutex)) {
/* The concurrent lock has not added itself yet, so it /* The concurrent lock has not added itself yet, so it
* will be able to pick our handoff. * will be able to pick our handoff.