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
47 changed files with 900 additions and 947 deletions
-2
View File
@@ -20,5 +20,3 @@ GTAGS
*.swp
*.patch
*.gcov
/subprojects/slirp
+2 -2
View File
@@ -42,8 +42,8 @@
stage: test
image: $CI_REGISTRY_IMAGE/qemu/$IMAGE:latest
script:
- scripts/git-submodule.sh update
$(sed -n '/GIT_SUBMODULES=/ s/.*=// p' build/config-host.mak)
- scripts/git-submodule.sh update roms/SLOF
- meson subprojects download $(cd build/subprojects && echo *)
- cd build
- find . -type f -exec touch {} +
# Avoid recompiling by hiding ninja with NINJA=":"
+3 -3
View File
@@ -103,7 +103,7 @@ crash-test-debian:
script:
- cd build
- 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:
extends:
@@ -146,8 +146,8 @@ crash-test-fedora:
script:
- cd build
- make NINJA=":" check-venv
- pyvenv/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-ppc
- tests/venv/bin/python3 scripts/device-crash-test -q ./qemu-system-riscv32
build-system-centos:
extends:
-15
View File
@@ -13,9 +13,6 @@
[submodule "roms/qemu-palcode"]
path = roms/qemu-palcode
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"]
path = roms/u-boot
url = https://gitlab.com/qemu-project/u-boot.git
@@ -25,21 +22,12 @@
[submodule "roms/QemuMacDrivers"]
path = roms/QemuMacDrivers
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"]
path = roms/seabios-hppa
url = https://gitlab.com/qemu-project/seabios-hppa.git
[submodule "roms/u-boot-sam460ex"]
path = roms/u-boot-sam460ex
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"]
path = roms/edk2
url = https://gitlab.com/qemu-project/edk2.git
@@ -55,6 +43,3 @@
[submodule "tests/lcitool/libvirt-ci"]
path = tests/lcitool/libvirt-ci
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
-12
View File
@@ -45,18 +45,6 @@ include config-host.mak
include Makefile.prereqs
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
# Check that we're not trying to do an out-of-tree build from
+1 -1
View File
@@ -774,7 +774,7 @@ static inline bool cpu_handle_interrupt(CPUState *cpu,
* Ensure zeroing happens before reading cpu->exit_request or
* 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))) {
int interrupt_request;
+1 -1
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);
} while (!cpu->unplug || cpu_can_run(cpu));
+2 -2
View File
@@ -244,7 +244,7 @@ static void *rr_cpu_thread_fn(void *arg)
while (cpu && cpu_work_list_empty(cpu) && !cpu->exit_request) {
/* 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;
@@ -287,7 +287,7 @@ static void *rr_cpu_thread_fn(void *arg)
qatomic_set(&rr_current_cpu, NULL);
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()) {
Vendored
+46 -123
View File
@@ -246,14 +246,7 @@ for opt do
done
if test -e "$source_path/.git"
then
git_submodules_action="update"
else
git_submodules_action="ignore"
fi
git_submodules="subprojects/keycodemapdb"
git_submodules_action="update"
git="git"
debug_tcg="no"
docs="auto"
@@ -266,10 +259,9 @@ bsd_user=""
plugins="$default_feature"
ninja=""
python=
pypi="enabled"
download="enabled"
bindir="bin"
skip_meson=no
vfio_user_server="disabled"
use_containers="yes"
gdb_bin=$(command -v "gdb-multiarch" || command -v "gdb")
gdb_arches=""
@@ -281,16 +273,13 @@ unset target_list_exclude
# The following Meson options are handled manually (still they
# are included in the automatically generated help message)
# 1. Track which submodules are needed
fdt="auto"
# 2. Automatically enable/disable other options
# because they automatically enable/disable other options
tcg="auto"
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=""
static="no"
@@ -743,22 +732,9 @@ for opt do
;;
--disable-cfi) cfi="false"
;;
--disable-fdt) fdt="disabled"
--disable-download) download="disabled"; git_submodules_action=validate;
;;
--enable-fdt) fdt="enabled"
;;
--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-download) download="enabled"; git_submodules_action=update;
;;
--enable-plugins) if test "$mingw32" = "yes"; then
error_exit "TCG plugins not currently supported on Windows platforms"
@@ -774,57 +750,47 @@ for opt do
;;
--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
--*) meson_option_parse "$opt" "$optarg"
;;
esac
done
if ! test -e "$source_path/.git"
then
git_submodules_action="ignore"
fi
# test for any invalid configuration combinations
if test "$plugins" = "yes" -a "$tcg" = "disabled"; then
error_exit "Can't enable plugins on non-TCG builds"
fi
case $git_submodules_action in
update|validate)
if test ! -e "$source_path/.git"; then
echo "ERROR: cannot $git_submodules_action git submodules without .git"
exit 1
fi
;;
ignore)
if ! test -f "$source_path/subprojects/keycodemapdb/README"
then
echo
echo "ERROR: missing GIT submodules"
echo
if test -e "$source_path/.git"; then
echo "--with-git-submodules=ignore specified but submodules were not"
echo "checked out. Please initialize and update submodules."
else
echo "This is not a GIT checkout but module content appears to"
echo "be missing. Do not use 'git archive' or GitHub download links"
echo "to acquire QEMU source archives. Non-GIT builds are only"
echo "supported with source archives linked from:"
echo
echo " https://www.qemu.org/download/#source"
echo
echo "Developers working with GIT can use scripts/archive-source.sh"
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
if ! test -f "$source_path/subprojects/keycodemapdb/README" \
&& test -f "$download" = disabled
then
echo
echo "ERROR: missing subprojects"
echo
if test -e "$source_path/.git"; then
echo "--disable-download specified but subprojects were not"
echo 'checked out. Please invoke "meson subprojects download"'
echo "before configuring QEMU, or remove --disable-download"
echo "from the command line."
else
echo "This is not a GIT checkout but subproject content appears to"
echo "be missing. Do not use 'git archive' or GitHub download links"
echo "to acquire QEMU source archives. Non-GIT builds are only"
echo "supported with source archives linked from:"
echo
echo " https://www.qemu.org/download/#source"
echo
echo "Developers working with GIT can use scripts/archive-source.sh"
echo "if they need to create valid source archives."
fi
echo
exit 1
fi
default_target_list=""
mak_wilds=""
@@ -892,10 +858,6 @@ Advanced options (experts only):
--python=PYTHON use specified python [$python]
--ninja=NINJA use specified ninja [$ninja]
--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]
--bindir=PATH install binaries in PATH
--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;
# - all setup can be performed offline;
# - 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,
# 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_flags=""
if test "$pypi" = "enabled" ; then
if test "$download" = "enabled" ; then
mkvenv_flags="--online"
fi
@@ -1003,7 +965,7 @@ meson="$(cd pyvenv/bin; pwd)/meson"
# Conditionally ensure Sphinx is installed.
mkvenv_flags=""
if test "$pypi" = "enabled" -a "$docs" = "enabled" ; then
if test "$download" = "enabled" -a "$docs" = "enabled" ; then
mkvenv_flags="--online"
fi
@@ -1040,7 +1002,7 @@ fi
# Consult white-list to determine whether to enable werror
# by default. Only enable by default for git builds
if test -z "$werror" ; then
if test "$git_submodules_action" != "ignore" && \
if test -e "$source_path/.git" && \
{ test "$linux" = "yes" || test "$mingw32" = "yes"; }; then
werror="yes"
else
@@ -1135,11 +1097,6 @@ if test "$tcg" = "auto"; then
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
cat > $TMPC << EOF
@@ -1167,16 +1124,6 @@ EOF
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
# semantic analysis of macros
@@ -1612,17 +1559,6 @@ write_target_makefile() {
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
@@ -1676,7 +1612,8 @@ fi
# Only build s390-ccw bios if the compiler has -march=z900 or -march=z10
# (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
do_compiler "$target_cc" $target_cc_cflags -march=z900 -o $TMPO -c $TMPC
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
echo "# Automatically generated by configure - do not modify" > $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
# 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
#######################################
# 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"
echo "# Automatically generated by configure - do not modify" > $config_host_mak
echo >> $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
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
# 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
test "$download" = "disabled" && meson_option_add "--wrap-mode=nodownload"
test "$bindir" != "bin" && meson_option_add "-Dbindir=$bindir"
test "$default_feature" = no && meson_option_add -Dauto_features=disabled
test "$static" = yes && meson_option_add -Dprefer_static=true
@@ -1958,12 +1883,10 @@ if test "$skip_meson" = no; then
# QEMU options
test "$cfi" != false && meson_option_add "-Dcfi=$cfi"
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 "$qemu_suffix" != qemu && meson_option_add "-Dqemu_suffix=$qemu_suffix"
test "$smbd" != '' && meson_option_add "-Dsmbd=$smbd"
test "$tcg" != enabled && meson_option_add "-Dtcg=$tcg"
test "$vfio_user_server" != auto && meson_option_add "-Dvfio_user_server=$vfio_user_server"
run_meson() {
NINJA=$ninja $meson setup --prefix "$prefix" "$@" $cross_arg "$PWD" "$source_path"
}
+3 -3
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)
$ ./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.
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
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
JOB ID : eab225724da7b64c012c65705dc2fa14ab1defef
JOB LOG : /home/anisinha/avocado/job-results/job-2022-10-10T17.58-eab2257/job.log
+4 -23
View File
@@ -102,28 +102,10 @@ Similar operations return the new value of ``*ptr``::
typeof(*ptr) qatomic_or_fetch(ptr, val)
typeof(*ptr) qatomic_xor_fetch(ptr, val)
``qemu/atomic.h`` also provides loads and stores that cannot be reordered
with each other::
``qemu/atomic.h`` also provides an optimized shortcut for
``qatomic_set`` followed by ``smp_mb``::
typeof(*ptr) qatomic_mb_read(ptr)
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.
void qatomic_set_mb(ptr, val)
Weak atomic access and manual memory barriers
@@ -523,8 +505,7 @@ and memory barriers, and the equivalents in QEMU:
| :: |
| |
| a = qatomic_read(&x); |
| qatomic_set(&x, a + 2); |
| smp_mb(); |
| qatomic_set_mb(&x, a + 2); |
| b = qatomic_read(&y); |
+--------------------------------+
+7 -7
View File
@@ -888,9 +888,9 @@ You can run the avocado tests simply by executing:
make check-avocado
This involves the automatic installation, from PyPI, of all the
necessary avocado-framework dependencies into the QEMU venv within the
build tree (at ``./pyvenv``). Test results are also saved within the
This involves the automatic creation of Python virtual environment
within the build tree (at ``tests/venv``) which will have all the
right dependencies, and will save tests results also within the
build tree (at ``tests/results``).
Note: the build environment must be using a Python 3 stack, and have
@@ -947,7 +947,7 @@ may be invoked by running:
.. 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
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::
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:
.. 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
of Avocado or ``make check-avocado``, and can also be queried using:
.. code::
pyvenv/bin/avocado list tests/avocado
tests/venv/bin/avocado list tests/avocado
Manual Installation
~~~~~~~~~~~~~~~~~~~
+5 -12
View File
@@ -259,24 +259,17 @@
# define smp_mb__after_rmw() smp_mb()
#endif
/* qatomic_mb_read/set semantics map Java volatile variables. They are
* less expensive on some platforms (notably POWER) than fully
* sequentially consistent operations.
*
* As long as they are used as paired operations they are safe to
* use. See docs/devel/atomics.rst for more discussion.
/*
* On some architectures, qatomic_set_mb is more efficient than a store
* plus a fence.
*/
#define qatomic_mb_read(ptr) \
qatomic_load_acquire(ptr)
#if !defined(QEMU_SANITIZE_THREAD) && \
(defined(__i386__) || defined(__x86_64__) || defined(__s390x__))
/* This is more efficient than a store plus a fence. */
# define qatomic_mb_set(ptr, i) \
# define qatomic_set_mb(ptr, i) \
({ (void)qatomic_xchg(ptr, i); smp_mb__after_rmw(); })
#else
# define qatomic_mb_set(ptr, i) \
# define qatomic_set_mb(ptr, i) \
({ qatomic_store_release(ptr, i); smp_mb(); })
#endif
+56 -78
View File
@@ -1092,9 +1092,8 @@ endif
mpathlibs = [libudev]
mpathpersist = not_found
mpathpersist_new_api = false
if targetos == 'linux' and have_tools and get_option('mpath').allowed()
mpath_test_source_new = '''
mpath_test_source = '''
#include <libudev.h>
#include <mpath_persist.h>
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();
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',
required: get_option('mpath'))
if libmpathpersist.found()
@@ -1139,10 +1128,7 @@ if targetos == 'linux' and have_tools and get_option('mpath').allowed()
endforeach
if mpathlibs.length() == 0
msg = 'Dependencies missing for libmpathpersist'
elif cc.links(mpath_test_source_new, dependencies: mpathlibs)
mpathpersist = declare_dependency(dependencies: mpathlibs)
mpathpersist_new_api = true
elif cc.links(mpath_test_source_old, dependencies: mpathlibs)
elif cc.links(mpath_test_source, dependencies: mpathlibs)
mpathpersist = declare_dependency(dependencies: mpathlibs)
else
msg = 'Cannot detect libmpathpersist API'
@@ -1273,10 +1259,16 @@ if not get_option('sdl').auto() or have_system
sdl_image = not_found
endif
if sdl.found()
# work around 2.0.8 bug
sdl = declare_dependency(compile_args: '-Wno-undef',
dependencies: sdl,
version: sdl.version())
# Some versions of SDL have problems with -Wundef
if not cc.compiles('''
#include <SDL.h>
#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'),
method: 'pkg-config')
else
@@ -1799,8 +1791,7 @@ malloc = []
if get_option('malloc') == 'system'
has_malloc_trim = \
get_option('malloc_trim').allowed() and \
cc.links('''#include <malloc.h>
int main(void) { malloc_trim(0); return 0; }''')
cc.has_function('malloc_trim', prefix: '#include <malloc.h>')
else
has_malloc_trim = false
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
# Check whether the glibc provides statx()
gnu_source_prefix = '''
#ifndef _GNU_SOURCE
#define _GNU_SOURCE
#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
statx_mnt_id_test = 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)
has_statx_mnt_id = cc.has_header_symbol('sys/stat.h', 'STATX_MNT_ID', prefix: gnu_source_prefix)
have_vhost_user_blk_server = get_option('vhost_user_blk_server') \
.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_LZO', lzo.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())
if blkio.found()
config_host_data.set('CONFIG_BLKIO_VHOST_VDPA_FD',
@@ -3058,14 +3033,7 @@ endif
libvfio_user_dep = not_found
if have_system and vfio_user_server_allowed
have_internal = fs.exists(meson.current_source_dir() / 'subprojects/libvfio-user/meson.build')
if not have_internal
error('libvfio-user source not found - please pull git submodule')
endif
libvfio_user_proj = subproject('libvfio-user')
libvfio_user_proj = subproject('libvfio-user', required: true)
libvfio_user_dep = libvfio_user_proj.get_variable('libvfio_user_dep')
endif
@@ -3093,12 +3061,6 @@ if fdt_required.length() > 0 or fdt_opt == 'enabled'
endif
if not fdt.found()
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,
default_options: ['tools=false', 'yaml=disabled',
'python=disabled', 'default_library=static'])
@@ -4012,8 +3974,14 @@ endif
# Configuration summary #
#########################
# Directories
# Build environment
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 += {'BIOS directory': qemu_datadir}
pathsep = targetos == 'windows' ? ';' : ':'
@@ -4031,14 +3999,10 @@ else
summary_info += {'local state directory': 'queried at runtime'}
endif
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')
# Host binaries
summary_info = {}
summary_info += {'git': config_host['GIT']}
summary_info += {'python': '@0@ (version: @1@)'.format(python.full_path(), python.language_version())}
summary_info += {'sphinx-build': sphinx_build}
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(summary_info, bool_yn: true, section: 'Crypto')
# Libraries
# UI
summary_info = {}
if targetos == 'darwin'
summary_info += {'Cocoa support': cocoa}
summary_info += {'vmnet.framework support': vmnet}
endif
summary_info += {'SDL support': sdl}
summary_info += {'SDL image support': sdl_image}
summary_info += {'GTK support': gtk}
summary_info += {'pixman': pixman}
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 += {'VNC support': vnc}
if vnc.found()
summary_info += {'VNC SASL support': sasl}
summary_info += {'VNC JPEG support': jpeg}
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']
summary_info += {'OSS support': oss}
summary_info += {'sndio support': sndio}
@@ -4283,12 +4247,30 @@ if targetos == 'linux'
summary_info += {'ALSA support': alsa}
summary_info += {'PulseAudio support': pulse}
endif
summary_info += {'Pipewire support': pipewire}
summary_info += {'Pipewire support': pipewire}
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 += {'netmap support': have_netmap}
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 io_uring support': linux_io_uring}
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 += {'libcap-ng support': libcap_ng}
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 += {'smartcard support': cacard}
summary_info += {'U2F support': u2f}
+1 -1
View File
@@ -246,7 +246,7 @@ static QMPRequest *monitor_qmp_dispatcher_pop_any(void)
*
* 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) {
QMPRequest *req_obj;
+11 -5
View File
@@ -6,6 +6,8 @@ include config-host.mak
CFLAGS = -O2 -g
MAKEFLAGS += -rR
GIT_SUBMODULES = roms/SLOF
NULL :=
SPACE := $(NULL) #
TARGET_PREFIX := $(patsubst %/,%:$(SPACE),$(TARGET_DIR))
@@ -65,12 +67,7 @@ s390-ccw.img: s390-ccw.elf
$(OBJECTS): Makefile
ifneq ($(wildcard $(SRC_PATH)/../../roms/SLOF/lib/libnet),)
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))
-include $(ALL_OBJS:%.o=%.d)
@@ -80,3 +77,12 @@ clean:
distclean:
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
+74 -2
View File
@@ -553,6 +553,74 @@ def pkgname_from_depspec(dep_spec: str) -> str:
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]:
# pylint: disable=import-outside-toplevel
# pylint: disable=no-name-in-module
@@ -741,8 +809,12 @@ def _do_ensure(
for spec in dep_specs:
matcher = distlib.version.LegacyMatcher(spec)
ver = _get_version(matcher.name)
if ver is None or not matcher.match(
distlib.version.LegacyVersion(ver)
if (
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)
else:
+7 -20
View File
@@ -26,8 +26,7 @@ sub_file="${sub_tdir}/submodule.tar"
# independent of what the developer currently has initialized
# in their checkout, because the build environment is completely
# different to the host OS.
submodules="subprojects/dtc subprojects/keycodemapdb"
submodules="$submodules tests/fp/berkeley-softfloat-3 tests/fp/berkeley-testfloat-3"
subprojects="dtc keycodemapdb libvfio-user berkeley-softfloat-3 berkeley-testfloat-3"
sub_deinit=""
function cleanup() {
@@ -51,23 +50,11 @@ function tree_ish() {
git archive --format tar "$(tree_ish)" > "$tar_file"
test $? -ne 0 && error "failed to archive qemu"
for sm in $submodules; do
status="$(git submodule status "$sm")"
smhash="${status#[ +-]}"
smhash="${smhash%% *}"
case "$status" in
-*)
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"
for sp in $subprojects; do
meson subprojects download $sp
test $? -ne 0 && error "failed to download subproject $sp"
tar --append --file "$tar_file" --exclude=.git subprojects/$sp
test $? -ne 0 && error "failed to append subproject $sp to $tar_file"
done
exit 0
-3
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" \
--with-suffix="qemu-kvm" \
--firmwarepath=/usr/share/qemu-firmware \
--with-git=meson \
--with-git-submodules=update \
--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" \
--audio-drv-list="" \
--block-drv-ro-whitelist="vmdk,vhdx,vpc,https,ssh" \
--with-coroutine=ucontext \
--with-git=git \
--tls-priority=@QEMU,SYSTEM \
--disable-attr \
--disable-auth-pam \
@@ -4,7 +4,7 @@
# KVM and x86_64, or tests that are generic enough to be valid for all
# 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 \
# tests/avocado/
#
@@ -22,7 +22,7 @@
# - tests/avocado/virtio_check_params.py:VirtioMaxSegSettingsCheck.test_machine_types
#
make get-vm-images
./pyvenv/bin/avocado run \
./tests/venv/bin/avocado run \
--job-results-dir=tests/results/ \
tests/avocado/boot_linux.py:BootLinuxX8664.test_pc_i440fx_kvm \
tests/avocado/boot_linux.py:BootLinuxX8664.test_pc_q35_kvm \

Some files were not shown because too many files have changed in this diff Show More