Misc patches for 2020-12-21
Subsystems (4)
The following changes since commit a05f8ecd88f15273d033b6f044b850a8af84a5b8:
Merge remote-tracking branch 'remotes/alistair/tags/pull-riscv-to-apply-20201217-1' into staging (2020-12-18 11:12:35 +0000)
are available in the Git repository at:
https://gitlab.com/bonzini/qemu.git tags/for-upstream
for you to fetch changes up to 16efbeeb765944fdda71862b40d60f0abeb1e200:
win32: drop fd registration to the main-loop on setting non-block (2020-12-21 13:53:24 +0100)
----------------------------------------------------------------
From Alex's pull request:
* improve cross-build KVM coverage
* new --without-default-features configure flag
* add __repr__ for ConsoleSocket for debugging
* build tcg tests with -Werror
* test 32 bit builds with fedora
* remove last traces of debian9
* hotfix for centos8 powertools repo
* Move lots of feature detection code to meson (Alex, myself)
* CFI and LTO support (Daniele)
* test-char dangling pointer (Eduardo)
* Build system and win32 fixes (Marc-André)
* Initialization fixes (myself)
* TCG include cleanup (Richard, myself)
* x86 'int N' fix (Peter)
----------------------------------------------------------------
Alex Bennée (7):
gitlab: include aarch64-softmmu and ppc64-softmmu cross-system-build
configure: move gettext detection to meson.build
configure: add --without-default-features
python: add __repr__ to ConsoleSocket to aid debugging
gitlab: move --without-default-devices build from Travis
gitlab: add --without-default-features build
tests/tcg: build tests with -Werror
Daniel P. Berrangé (1):
tests: update for rename of CentOS8 PowerTools repo
Daniele Buono (5):
configure,meson: add option to enable LTO
cfi: Initial support for cfi-icall in QEMU
check-block: enable iotests with cfi-icall configure,meson: support Control-Flow Integrity
docs: Add CFI Documentation
Eduardo Habkost (2):
test-char: Destroy chardev correctly at char_file_test_internal()
qom: Assert that objects being destroyed have no parent
Marc-André Lureau (2):
build-sys: fix -static linking of libvhost-user
win32: drop fd registration to the main-loop on setting non-block
Paolo Bonzini (34):
configure: document --without-default-{features,devices}
vl: initialize displays _after_ exiting preconfiguration remove TCG includes from common code
trace: do not include TCG helper tracepoints in no-TCG builds
Makefile: add dummy target for build.ninja dependencies
meson: update submodule to 0.56.0
meson: switch minimum meson version to 0.56.0
meson: fix detection of curses with pkgconfig
meson: use pkg-config method for libudev
meson: use dependency to gate block modules
meson: cleanup Kconfig.host handling
configure: remove useless code to check for Xen PCI passthrough
configure: remove variable bogus_os
configure: accept --enable-slirp
configure: remove CONFIG_FILEVERSION and CONFIG_PRODUCTVERSION
brlapi: convert to meson
curl: remove compatibility code, require 7.29.0
curl: convert to meson
glusterfs: convert to meson
bzip2: convert to meson
libiscsi: convert to meson
libnfs: convert to meson
libssh: convert to meson
rbd: convert to meson
lzo: convert to meson
snappy: convert to meson
lzfse: convert to meson
zstd: convert to meson
seccomp: convert to meson
virtfs: convert to meson
cap_ng: convert to meson
libattr: convert to meson
meson.build: convert --with-default-devices to meson
configure: move tests/qemu-iotests/common.env generation to meson
Peter Maydell (1):
target/i386: Check privilege level for protected mode 'int N' task gate
Richard Henderson (1):
util: Extract flush_icache_range to cacheflush.c
Thomas Huth (2):
gitlab-CI: Test 32-bit builds with the fedora-i386-cross container tests/docker: Remove the remainders of debian9 containers from the Makefile
.gitlab-ci.d/crossbuilds.yml | 22 +-
.gitlab-ci.yml | 14 +
.travis.yml | 8 -
MAINTAINERS | 2 +
Makefile | 1 +
accel/Kconfig | 9 +
accel/stubs/tcg-stub.c | 1 -
accel/tcg/cpu-exec.c | 11 +
accel/tcg/cputlb.c | 2 +-
accel/tcg/translate-all.c | 2 +-
accel/tcg/user-exec.c | 2 +-
block/curl.c | 28 -
block/meson.build | 22 +-
chardev/meson.build | 2 +-
configure | 805 +++++-----------------
contrib/elf2dmp/meson.build | 2 +-
contrib/vhost-user-scsi/meson.build | 2 +-
cpu.c | 2 +-
docs/devel/control-flow-integrity.rst | 137 ++++
docs/devel/index.rst | 5 +-
docs/devel/kconfig.rst | 19 +-
docs/meson.build | 12 +-
hw/i386/kvmvapic.c | 1 -
{accel/tcg => include/exec}/translate-all.h | 0
include/qemu/cacheflush.h | 24 +
include/qemu/compiler.h | 12 +
meson | 2 +-
meson.build | 484 +++++++++----
meson_options.txt | 49 +-
migration/meson.build | 2 +-
monitor/misc.c | 1 -
plugins/core.c | 37 +
plugins/loader.c | 7 +
plugins/meson.build | 4 +-
po/meson.build | 2 +-
python/qemu/console_socket.py | 7 +
qom/object.c | 1 +
softmmu/meson.build | 2 +-
softmmu/physmem.c | 4 +-
softmmu/qemu-seccomp.c | 2 -
softmmu/vl.c | 2 +-
target/i386/tcg/seg_helper.c | 35 +-
tcg/aarch64/tcg-target.h | 5 -
tcg/arm/tcg-target.h | 5 -
tcg/i386/tcg-target.h | 4 -
tcg/mips/tcg-target.h | 11 -
tcg/ppc/tcg-target.c.inc | 22 -
tcg/ppc/tcg-target.h | 1 -
tcg/riscv/tcg-target.h | 5 -
tcg/s390/tcg-target.h | 4 -
tcg/sparc/tcg-target.h | 8 -
tcg/tcg.c | 1 +
tcg/tci.c | 7 +
tcg/tci/tcg-target.h | 4 -
tests/check-block.sh | 18 +-
tests/docker/Makefile.include | 6 +-
tests/docker/dockerfiles/centos8.docker | 5 +-
tests/docker/dockerfiles/fedora-i386-cross.docker | 18 +-
tests/meson.build | 2 +-
tests/qapi-schema/meson.build | 4 +-
tests/qemu-iotests/common.env.in | 3 +
tests/qemu-iotests/meson.build | 3 +
tests/qtest/meson.build | 2 +-
tests/tcg/Makefile.target | 2 +-
tests/test-char.c | 2 +-
tools/meson.build | 6 +-
trace/meson.build | 6 +-
util/cacheflush.c | 71 ++
util/main-loop.c | 11 +
util/meson.build | 2 +-
util/oslib-posix.c | 11 +
util/oslib-win32.c | 1 -
version.rc | 4 +-
73 files changed, 1069 insertions(+), 973 deletions(-)
create mode 100644 docs/devel/control-flow-integrity.rst
rename {accel/tcg => include/exec}/translate-all.h (100%)
create mode 100644 include/qemu/cacheflush.h
create mode 100644 tests/qemu-iotests/common.env.in
create mode 100644 util/cacheflush.cSignature · 1 line
2.29.2
[PULL 01/55] gitlab: include aarch64-softmmu and ppc64-softmmu cross-system-build
From: Alex Bennée <[email protected]>
Otherwise we miss coverage of KVM support in the cross build. To balance it out add arm-softmmu (no kvm, subset of aarch64), cris-softmmu and ppc-softmmu to the exclude list which do get coverage elsewhere.
Message-Id: <[email protected]>
--- .gitlab-ci.d/crossbuilds.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
.gitlab-ci.d/crossbuilds.yml +3 -3
@@ -7,9 +7,9 @@ - cd build - PKG_CONFIG_PATH=$PKG_CONFIG_PATH ../configure --enable-werror $QEMU_CONFIGURE_OPTS --disable-user - --target-list-exclude="aarch64-softmmu i386-softmmu microblaze-softmmu - mips-softmmu mipsel-softmmu mips64-softmmu ppc64-softmmu sh4-softmmu - xtensa-softmmu" + --target-list-exclude="arm-softmmu cris-softmmu i386-softmmu + microblaze-softmmu mips-softmmu mipsel-softmmu mips64-softmmu + ppc-softmmu sh4-softmmu xtensa-softmmu" - make -j$(expr $(nproc) + 1) all check-build # Job to cross-build specific accelerators.
Signature · 1 line
2.29.2
[PULL 02/55] configure: move gettext detection to meson.build
In reply to Paolo BonziniFrom: Alex Bennée <[email protected]>
This will allow meson to honour -Dauto_features=disabled later.
Message-Id: <[email protected]>
--- configure | 19 +++---------------- meson_options.txt | 2 +- po/meson.build | 2 +- 3 files changed, 5 insertions(+), 18 deletions(-)
configure +3 -16
@@ -448,7 +448,7 @@ libdaxctl="" meson="" ninja="" skip_meson=no -gettext="" +gettext="auto" fuse="auto" fuse_lseek="auto"
@@ -1016,9 +1016,9 @@ for opt do ;; --enable-vnc) vnc="enabled" ;; - --disable-gettext) gettext="false" + --disable-gettext) gettext="disabled" ;; - --enable-gettext) gettext="true" + --enable-gettext) gettext="enabled" ;; --oss-lib=*) oss_lib="$optarg" ;;
@@ -2847,19 +2847,6 @@ if test "$xen_pci_passthrough" != "disabled"; then fi fi -########################################## -# gettext probe -if test "$gettext" != "false" ; then - if has xgettext; then - gettext=true - else - if test "$gettext" = "true" ; then - feature_not_found "gettext" "Install xgettext binary" - fi - gettext=false - fi -fi - ########################################## # X11 probe if $pkg_config --exists "x11"; then
meson_options.txt +1 -1
@@ -9,7 +9,7 @@ option('sphinx_build', type : 'string', value : '', option('docs', type : 'feature', value : 'auto', description: 'Documentations build support') -option('gettext', type : 'boolean', value : true, +option('gettext', type : 'feature', value : 'auto', description: 'Localization of the GTK+ user interface') option('install_blobs', type : 'boolean', value : true, description: 'install provided firmware blobs')
po/meson.build +1 -1
@@ -1,6 +1,6 @@ i18n = import('i18n') -if get_option('gettext') +if find_program('xgettext', required: get_option('gettext')).found() i18n.gettext(meson.project_name(), args: '[email protected]', preset: 'glib')
Signature · 1 line
2.29.2
[PULL 04/55] python: add __repr__ to ConsoleSocket to aid debugging
In reply to Paolo BonziniFrom: Alex Bennée <[email protected]>
While attempting to debug some console weirdness I thought it would be worth making it easier to see what it had inside.
Message-Id: <[email protected]>
--- python/qemu/console_socket.py | 7 +++++++ 1 file changed, 7 insertions(+)
python/qemu/console_socket.py +7 -0
@@ -45,6 +45,13 @@ class ConsoleSocket(socket.socket): if drain: self._drain_thread = self._thread_start() + def __repr__(self) -> str: + s = super().__repr__() + s = s.rstrip(">") + s = "%s, logfile=%s, drain_thread=%s>" % (s, self._logfile, + self._drain_thread) + return s + def _drain_fn(self) -> None: """Drains the socket and runs while the socket is open.""" while self._open:
Signature · 1 line
2.29.2
[PULL 13/55] test-char: Destroy chardev correctly at char_file_test_internal()
In reply to Paolo BonziniFrom: Eduardo Habkost <[email protected]>
commit 1e419ee68fa5 ("chardev: generate an internal id when none given") changed the reference ownership semantics of qemu_chardev_new(NULL, ...): now all chardevs created using qemu_chardev_new() are added to the /chardevs QOM container, and the caller does not own a reference to the newly created object.
However, the code at char_file_test_internal() had not been updated and was calling object_unref() on a chardev object it didn't own. This makes the chardev be destroyed, but leaves a dangling pointer in the /chardev container children list, and seems to be the cause of the following char_serial_test() crash:
Unexpected error in object_property_try_add() at ../qom/object.c:1220: \
attempt to add duplicate property 'serial-id' to object (type 'container')
ERROR test-char - too few tests run (expected 38, got 9)
Update the code to use object_unparent() at the end of char_file_test_internal(), to make sure the chardev will be correctly removed from the QOM tree.
Message-Id: <[email protected]>
--- tests/test-char.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
tests/test-char.c +1 -1
@@ -1298,7 +1298,7 @@ static void char_file_test_internal(Chardev *ext_chr, const char *filepath)g_assert (strncmp (contents,"hello!" ,6 ) ==0 );if (!ext_chr) { -object_unref (OBJECT (chr)); +object_unparent (OBJECT (chr));g_unlink (out); }g_free (contents);
Signature · 1 line
2.29.2
[PULL 08/55] gitlab-CI: Test 32-bit builds with the fedora-i386-cross container
In reply to Paolo BonziniFrom: Thomas Huth <[email protected]>
After adding some missing packages, it's possible to check 32-bit builds and tests with the fedora-i386-cross container in the gitlab-CI, too. Unfortunately, the code in subprojects/ ignores the --extra-cflags (on purpose), so the vhost-user part has to be disabled for this.
While we're at it, update the container to Fedora 31. Unfortunately the gcc from the later versions emits some very dubious format-truncation warnings, so Fedora 32 and 33 are currently unsuitable for this job.
Message-Id: <[email protected]>
--- .gitlab-ci.d/crossbuilds.yml | 16 ++++++++++++++-- .../dockerfiles/fedora-i386-cross.docker | 18 +++++++++++++++--- 2 files changed, 29 insertions(+), 5 deletions(-)
.gitlab-ci.d/crossbuilds.yml +14 -2
@@ -10,7 +10,7 @@ --target-list-exclude="arm-softmmu cris-softmmu i386-softmmu microblaze-softmmu mips-softmmu mipsel-softmmu mips64-softmmu ppc-softmmu sh4-softmmu xtensa-softmmu" - - make -j$(expr $(nproc) + 1) all check-build + - make -j$(expr $(nproc) + 1) all check-build $MAKE_CHECK_ARGS # Job to cross-build specific accelerators. #
@@ -37,7 +37,7 @@ - cd build - PKG_CONFIG_PATH=$PKG_CONFIG_PATH ../configure --enable-werror $QEMU_CONFIGURE_OPTS --disable-system - - make -j$(expr $(nproc) + 1) all check-build + - make -j$(expr $(nproc) + 1) all check-build $MAKE_CHECK_ARGS cross-armel-system: extends: .cross_system_build_job
@@ -69,6 +69,18 @@ cross-arm64-user: variables: IMAGE: debian-arm64-cross +cross-i386-system: + extends: .cross_system_build_job + variables: + IMAGE: fedora-i386-cross + MAKE_CHECK_ARGS: check-qtest + +cross-i386-user: + extends: .cross_user_build_job + variables: + IMAGE: fedora-i386-cross + MAKE_CHECK_ARGS: check + cross-mips-system: extends: .cross_system_build_job variables:
tests/docker/dockerfiles/fedora-i386-cross.docker +15 -3
@@ -1,14 +1,26 @@ -FROM fedora:30 +FROM fedora:31 ENV PACKAGES \ + bzip2 \ + diffutils \ + findutils \ gcc \ + git \ + libtasn1-devel.i686 \ + libzstd-devel.i686 \ + make \ + meson \ + ninja-build \ glib2-devel.i686 \ glibc-devel.i686 \ glibc-static.i686 \ gnutls-devel.i686 \ nettle-devel.i686 \ + perl-Test-Harness \ pixman-devel.i686 \ - zlib-devel.i686 \ - libzstd-devel.i686 + zlib-devel.i686 + +ENV QEMU_CONFIGURE_OPTS --extra-cflags=-m32 --disable-vhost-user +ENV PKG_CONFIG_PATH /usr/lib/pkgconfig RUN dnf install -y $PACKAGES RUN rpm -q $PACKAGES | sort > /packages.txt
Signature · 1 line
2.29.2
[PULL 05/55] gitlab: move --without-default-devices build from Travis
In reply to Paolo BonziniFrom: Alex Bennée <[email protected]>
Message-Id: <[email protected]>
--- .gitlab-ci.yml | 7 +++++++ .travis.yml | 8 -------- 2 files changed, 7 insertions(+), 8 deletions(-)
.gitlab-ci.yml +7 -0
@@ -514,6 +514,13 @@ build-trace-ust-system: IMAGE: ubuntu2004 CONFIGURE_ARGS: --enable-trace-backends=ust --target-list=x86_64-softmmu +# Check our reduced build configurations +build-without-default-devices: + <<: *native_build_job_definition + variables: + IMAGE: centos8 + CONFIGURE_ARGS: --without-default-devices --disable-user + check-patch: stage: build image: $CI_REGISTRY_IMAGE/qemu/centos8:latest
.travis.yml +0 -8
@@ -205,14 +205,6 @@ jobs: - ${SRC_DIR}/scripts/travis/coverage-summary.sh - # We manually include builds which we disable "make check" for - - name: "GCC without-default-devices (softmmu)" - env: - - CONFIG="--without-default-devices --disable-user" - - CACHE_NAME="${TRAVIS_BRANCH}-linux-gcc-default" - - TEST_CMD="" - - # Using newer GCC with sanitizers - name: "GCC9 with sanitizers (softmmu)" dist: bionic
Signature · 1 line
2.29.2
[PULL 12/55] vl: initialize displays _after_ exiting preconfiguration
In reply to Paolo BonziniDue to the renumbering of text consoles when graphical consoles are created, init_displaystate must be called after all QemuConsoles are created, i.e. after devices are created.
vl.c calls it from qemu_init_displays, while qmp_x_exit_preconfig is where devices are created. If qemu_init_displays is called before it, the VGA graphical console does not come up.
--- softmmu/vl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
softmmu/vl.c +1 -1
@@ -3529,10 +3529,10 @@ void qemu_init(int argc, char **argv, char **envp)exit (0 ); } -qemu_init_displays ();if (!preconfig_requested) {qmp_x_exit_preconfig (&error_fatal); } +qemu_init_displays ();accel_setup_post (current_machine);os_setup_post ();resume_mux_open ();
Signature · 1 line
2.29.2
[PULL 16/55] configure,meson: add option to enable LTO
In reply to Paolo BonziniFrom: Daniele Buono <[email protected]>
This patch allows to compile QEMU with link-time optimization (LTO). Compilation with LTO is handled directly by meson. This patch only adds the option in configure and forwards the request to meson
Tested with all major versions of clang from 6 to 12
Message-Id: <[email protected]>
--- configure | 7 +++++++ meson.build | 1 + 2 files changed, 8 insertions(+)
configure +7 -0
@@ -242,6 +242,7 @@ host_cc="cc" audio_win_int="" libs_qga="" debug_info="yes" +lto="false" stack_protector="" safe_stack="" use_containers="yes"
@@ -1182,6 +1183,10 @@ for opt do ;; --disable-werror) werror="no" ;; + --enable-lto) lto="true" + ;; + --disable-lto) lto="false" + ;; --enable-stack-protector) stack_protector="yes" ;; --disable-stack-protector) stack_protector="no"
@@ -1779,6 +1784,7 @@ disabled with --disable-FEATURE, default is enabled if available module-upgrades try to load modules from alternate paths for upgrades debug-tcg TCG debugging (default is disabled) debug-info debugging information + lto Enable Link-Time Optimization. sparse sparse checker safe-stack SafeStack Stack Smash Protection. Depends on clang/llvm >= 3.7 and requires coroutine backend ucontext.
@@ -6964,6 +6970,7 @@ NINJA=$ninja $meson setup \ -Db_pie=$(if test "$pie" = yes; then echo true; else echo false; fi) \ ${staticpic:+-Db_staticpic=$staticpic} \ -Db_coverage=$(if test "$gcov" = yes; then echo true; else echo false; fi) \ + -Db_lto=$lto \ -Dmalloc=$malloc -Dmalloc_trim=$malloc_trim -Dsparse=$sparse \ -Dkvm=$kvm -Dhax=$hax -Dwhpx=$whpx -Dhvf=$hvf \ -Dxen=$xen -Dxen_pci_passthrough=$xen_pci_passthrough -Dtcg=$tcg \
meson.build +1 -0
@@ -2080,6 +2080,7 @@ summary_info += {'gprof enabled': config_host.has_key('CONFIG_GPROF')} summary_info += {'sparse enabled': sparse.found()} summary_info += {'strip binaries': get_option('strip')} summary_info += {'profiler': config_host.has_key('CONFIG_PROFILER')} +summary_info += {'link-time optimization (LTO)': get_option('b_lto')} summary_info += {'static build': config_host.has_key('CONFIG_STATIC')} if targetos == 'darwin' summary_info += {'Cocoa support': config_host.has_key('CONFIG_COCOA')}
Signature · 1 line
2.29.2
[PULL 03/55] configure: add --without-default-features
In reply to Paolo BonziniFrom: Alex Bennée <[email protected]>
By default QEMU enables a lot of features if it can probe and find the support libraries. It also enables a bunch of features by default. This patch adds the ability to build --without-default-features which can be paired with a --without-default-devices for a barely functional build.
The main use case for this is testing our build assumptions and for minimising the amount of stuff you build if you just want to test a particular feature on your relatively slow emulated test system. On it's own I go from:
$ ls -lh qemu-system-aarch64 -rwxr-xr-x 1 alex alex 120M Dec 10 12:45 qemu-system-aarch64* $ ldd qemu-system-aarch64 | wc -l 170
to:
$ ls -lh qemu-aarch64 -rwxr-xr-x 1 alex alex 43M Dec 10 12:41 qemu-aarch64* $ ldd qemu-system-aarch64 | wc -l 57
which is still able to run my default Debian ARM64 machine with a lot less fat involved.
Message-Id: <[email protected]>
--- configure | 155 ++++++++++++++++++++++++++++++------------------------ 1 file changed, 85 insertions(+), 70 deletions(-)
configure +85 -70
@@ -293,8 +293,19 @@ unset target_list_exclude # Distributions want to ensure that several features are compiled in, and it # is impossible without a --enable-foo that exits if a feature is not found. -brlapi="" -curl="" +default_feature="" +# parse CC options second +for opt do + optarg=$(expr "x$opt" : 'x[^=]*=\(.*\)') + case "$opt" in + --without-default-features) + default_feature="no" + ;; + esac +done + +brlapi="$default_feature" +curl="$default_feature" iconv="auto" curses="auto" docs="auto"
@@ -303,52 +314,52 @@ netmap="no" sdl="auto" sdl_image="auto" virtiofsd="auto" -virtfs="" +virtfs="$default_feature" libudev="auto" mpath="auto" vnc="enabled" sparse="auto" -vde="" +vde="$default_feature" vnc_sasl="auto" vnc_jpeg="auto" vnc_png="auto" xkbcommon="auto" -xen="" -xen_ctrl_version="" +xen="$default_feature" +xen_ctrl_version="$default_feature" xen_pci_passthrough="auto" -linux_aio="" -linux_io_uring="" -cap_ng="" -attr="" -libattr="" -xfs="" +linux_aio="$default_feature" +linux_io_uring="$default_feature" +cap_ng="$default_feature" +attr="$default_feature" +libattr="$default_feature" +xfs="$default_feature" tcg="enabled" -membarrier="" -vhost_net="" -vhost_crypto="" -vhost_scsi="" -vhost_vsock="" +membarrier="$default_feature" +vhost_net="$default_feature" +vhost_crypto="$default_feature" +vhost_scsi="$default_feature" +vhost_vsock="$default_feature" vhost_user="no" vhost_user_blk_server="auto" -vhost_user_fs="" +vhost_user_fs="$default_feature" kvm="auto" hax="auto" hvf="auto" whpx="auto" -rdma="" -pvrdma="" +rdma="$default_feature" +pvrdma="$default_feature" gprof="no" debug_tcg="no" debug="no" sanitizers="no" tsan="no" -fortify_source="" +fortify_source="$default_feature" strip_opt="yes" tcg_interpreter="no" bigendian="no" mingw32="no" gcov="no" -EXESUF="" +EXESUF="$default_feature" HOST_DSOSUF=".so" modules="no" module_upgrades="no"
@@ -370,81 +381,81 @@ pie="" qom_cast_debug="yes" trace_backends="log" trace_file="trace" -spice="" -rbd="" -smartcard="" +spice="$default_feature" +rbd="$default_feature" +smartcard="$default_feature" u2f="auto" -libusb="" -usb_redir="" -opengl="" +libusb="$default_feature" +usb_redir="$default_feature" +opengl="$default_feature" opengl_dmabuf="no" cpuid_h="no" -avx2_opt="" +avx2_opt="$default_feature" capstone="auto" -lzo="" -snappy="" -bzip2="" -lzfse="" -zstd="" -guest_agent="" +lzo="$default_feature" +snappy="$default_feature" +bzip2="$default_feature" +lzfse="$default_feature" +zstd="$default_feature" +guest_agent="$default_feature" guest_agent_with_vss="no" guest_agent_ntddscsi="no" -guest_agent_msi="" -vss_win32_sdk="" +guest_agent_msi="$default_feature" +vss_win32_sdk="$default_feature" win_sdk="no" -want_tools="" -libiscsi="" -libnfs="" +want_tools="$default_feature" +libiscsi="$default_feature" +libnfs="$default_feature" coroutine="" -coroutine_pool="" +coroutine_pool="$default_feature" debug_stack_usage="no" crypto_afalg="no" -seccomp="" -glusterfs="" +seccomp="$default_feature" +glusterfs="$default_feature" glusterfs_xlator_opt="no" glusterfs_discard="no" glusterfs_fallocate="no" glusterfs_zerofill="no" glusterfs_ftruncate_has_stat="no" glusterfs_iocb_has_stat="no" -gtk="" +gtk="$default_feature" gtk_gl="no" tls_priority="NORMAL" -gnutls="" -nettle="" +gnutls="$default_feature" +nettle="$default_feature" nettle_xts="no" -gcrypt="" +gcrypt="$default_feature" gcrypt_hmac="no" gcrypt_xts="no" qemu_private_xts="yes" -auth_pam="" -vte="" -virglrenderer="" -tpm="" -libssh="" -live_block_migration="yes" -numa="" +auth_pam="$default_feature" +vte="$default_feature" +virglrenderer="$default_feature" +tpm="$default_feature" +libssh="$default_feature" +live_block_migration=${default_feature:-yes} +numa="$default_feature" tcmalloc="no" jemalloc="no" -replication="yes" -bochs="yes" -cloop="yes" -dmg="yes" -qcow1="yes" -vdi="yes" -vvfat="yes" -qed="yes" -parallels="yes" +replication=${default_feature:-yes} +bochs=${default_feature:-yes} +cloop=${default_feature:-yes} +dmg=${default_feature:-yes} +qcow1=${default_feature:-yes} +vdi=${default_feature:-yes} +vvfat=${default_feature:-yes} +qed=${default_feature:-yes} +parallels=${default_feature:-yes} sheepdog="no" -libxml2="" +libxml2="$default_feature" debug_mutex="no" -libpmem="" +libpmem="$default_feature" default_devices="yes" plugins="no" fuzzing="no" rng_none="no" -secret_keyring="" -libdaxctl="" +secret_keyring="$default_feature" +libdaxctl="$default_feature" meson="" ninja="" skip_meson=no
@@ -455,7 +466,7 @@ fuse_lseek="auto" bogus_os="no" malloc_trim="auto" -# parse CC options first +# parse CC options second for opt do optarg=$(expr "x$opt" : 'x[^=]*=\(.*\)') case "$opt" in
@@ -798,7 +809,7 @@ Linux) audio_possible_drivers="oss alsa sdl pa" linux="yes" linux_user="yes" - vhost_user="yes" + vhost_user=${default_feature:-yes} ;; esac
@@ -942,6 +953,8 @@ for opt do ;; --without-default-devices) default_devices="no" ;; + --without-default-features) # processed above + ;; --enable-gprof) gprof="yes" ;; --enable-gcov) gcov="yes"
@@ -1747,7 +1760,8 @@ Advanced options (experts only): --gdb=GDB-path gdb to use for gdbstub tests [$gdb_bin] Optional features, enabled with --enable-FEATURE and -disabled with --disable-FEATURE, default is enabled if available: +disabled with --disable-FEATURE, default is enabled if available +(unless built with --without-default-features): system all system emulation targets user supported user emulation targets
@@ -6957,6 +6971,7 @@ NINJA=$ninja $meson setup \ -Ddocs=$docs -Dsphinx_build=$sphinx_build -Dinstall_blobs=$blobs \ -Dvhost_user_blk_server=$vhost_user_blk_server \ -Dfuse=$fuse -Dfuse_lseek=$fuse_lseek \ + $(if test "$default_features" = no; then echo "-Dauto_features=disabled"; fi) \ $cross_arg \ "$PWD" "$source_path"
Signature · 1 line
2.29.2
[PULL 06/55] gitlab: add --without-default-features build
In reply to Paolo BonziniFrom: Alex Bennée <[email protected]>
Message-Id: <[email protected]>
--- .gitlab-ci.yml | 7 +++++++ 1 file changed, 7 insertions(+)
.gitlab-ci.yml +7 -0
@@ -521,6 +521,13 @@ build-without-default-devices: IMAGE: centos8 CONFIGURE_ARGS: --without-default-devices --disable-user +build-without-default-features: + <<: *native_build_job_definition + variables: + IMAGE: debian-amd64 + CONFIGURE_ARGS: --without-default-features --disable-user + MAKE_CHECK_ARGS: check-unit + check-patch: stage: build image: $CI_REGISTRY_IMAGE/qemu/centos8:latest
Signature · 1 line
2.29.2
[PULL 20/55] docs: Add CFI Documentation
In reply to Paolo BonziniFrom: Daniele Buono <[email protected]>
Document how to compile with CFI and how to maintain CFI-safe code
Message-Id: <[email protected]>
--- docs/devel/control-flow-integrity.rst | 137 ++++++++++++++++++++++++++ docs/devel/index.rst | 5 +- 2 files changed, 140 insertions(+), 2 deletions(-) create mode 100644 docs/devel/control-flow-integrity.rst
docs/devel/control-flow-integrity.rst new file +137 -0
@@ -0,0 +1,137 @@ +============================ +Control-Flow Integrity (CFI) +============================ + +This document describes the current control-flow integrity (CFI) mechanism in +QEMU. How it can be enabled, its benefits and deficiencies, and how it affects +new and existing code in QEMU + +Basics +------ + +CFI is a hardening technique that focusing on guaranteeing that indirect +function calls have not been altered by an attacker. +The type used in QEMU is a forward-edge control-flow integrity that ensures +function calls performed through function pointers, always call a "compatible" +function. A compatible function is a function with the same signature of the +function pointer declared in the source code. + +This type of CFI is entirely compiler-based and relies on the compiler knowing +the signature of every function and every function pointer used in the code. +As of now, the only compiler that provides support for CFI is Clang. + +CFI is best used on production binaries, to protect against unknown attack +vectors. + +In case of a CFI violation (i.e. call to a non-compatible function) QEMU will +terminate abruptly, to stop the possible attack. + +Building with CFI +----------------- + +NOTE: CFI requires the use of link-time optimization. Therefore, when CFI is +selected, LTO will be automatically enabled. + +To build with CFI, the minimum requirement is Clang 6+. If you +are planning to also enable fuzzing, then Clang 11+ is needed (more on this +later). + +Given the use of LTO, a version of AR that supports LLVM IR is required. +The easies way of doing this is by selecting the AR provided by LLVM:: + + AR=llvm-ar-9 CC=clang-9 CXX=lang++-9 /path/to/configure --enable-cfi + +CFI is enabled on every binary produced. + +If desired, an additional flag to increase the verbosity of the output in case +of a CFI violation is offered (``--enable-debug-cfi``). + +Using QEMU built with CFI +------------------------- + +A binary with CFI will work exactly like a standard binary. In case of a CFI +violation, the binary will terminate with an illegal instruction signal. + +Incompatible code with CFI +-------------------------- + +As mentioned above, CFI is entirely compiler-based and therefore relies on +compile-time knowledge of the code. This means that, while generally supported +for most code, some specific use pattern can break CFI compatibility, and +create false-positives. The two main patterns that can cause issues are: + +* Just-in-time compiled code: since such code is created at runtime, the jump + to the buffer containing JIT code will fail. + +* Libraries loaded dynamically, e.g. with dlopen/dlsym, since the library was + not known at compile time. + +Current areas of QEMU that are not entirely compatible with CFI are: + +1. TCG, since the idea of TCG is to pre-compile groups of instructions at + runtime to speed-up interpretation, quite similarly to a JIT compiler + +2. TCI, where the interpreter has to interpret the generic *call* operation + +3. Plugins, since a plugin is implemented as an external library + +4. Modules, since they are implemented as an external library + +5. Directly calling signal handlers from the QEMU source code, since the + signal handler may have been provided by an external library or even plugged + at runtime. + +Disabling CFI for a specific function +------------------------------------- + +If you are working on function that is performing a call using an +incompatible way, as described before, you can selectively disable CFI checks +for such function by using the decorator ``QEMU_DISABLE_CFI`` at function +definition, and add an explanation on why the function is not compatible +with CFI. An example of the use of ``QEMU_DISABLE_CFI`` is provided here:: + + /* + * Disable CFI checks. + * TCG creates binary blobs at runtime, with the transformed code. + * A TB is a blob of binary code, created at runtime and called with an + * indirect function call. Since such function did not exist at compile time, + * the CFI runtime has no way to verify its signature and would fail. + * TCG is not considered a security-sensitive part of QEMU so this does not + * affect the impact of CFI in environment with high security requirements + */ + QEMU_DISABLE_CFI + static inline tcg_target_ulong cpu_tb_exec(CPUState *cpu, TranslationBlock *itb) + +NOTE: CFI needs to be disabled at the **caller** function, (i.e. a compatible +cfi function that calls a non-compatible one), since the check is performed +when the function call is performed. + +CFI and fuzzing +--------------- + +There is generally no advantage of using CFI and fuzzing together, because +they target different environments (production for CFI, debug for fuzzing). + +CFI could be used in conjunction with fuzzing to identify a broader set of +bugs that may not end immediately in a segmentation fault or triggering +an assertion. However, other sanitizers such as address and ub sanitizers +can identify such bugs in a more precise way than CFI. + +There is, however, an interesting use case in using CFI in conjunction with +fuzzing, that is to make sure that CFI is not triggering any false positive +in remote-but-possible parts of the code. + +CFI can be enabled with fuzzing, but with some caveats: +1. Fuzzing relies on the linker performing function wrapping at link-time. +The standard BFD linker does not support function wrapping when LTO is +also enabled. The workaround is to use LLVM's lld linker. +2. Fuzzing also relies on a custom linker script, which is only supported by +lld with version 11+. + +In other words, to compile with fuzzing and CFI, clang 11+ is required, and +lld needs to be used as a linker:: + + AR=llvm-ar-11 CC=clang-11 CXX=lang++-11 /path/to/configure --enable-cfi \ + -enable-fuzzing --extra-ldflags="-fuse-ld=lld" + +and then, compile the fuzzers as usual.
docs/devel/index.rst +3 -2
@@ -15,14 +15,15 @@ Contents: build-system kconfig + testing + fuzzing + control-flow-integrity loads-stores memory migration atomics stable-process - testing qtest - fuzzing decodetree secure-coding-practices tcg
Signature · 1 line
2.29.2
[PULL 07/55] tests/tcg: build tests with -Werror
In reply to Paolo BonziniFrom: Alex Bennée <[email protected]>
Hopefully this will guard against sloppy code getting into our tests.
Message-Id: <[email protected]>
--- tests/tcg/Makefile.target | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
tests/tcg/Makefile.target +1 -1
@@ -94,7 +94,7 @@ ifdef CONFIG_USER_ONLY -include $(SRC_PATH)/tests/tcg/$(TARGET_NAME)/Makefile.target # Add the common build options -CFLAGS+=-Wall -O0 -g -fno-strict-aliasing +CFLAGS+=-Wall -Werror -O0 -g -fno-strict-aliasing ifeq ($(BUILD_STATIC),y) LDFLAGS+=-static endif
Signature · 1 line
2.29.2
[PULL 18/55] check-block: enable iotests with cfi-icall
In reply to Paolo BonziniFrom: Daniele Buono <[email protected]>
cfi-icall is a form of Control-Flow Integrity for indirect function calls implemented by llvm. It is enabled with a -fsanitize flag.
iotests are currently disabled when -fsanitize options is used, with the exception of SafeStack.
This patch implements a generic filtering mechanism to allow iotests with a set of known-to-be-safe -fsanitize option. Then marks SafeStack and the new options used for cfi-icall safe for iotests
Message-Id: <[email protected]>
--- tests/check-block.sh | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-)
tests/check-block.sh +11 -7
@@ -21,14 +21,18 @@ if grep -q "CONFIG_GPROF=y" config-host.mak 2>/dev/null ; then exit 0 fi -# Disable tests with any sanitizer except for SafeStack -CFLAGS=$( grep "CFLAGS.*-fsanitize" config-host.mak 2>/dev/null ) -SANITIZE_FLAGS="" -#Remove all occurrencies of -fsanitize=safe-stack -for i in ${CFLAGS}; do - if [ "${i}" != "-fsanitize=safe-stack" ]; then - SANITIZE_FLAGS="${SANITIZE_FLAGS} ${i}" +# Disable tests with any sanitizer except for specific ones +SANITIZE_FLAGS=$( grep "CFLAGS.*-fsanitize" config-host.mak 2>/dev/null ) +ALLOWED_SANITIZE_FLAGS="safe-stack cfi-icall" +#Remove all occurrencies of allowed Sanitize flags +for j in ${ALLOWED_SANITIZE_FLAGS}; do + TMP_FLAGS=${SANITIZE_FLAGS} + SANITIZE_FLAGS="" + for i in ${TMP_FLAGS}; do + if ! echo ${i} | grep -q "${j}" 2>/dev/null; then + SANITIZE_FLAGS="${SANITIZE_FLAGS} ${i}" fi + done done if echo ${SANITIZE_FLAGS} | grep -q "\-fsanitize" 2>/dev/null; then # Have a sanitize flag that is not allowed, stop
Signature · 1 line
2.29.2
[PULL 11/55] configure: document --without-default-{features, devices}
In reply to Paolo Bonzini--- configure | 4 ++++ 1 file changed, 4 insertions(+)
configure +4 -0
@@ -1719,6 +1719,10 @@ Advanced options (experts only): --efi-aarch64=PATH PATH of efi file to use for aarch64 VMs. --with-suffix=SUFFIX suffix for QEMU data inside datadir/libdir/sysconfdir/docdir [$qemu_suffix] --with-pkgversion=VERS use specified string as sub-version of the package + --without-default-features default all --enable-* options to "disabled" + --without-default-devices do not include any device that is not needed to + start the emulator (only use if you are including + desired devices in default-configs/devices/) --enable-debug enable common debug build options --enable-sanitizers enable default sanitizers --enable-tsan enable thread sanitizer
Signature · 1 line
2.29.2
[PULL 38/55] curl: convert to meson
In reply to Paolo Bonzini--- configure | 31 ++++--------------------------- contrib/elf2dmp/meson.build | 2 +- meson.build | 11 +++++++---- meson_options.txt | 2 ++ 4 files changed, 14 insertions(+), 32 deletions(-)
configure +4 -27
@@ -306,7 +306,7 @@ for opt do done brlapi="auto" -curl="$default_feature" +curl="auto" iconv="auto" curses="auto" docs="auto"
@@ -1215,9 +1215,9 @@ for opt do ;; --enable-iconv) iconv="enabled" ;; - --disable-curl) curl="no" + --disable-curl) curl="disabled" ;; - --enable-curl) curl="yes" + --enable-curl) curl="enabled" ;; --disable-fdt) fdt="disabled" ;;
@@ -3423,25 +3423,6 @@ for drv in $audio_drv_list; do esac done -########################################## -# curl probe -if test "$curl" != "no" ; then - cat > $TMPC << EOF -#include <curl/curl.h> -int main(void) { curl_easy_init(); curl_multi_setopt(0, 0, 0); return 0; } -EOF - curl_cflags=$($pkg_config libcurl --cflags 2>/dev/null) - curl_libs=$($pkg_config libcurl --libs 2>/dev/null) - if compile_prog "$curl_cflags" "$curl_libs" ; then - curl=yes - else - if test "$curl" = "yes" ; then - feature_not_found "curl" "Install libcurl devel" - fi - curl=no - fi -fi # test "$curl" - ########################################## # glib support probe
@@ -6102,11 +6083,6 @@ fi if test "$bswap_h" = "yes" ; then echo "CONFIG_MACHINE_BSWAP_H=y" >> $config_host_mak fi -if test "$curl" = "yes" ; then - echo "CONFIG_CURL=y" >> $config_host_mak - echo "CURL_CFLAGS=$curl_cflags" >> $config_host_mak - echo "CURL_LIBS=$curl_libs" >> $config_host_mak -fi if test "$gtk" = "yes" ; then echo "CONFIG_GTK=y" >> $config_host_mak echo "GTK_CFLAGS=$gtk_cflags" >> $config_host_mak
@@ -6941,6 +6917,7 @@ NINJA=$ninja $meson setup \ -Dvnc=$vnc -Dvnc_sasl=$vnc_sasl -Dvnc_jpeg=$vnc_jpeg -Dvnc_png=$vnc_png \ -Dgettext=$gettext -Dxkbcommon=$xkbcommon -Du2f=$u2f -Dvirtiofsd=$virtiofsd \ -Dcapstone=$capstone -Dslirp=$slirp -Dfdt=$fdt -Dbrlapi=$brlapi \ + -Dcurl=$curl \ -Diconv=$iconv -Dcurses=$curses -Dlibudev=$libudev\ -Ddocs=$docs -Dsphinx_build=$sphinx_build -Dinstall_blobs=$blobs \ -Dvhost_user_blk_server=$vhost_user_blk_server \
contrib/elf2dmp/meson.build +1 -1
@@ -1,4 +1,4 @@ -if 'CONFIG_CURL' in config_host +if curl.found() executable('elf2dmp', files('main.c', 'addrspace.c', 'download.c', 'pdb.c', 'qemu_elf.c'), dependencies: [glib, curl], install: true)
meson.build +7 -4
@@ -392,9 +392,11 @@ if 'CONFIG_VIRGL' in config_host link_args: config_host['VIRGL_LIBS'].split()) endif curl = not_found -if 'CONFIG_CURL' in config_host - curl = declare_dependency(compile_args: config_host['CURL_CFLAGS'].split(), - link_args: config_host['CURL_LIBS'].split()) +if not get_option('curl').auto() or have_block + curl = dependency('libcurl', version: '>=7.29.0', + method: 'pkg-config', + required: get_option('curl'), + static: enable_static) endif libudev = not_found if targetos == 'linux' and (have_system or have_tools)
@@ -872,6 +874,7 @@ config_host_data.set('CONFIG_COCOA', cocoa.found()) config_host_data.set('CONFIG_LIBUDEV', libudev.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_CURL', curl.found()) config_host_data.set('CONFIG_CURSES', curses.found()) config_host_data.set('CONFIG_SDL', sdl.found()) config_host_data.set('CONFIG_SDL_IMAGE', sdl_image.found())
@@ -2161,7 +2164,7 @@ summary_info += {'iconv support': iconv.found()} summary_info += {'curses support': curses.found()} # TODO: add back version summary_info += {'virgl support': config_host.has_key('CONFIG_VIRGL')} -summary_info += {'curl support': config_host.has_key('CONFIG_CURL')} +summary_info += {'curl support': curl.found()} summary_info += {'mingw32 support': targetos == 'windows'} summary_info += {'Audio drivers': config_host['CONFIG_AUDIO_DRIVERS']} summary_info += {'Block whitelist (rw)': config_host['CONFIG_BDRV_RW_WHITELIST']}
meson_options.txt +2 -0
@@ -44,6 +44,8 @@ option('brlapi', type : 'feature', value : 'auto', description: 'brlapi character device driver') option('cocoa', type : 'feature', value : 'auto', description: 'Cocoa user interface (macOS only)') +option('curl', type : 'feature', value : 'auto', + description: 'CURL block device driver') option('mpath', type : 'feature', value : 'auto', description: 'Multipath persistent reservation passthrough') option('iconv', type : 'feature', value : 'auto',
Signature · 1 line
2.29.2
[PULL 10/55] tests: update for rename of CentOS8 PowerTools repo
In reply to Paolo BonziniFrom: Daniel P. Berrangé <[email protected]>
This was intentionally renamed recently to be all lowercase:
https://bugs.centos.org/view.php?id=17920
https://wiki.centos.org/Manuals/ReleaseNotes/CentOS8.2011#Yum_repo_file_and_repoid_changes
Message-Id: <[email protected]>
--- tests/docker/dockerfiles/centos8.docker | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
tests/docker/dockerfiles/centos8.docker +3 -2
@@ -1,4 +1,4 @@ -FROM centos:8.1.1911 +FROM centos:8.3.2011 RUN dnf -y update ENV PACKAGES \
@@ -6,6 +6,7 @@ ENV PACKAGES \ bzip2 \ bzip2-devel \ dbus-daemon \ + diffutils \ gcc \ gcc-c++ \ genisoimage \
@@ -31,6 +32,6 @@ ENV PACKAGES \ zlib-devel RUN dnf install -y dnf-plugins-core && \ - dnf config-manager --set-enabled PowerTools && \ + dnf config-manager --set-enabled powertools && \ dnf install -y $PACKAGES RUN rpm -q $PACKAGES | sort > /packages.txt
Signature · 1 line
2.29.2
[PULL 29/55] meson: use pkg-config method for libudev
In reply to Paolo Bonzini--- meson.build | 1 + 1 file changed, 1 insertion(+)
meson.build +1 -0
@@ -399,6 +399,7 @@ endif libudev = not_found if targetos == 'linux' and (have_system or have_tools) libudev = dependency('libudev', + method: 'pkg-config', required: get_option('libudev'), static: enable_static) endif
Signature · 1 line
2.29.2
[PULL 09/55] tests/docker: Remove the remainders of debian9 containers from the Makefile
In reply to Paolo BonziniFrom: Thomas Huth <[email protected]>
The Debian 9 containers have been removed a while ago, so we can delete the corresponding entries in the Makefile, too.
Message-Id: <[email protected]>
--- tests/docker/Makefile.include | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-)
tests/docker/Makefile.include +1 -5
@@ -11,8 +11,7 @@ HOST_ARCH = $(if $(ARCH),$(ARCH),$(shell uname -m)) DOCKER_SUFFIX := .docker DOCKER_FILES_DIR := $(SRC_PATH)/tests/docker/dockerfiles # we don't run tests on intermediate images (used as base by another image) -DOCKER_PARTIAL_IMAGES := debian9 debian10 debian11 -DOCKER_PARTIAL_IMAGES += debian9-mxe debian-bootstrap +DOCKER_PARTIAL_IMAGES := debian10 debian11 debian-bootstrap DOCKER_IMAGES := $(sort $(notdir $(basename $(wildcard $(DOCKER_FILES_DIR)/*.docker)))) DOCKER_TARGETS := $(patsubst %,docker-image-%,$(DOCKER_IMAGES)) # Use a global constant ccache directory to speed up repetitive builds
@@ -96,7 +95,6 @@ docker-binfmt-image-debian-%: $(DOCKER_FILES_DIR)/debian-bootstrap.docker endif # Enforce dependencies for composite images -docker-image-debian9-mxe: docker-image-debian9 ifeq ($(HOST_ARCH),x86_64) docker-image-debian-amd64: docker-image-debian10 DOCKER_PARTIAL_IMAGES += debian-amd64-cross
@@ -104,8 +102,6 @@ else docker-image-debian-amd64-cross: docker-image-debian10 DOCKER_PARTIAL_IMAGES += debian-amd64 endif -docker-image-debian-win32-cross: docker-image-debian9-mxe -docker-image-debian-win64-cross: docker-image-debian9-mxe # For non-x86 hosts not all cross-compilers have been packaged ifneq ($(HOST_ARCH),x86_64)
Signature · 1 line
2.29.2
[PULL 33/55] configure: remove variable bogus_os
In reply to Paolo BonziniThe condition can be tested also from $targetos, clean up.
--- configure | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
configure +1 -3
@@ -466,7 +466,6 @@ gettext="auto" fuse="auto" fuse_lseek="auto" -bogus_os="no" malloc_trim="auto" # parse CC options second
@@ -619,7 +618,6 @@ else # might be going to just print the --help text, or it might # be the result of a missing compiler. targetos='bogus' - bogus_os='yes' fi # Some host OSes need non-standard checks for which CPU to use.
@@ -2014,7 +2012,7 @@ if test -z "$werror" ; then fi fi -if test "$bogus_os" = "yes"; then +if test "$targetos" = "bogus"; then # Now that we know that we're not printing the help and that # the compiler works (so the results of the check_defines we used # to identify the OS are reliable), if we didn't recognize the
Signature · 1 line
2.29.2
[PULL 31/55] meson: cleanup Kconfig.host handling
In reply to Paolo BonziniBuild the array of command line arguments coming from config_host once for all targets. Add all accelerators to accel/Kconfig so that the command line arguments for accelerators can be computed easily in the existing "foreach sym: accelerators" loop.
--- accel/Kconfig | 9 +++++++++ docs/devel/kconfig.rst | 19 +++++++++---------- meson.build | 43 +++++++++++++++++------------------------- 3 files changed, 35 insertions(+), 36 deletions(-)
accel/Kconfig +9 -0
@@ -1,3 +1,12 @@ +config WHPX + bool + +config HAX + bool + +config HVF + bool + config TCG bool
docs/devel/kconfig.rst +9 -10
@@ -288,21 +288,20 @@ they will include all these symbols and some help text on what they do. ---------------- In some special cases, a configurable element depends on host features -that are detected by QEMU's configure script; for example some devices -depend on the availability of KVM or on the presence of a library on -the host. +that are detected by QEMU's configure or ``meson.build`` scripts; for +example some devices depend on the availability of KVM or on the presence +of a library on the host. These symbols should be listed in ``Kconfig.host`` like this:: - config KVM + config TPM bool -and also listed as follows in the top-level Makefile's ``MINIKCONF_ARGS`` +and also listed as follows in the top-level meson.build's host_kconfig variable:: - MINIKCONF_ARGS = \ - $@ $*/config-devices.mak.d $< $(MINIKCONF_INPUTS) \ - CONFIG_KVM=$(CONFIG_KVM) \ - CONFIG_SPICE=$(CONFIG_SPICE) \ - CONFIG_TPM=$(CONFIG_TPM) \ + host_kconfig = \ + ('CONFIG_TPM' in config_host ? ['CONFIG_TPM=y'] : []) + \ + ('CONFIG_SPICE' in config_host ? ['CONFIG_SPICE=y'] : []) + \ + ('CONFIG_IVSHMEM' in config_host ? ['CONFIG_IVSHMEM=y'] : []) + \ ...
meson.build +17 -26
75 lines not on this page · raw message
Signature · 1 line
2.29.2
[PULL 17/55] cfi: Initial support for cfi-icall in QEMU
In reply to Paolo BonziniFrom: Daniele Buono <[email protected]>
LLVM/Clang, supports runtime checks for forward-edge Control-Flow Integrity (CFI).
CFI on indirect function calls (cfi-icall) ensures that, in indirect function calls, the function called is of the right signature for the pointer type defined at compile time.
For this check to work, the code must always respect the function signature when using function pointer, the function must be defined at compile time, and be compiled with link-time optimization.
This rules out, for example, shared libraries that are dynamically loaded (given that functions are not known at compile time), and code that is dynamically generated at run-time.
This patch:
1) Introduces the CONFIG_CFI flag to support cfi in QEMU
2) Introduces a decorator to allow the definition of "sensitive" functions, where a non-instrumented function may be called at runtime through a pointer. The decorator will take care of disabling cfi-icall checks on such functions, when cfi is enabled.
3) Marks functions currently in QEMU that exhibit such behavior, in particular:
- The function in TCG that calls pre-compiled TBs
- The function in TCI that interprets instructions
- Functions in the plugin infrastructures that jump to callbacks
- Functions in util that directly call a signal handler
Message-Id: <[email protected]>
--- accel/tcg/cpu-exec.c | 11 +++++++++++ include/qemu/compiler.h | 12 ++++++++++++ plugins/core.c | 37 +++++++++++++++++++++++++++++++++++++ plugins/loader.c | 7 +++++++ tcg/tci.c | 7 +++++++ util/main-loop.c | 11 +++++++++++ util/oslib-posix.c | 11 +++++++++++ 7 files changed, 96 insertions(+)
accel/tcg/cpu-exec.c +11 -0
@@ -26,6 +26,7 @@#include "exec/exec-all.h" #include "tcg/tcg.h" #include "qemu/atomic.h" +#include "qemu/compiler.h" #include "sysemu/qtest.h" #include "qemu/timer.h" #include "qemu/rcu.h"
@@ -144,6 +145,16 @@ static void init_delay_params(SyncClocks *sc, const CPUState *cpu)#endif /* CONFIG USER ONLY */ /* Execute a TB, and fix up the CPU state afterwards if necessary */ +/* +* Disable CFI checks. +* TCG creates binary blobs at runtime, with the transformed code. +* A TB is a blob of binary code, created at runtime and called with an +* indirect function call. Since such function did not exist at compile time, +* the CFI runtime has no way to verify its signature and would fail. +* TCG is not considered a security-sensitive part of QEMU so this does not +* affect the impact of CFI in environment with high security requirements +*/ +QEMU_DISABLE_CFI static inline tcg_target_ulong cpu_tb_exec(CPUState *cpu, TranslationBlock *itb) {CPUArchState *env = cpu->env_ptr;
include/qemu/compiler.h +12 -0
@@ -222,4 +222,16 @@ extern void QEMU_NORETURN QEMU_ERROR("code path is reachable")#define qemu_build_not_reached () g_assert_not_reached()#endif +#ifdef CONFIG_CFI +/* +* If CFI is enabled, use an attribute to disable cfi-icall on the following +* function +*/ +#define QEMU_DISABLE_CFI __attribute__((no_sanitize("cfi-icall"))) +#else +/* If CFI is not enabled, use an empty define to not change the behavior */ +#define QEMU_DISABLE_CFI +#endif + +#endif /* COMPILER_H */
plugins/core.c +37 -0
@@ -31,6 +31,7 @@#include "tcg/tcg-op.h" #include "trace/mem-internal.h" /* mem_info macros */ #include "plugin.h" +#include "qemu/compiler.h" struct qemu_plugin_cb {struct qemu_plugin_ctx *ctx;
@@ -90,6 +91,12 @@ void plugin_unregister_cb__locked(struct qemu_plugin_ctx *ctx, } } +/* +* Disable CFI checks. +* The callback function has been loaded from an external library so we do not +* have type information +*/ +QEMU_DISABLE_CFI static void plugin_vcpu_cb__simple(CPUState *cpu, enum qemu_plugin_event ev) {struct qemu_plugin_cb *cb, *next;
@@ -111,6 +118,12 @@ static void plugin_vcpu_cb__simple(CPUState *cpu, enum qemu_plugin_event ev) } } +/* +* Disable CFI checks. +* The callback function has been loaded from an external library so we do not +* have type information +*/ +QEMU_DISABLE_CFI static void plugin_cb__simple(enum qemu_plugin_event ev) {struct qemu_plugin_cb *cb, *next;
@@ -128,6 +141,12 @@ static void plugin_cb__simple(enum qemu_plugin_event ev) } } +/* +* Disable CFI checks. +* The callback function has been loaded from an external library so we do not +* have type information +*/ +QEMU_DISABLE_CFI static void plugin_cb__udata(enum qemu_plugin_event ev) {struct qemu_plugin_cb *cb, *next;
@@ -325,6 +344,12 @@ void plugin_register_vcpu_mem_cb(GArray **arr, dyn_cb->f.generic = cb; } +/* +* Disable CFI checks. +* The callback function has been loaded from an external library so we do not +* have type information +*/ +QEMU_DISABLE_CFI void qemu_plugin_tb_trans_cb(CPUState *cpu, struct qemu_plugin_tb *tb) {struct qemu_plugin_cb *cb, *next;
@@ -339,6 +364,12 @@ void qemu_plugin_tb_trans_cb(CPUState *cpu, struct qemu_plugin_tb *tb) } } +/* +* Disable CFI checks. +* The callback function has been loaded from an external library so we do not +* have type information +*/ +QEMU_DISABLE_CFI void qemu_plugin_vcpu_syscall(CPUState *cpu, int64_t num, uint64_t a1, uint64_t a2, uint64_t a3, uint64_t a4, uint64_t a5,
@@ -358,6 +389,12 @@ qemu_plugin_vcpu_syscall(CPUState *cpu, int64_t num, uint64_t a1, uint64_t a2, } } +/* +* Disable CFI checks. +* The callback function has been loaded from an external library so we do not +* have type information +*/ +QEMU_DISABLE_CFI void qemu_plugin_vcpu_syscall_ret(CPUState *cpu, int64_t num, int64_t ret) {struct qemu_plugin_cb *cb, *next;
plugins/loader.c +7 -0
@@ -32,6 +32,7 @@#ifndef CONFIG_USER_ONLY #include "hw/boards.h" #endif +#include "qemu/compiler.h" #include "plugin.h"
@@ -150,6 +151,12 @@ static uint64_t xorshift64star(uint64_t x)return x *UINT64_C (2685821657736338717 ); } +/* +* Disable CFI checks. +* The install and version functions have been loaded from an external library +* so we do not have type information +*/ +QEMU_DISABLE_CFI static int plugin_load(struct qemu_plugin_desc *desc, const qemu_info_t *info, Error **errp) {qemu_plugin_install_func_t install;
tcg/tci.c +7 -0
@@ -31,6 +31,7 @@#include "tcg/tcg.h" /* MAX_OPC_PARAM_IARGS */ #include "exec/cpu_ldst.h" #include "tcg/tcg-op.h" +#include "qemu/compiler.h" /* Marker for missing code. */ #define TODO () \
@@ -475,6 +476,12 @@ static bool tci_compare64(uint64_t u0, uint64_t u1, TCGCond condition)#endif /* Interpret pseudo code in tb. */ +/* +* Disable CFI checks. +* One possible operation in the pseudo code is a call to binary code. +* Therefore, disable CFI checks in the interpreter function +*/ +QEMU_DISABLE_CFI uintptr_t tcg_qemu_tb_exec(CPUArchState *env, uint8_t *tb_ptr) {tcg_target_ulong regs[TCG_TARGET_NB_REGS ];
util/main-loop.c +11 -0
@@ -33,6 +33,7 @@#include "block/aio.h" #include "qemu/error-report.h" #include "qemu/queue.h" +#include "qemu/compiler.h" #ifndef _WIN32#include <sys/wait.h>
@@ -44,6 +45,16 @@* use signalfd to listen for them. We rely on whatever the current signal * handler is to dispatch the signals when we receive them. */ +/* +* Disable CFI checks. +* We are going to call a signal hander directly. Such handler may or may not +* have been defined in our binary, so there's no guarantee that the pointer +* used to set the handler is a cfi-valid pointer. Since the handlers are +* stored in kernel memory, changing the handler to an attacker-defined +* function requires being able to call a sigaction() syscall, +* which is not as easy as overwriting a pointer in memory. +*/ +QEMU_DISABLE_CFI static void sigfd_handler(void *opaque) {int fd = (intptr_t )opaque;
util/oslib-posix.c +11 -0
@@ -39,6 +39,7 @@#include "qemu/thread.h" #include <libgen.h> #include "qemu/cutils.h" +#include "qemu/compiler.h" #ifdef CONFIG_LINUX #include <sys/syscall.h>
@@ -773,6 +774,16 @@ void qemu_free_stack(void *stack, size_t sz)munmap (stack, sz); } +/* +* Disable CFI checks. +* We are going to call a signal hander directly. Such handler may or may not +* have been defined in our binary, so there's no guarantee that the pointer +* used to set the handler is a cfi-valid pointer. Since the handlers are +* stored in kernel memory, changing the handler to an attacker-defined +* function requires being able to call a sigaction() syscall, +* which is not as easy as overwriting a pointer in memory. +*/ +QEMU_DISABLE_CFI void sigaction_invoke(struct sigaction *action,struct qemu_signalfd_siginfo *info) {
Signature · 1 line
2.29.2
[PULL 14/55] qom: Assert that objects being destroyed have no parent
In reply to Paolo BonziniFrom: Eduardo Habkost <[email protected]>
QOM reference counting bugs are often hard to detect, but there's one kind of bug that's easier: if we are freeing an object but is still attached to a parent, it means the reference count is wrong (because the parent always hold a reference to their children).
Add an assertion to make sure we detect those cases.
Message-Id: <[email protected]>
--- qom/object.c | 1 + 1 file changed, 1 insertion(+)
qom/object.c +1 -0
@@ -685,6 +685,7 @@ static void object_finalize(void *data)object_deinit (obj, ti);g_assert (obj->ref ==0 ); +g_assert (obj->parent ==NULL );if (obj->free) { obj->free (obj); }
Signature · 1 line
2.29.2
[PULL 30/55] meson: use dependency to gate block modules
In reply to Paolo BonziniThis allows converting the dependencies to meson options one by one.
--- block/meson.build | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-)
block/meson.build +10 -10
@@ -70,14 +70,14 @@ block_modules = {} modsrc = [] foreach m : [ - ['CONFIG_CURL', 'curl', [curl, glib], 'curl.c'], - ['CONFIG_GLUSTERFS', 'gluster', glusterfs, 'gluster.c'], - ['CONFIG_LIBISCSI', 'iscsi', libiscsi, 'iscsi.c'], - ['CONFIG_LIBNFS', 'nfs', libnfs, 'nfs.c'], - ['CONFIG_LIBSSH', 'ssh', libssh, 'ssh.c'], - ['CONFIG_RBD', 'rbd', rbd, 'rbd.c'], + [curl, 'curl', [curl, glib], 'curl.c'], + [glusterfs, 'gluster', glusterfs, 'gluster.c'], + [libiscsi, 'iscsi', libiscsi, 'iscsi.c'], + [libnfs, 'nfs', libnfs, 'nfs.c'], + [libssh, 'ssh', libssh, 'ssh.c'], + [rbd, 'rbd', rbd, 'rbd.c'], ] - if config_host.has_key(m[0]) + if m[0].found() if enable_modules modsrc += files(m[3]) endif
@@ -90,10 +90,10 @@ endforeach # those are not exactly regular block modules, so treat them apart if 'CONFIG_DMG' in config_host foreach m : [ - ['CONFIG_LZFSE', 'dmg-lzfse', liblzfse, 'dmg-lzfse.c'], - ['CONFIG_BZIP2', 'dmg-bz2', [glib, libbzip2], 'dmg-bz2.c'] + [liblzfse, 'dmg-lzfse', liblzfse, 'dmg-lzfse.c'], + [libbzip2, 'dmg-bz2', [glib, libbzip2], 'dmg-bz2.c'] ] - if config_host.has_key(m[0]) + if m[0].found() module_ss = ss.source_set() module_ss.add(when: m[2], if_true: files(m[3])) block_modules += {m[1] : module_ss}
Signature · 1 line
2.29.2
[PULL 19/55] configure,meson: support Control-Flow Integrity
In reply to Paolo BonziniFrom: Daniele Buono <[email protected]>
This patch adds a flag to enable/disable control flow integrity checks on indirect function calls.
This feature only allows indirect function calls at runtime to functions with compatible signatures.
This feature is only provided by LLVM/Clang, and depends on link-time optimization which is currently supported only with LLVM/Clang >= 6.0
We also add an option to enable a debugging version of cfi, with verbose output in case of a CFI violation.
CFI on indirect function calls does not support calls to functions in shared libraries (since they were not known at compile time), and such calls are forbidden. QEMU relies on dlopen/dlsym when using modules, so we make modules incompatible with CFI.
All the checks are performed in meson.build. configure is only used to forward the flags to meson
Message-Id: <[email protected]>
--- configure | 22 ++++++++++++++++++++-- meson.build | 44 ++++++++++++++++++++++++++++++++++++++++++++ meson_options.txt | 4 ++++ 3 files changed, 68 insertions(+), 2 deletions(-)
configure +20 -2
@@ -411,6 +411,8 @@ coroutine="" coroutine_pool="$default_feature" debug_stack_usage="no" crypto_afalg="no" +cfi="false" +cfi_debug="false" seccomp="$default_feature" glusterfs="$default_feature" glusterfs_xlator_opt="no"
@@ -1195,6 +1197,16 @@ for opt do ;; --disable-safe-stack) safe_stack="no" ;; + --enable-cfi) + cfi="true"; + lto="true"; + ;; + --disable-cfi) cfi="false" + ;; + --enable-cfi-debug) cfi_debug="true" + ;; + --disable-cfi-debug) cfi_debug="false" + ;; --disable-curses) curses="disabled" ;; --enable-curses) curses="enabled"
@@ -1788,7 +1800,13 @@ disabled with --disable-FEATURE, default is enabled if available sparse sparse checker safe-stack SafeStack Stack Smash Protection. Depends on clang/llvm >= 3.7 and requires coroutine backend ucontext. - + cfi Enable Control-Flow Integrity for indirect function calls. + In case of a cfi violation, QEMU is terminated with SIGILL + Depends on lto and is incompatible with modules + Automatically enables Link-Time Optimization (lto) + cfi-debug In case of a cfi violation, a message containing the line that + triggered the error is written to stderr. After the error, + QEMU is still terminated with SIGILL gnutls GNUTLS cryptography support nettle nettle cryptography support gcrypt libgcrypt cryptography support
@@ -6970,7 +6988,7 @@ NINJA=$ninja $meson setup \ -Db_pie=$(if test "$pie" = yes; then echo true; else echo false; fi) \ ${staticpic:+-Db_staticpic=$staticpic} \ -Db_coverage=$(if test "$gcov" = yes; then echo true; else echo false; fi) \ - -Db_lto=$lto \ + -Db_lto=$lto -Dcfi=$cfi -Dcfi_debug=$cfi_debug \ -Dmalloc=$malloc -Dmalloc_trim=$malloc_trim -Dsparse=$sparse \ -Dkvm=$kvm -Dhax=$hax -Dwhpx=$whpx -Dhvf=$hvf \ -Dxen=$xen -Dxen_pci_passthrough=$xen_pci_passthrough -Dtcg=$tcg \
meson.build +44 -0
68 lines not on this page · raw message
meson_options.txt +4 -0
@@ -35,6 +35,10 @@ option('xen_pci_passthrough', type: 'feature', value: 'auto', description: 'Xen PCI passthrough support') option('tcg', type: 'feature', value: 'auto', description: 'TCG support') +option('cfi', type: 'boolean', value: 'false', + description: 'Control-Flow Integrity (CFI)') +option('cfi_debug', type: 'boolean', value: 'false', + description: 'Verbose errors in case of CFI violation') option('cocoa', type : 'feature', value : 'auto', description: 'Cocoa user interface (macOS only)')
Signature · 1 line
2.29.2
[PULL 22/55] remove TCG includes from common code
In reply to Paolo BonziniEnable removing tcg/$tcg_arch from the include path when TCG is disabled. Move translate-all.h to include/exec, since stubs exist for the functions defined therein.
---
accel/stubs/tcg-stub.c | 1 -
accel/tcg/cputlb.c | 2 +-
accel/tcg/translate-all.c | 2 +-
accel/tcg/user-exec.c | 2 +-
cpu.c | 2 +-
hw/i386/kvmvapic.c | 1 -
{accel/tcg => include/exec}/translate-all.h | 0
monitor/misc.c | 1 -
softmmu/physmem.c | 3 +--
9 files changed, 5 insertions(+), 9 deletions(-)
rename {accel/tcg => include/exec}/translate-all.h (100%)accel/stubs/tcg-stub.c +0 -1
@@ -12,7 +12,6 @@#include "qemu/osdep.h" #include "cpu.h" -#include "tcg/tcg.h" #include "exec/exec-all.h" void tb_flush (CPUState *cpu)
accel/tcg/cputlb.c +1 -1
@@ -33,7 +33,7 @@#include "exec/helper-proto.h" #include "qemu/atomic.h" #include "qemu/atomic128.h" -#include "translate-all.h" +#include "exec/translate-all.h" #include "trace/trace-root.h" #include "trace/mem.h" #ifdef CONFIG_PLUGIN
accel/tcg/translate-all.c +1 -1
@@ -49,7 +49,7 @@#include "exec/cputlb.h" #include "exec/tb-hash.h" -#include "translate-all.h" +#include "exec/translate-all.h" #include "qemu/bitmap.h" #include "qemu/error-report.h" #include "qemu/qemu-print.h"
accel/tcg/user-exec.c +1 -1
@@ -23,7 +23,7 @@#include "tcg/tcg.h" #include "qemu/bitops.h" #include "exec/cpu_ldst.h" -#include "translate-all.h" +#include "exec/translate-all.h" #include "exec/helper-proto.h" #include "qemu/atomic128.h" #include "trace/trace-root.h"
cpu.c +1 -1
@@ -34,7 +34,7 @@#include "sysemu/tcg.h" #include "sysemu/kvm.h" #include "sysemu/replay.h" -#include "translate-all.h" +#include "exec/translate-all.h" #include "exec/log.h" uintptr_t qemu_host_page_size;
hw/i386/kvmvapic.c +0 -1
@@ -21,7 +21,6 @@#include "hw/sysbus.h" #include "hw/boards.h" #include "migration/vmstate.h" -#include "tcg/tcg.h" #include "qom/object.h" #define VAPIC_IO_PORT 0x7e
include/exec/translate-all.h renamed from accel/tcg/translate-all.h +0 -0
monitor/misc.c +0 -1
@@ -77,7 +77,6 @@#include "qapi/qmp-event.h" #include "sysemu/cpus.h" #include "qemu/cutils.h" -#include "tcg/tcg.h" #if defined(TARGET_S390X )#include "hw/s390x/storage-keys.h"
softmmu/physmem.c +1 -2
@@ -25,7 +25,6 @@#include "cpu.h" #include "exec/exec-all.h" #include "exec/target_page.h" -#include "tcg/tcg.h" #include "hw/qdev-core.h" #include "hw/qdev-properties.h" #include "hw/boards.h"
@@ -53,7 +52,7 @@#include "qemu/rcu_queue.h" #include "qemu/main-loop.h" -#include "translate-all.h" +#include "exec/translate-all.h" #include "sysemu/replay.h" #include "exec/memory-internal.h"
Signature · 1 line
2.29.2
[PULL 41/55] libiscsi: convert to meson
In reply to Paolo Bonzini--- block/meson.build | 2 +- configure | 29 ++++------------------------- contrib/vhost-user-scsi/meson.build | 2 +- meson.build | 10 ++++++---- meson_options.txt | 2 ++ 5 files changed, 14 insertions(+), 31 deletions(-)
block/meson.build +1 -1
@@ -59,7 +59,7 @@ block_ss.add(when: 'CONFIG_QED', if_true: files( block_ss.add(when: [libxml2, 'CONFIG_PARALLELS'], if_true: files('parallels.c')) block_ss.add(when: 'CONFIG_WIN32', if_true: files('file-win32.c', 'win32-aio.c')) block_ss.add(when: 'CONFIG_POSIX', if_true: [files('file-posix.c'), coref, iokit]) -block_ss.add(when: 'CONFIG_LIBISCSI', if_true: files('iscsi-opts.c')) +block_ss.add(when: libiscsi, if_true: files('iscsi-opts.c')) block_ss.add(when: 'CONFIG_LINUX', if_true: files('nvme.c')) block_ss.add(when: 'CONFIG_REPLICATION', if_true: files('replication.c')) block_ss.add(when: 'CONFIG_SHEEPDOG', if_true: files('sheepdog.c'))
configure +4 -25
@@ -405,7 +405,7 @@ guest_agent_msi="$default_feature" vss_win32_sdk="$default_feature" win_sdk="no" want_tools="$default_feature" -libiscsi="$default_feature" +libiscsi="auto" libnfs="$default_feature" coroutine="" coroutine_pool="$default_feature"
@@ -1138,9 +1138,9 @@ for opt do ;; --enable-spice) spice="yes" ;; - --disable-libiscsi) libiscsi="no" + --disable-libiscsi) libiscsi="disabled" ;; - --enable-libiscsi) libiscsi="yes" + --enable-libiscsi) libiscsi="enabled" ;; --disable-libnfs) libnfs="no" ;;
@@ -4313,21 +4313,6 @@ if compile_prog "" "" ; then bswap_h=yes fi -########################################## -# Do we have libiscsi >= 1.9.0 -if test "$libiscsi" != "no" ; then - if $pkg_config --atleast-version=1.9.0 libiscsi; then - libiscsi="yes" - libiscsi_cflags=$($pkg_config --cflags libiscsi) - libiscsi_libs=$($pkg_config --libs libiscsi) - else - if test "$libiscsi" = "yes" ; then - feature_not_found "libiscsi" "Install libiscsi >= 1.9.0" - fi - libiscsi="no" - fi -fi - ########################################## # Do we need librt # uClibc provides 2 versions of clock_gettime(), one with realtime
@@ -6229,12 +6214,6 @@ if test "$zstd" = "yes" ; then echo "ZSTD_LIBS=$zstd_libs" >> $config_host_mak fi -if test "$libiscsi" = "yes" ; then - echo "CONFIG_LIBISCSI=y" >> $config_host_mak - echo "LIBISCSI_CFLAGS=$libiscsi_cflags" >> $config_host_mak - echo "LIBISCSI_LIBS=$libiscsi_libs" >> $config_host_mak -fi - if test "$libnfs" = "yes" ; then echo "CONFIG_LIBNFS=y" >> $config_host_mak echo "LIBNFS_LIBS=$libnfs_libs" >> $config_host_mak
@@ -6800,7 +6779,7 @@ NINJA=$ninja $meson setup \ -Dvnc=$vnc -Dvnc_sasl=$vnc_sasl -Dvnc_jpeg=$vnc_jpeg -Dvnc_png=$vnc_png \ -Dgettext=$gettext -Dxkbcommon=$xkbcommon -Du2f=$u2f -Dvirtiofsd=$virtiofsd \ -Dcapstone=$capstone -Dslirp=$slirp -Dfdt=$fdt -Dbrlapi=$brlapi \ - -Dcurl=$curl -Dglusterfs=$glusterfs -Dbzip2=$bzip2 \ + -Dcurl=$curl -Dglusterfs=$glusterfs -Dbzip2=$bzip2 -Dlibiscsi=$libiscsi \ -Diconv=$iconv -Dcurses=$curses -Dlibudev=$libudev\ -Ddocs=$docs -Dsphinx_build=$sphinx_build -Dinstall_blobs=$blobs \ -Dvhost_user_blk_server=$vhost_user_blk_server \
contrib/vhost-user-scsi/meson.build +1 -1
@@ -1,4 +1,4 @@ -if 'CONFIG_LIBISCSI' in config_host +if libiscsi.found() executable('vhost-user-scsi', files('vhost-user-scsi.c'), dependencies: [qemuutil, libiscsi, vhost_user], build_by_default: targetos == 'linux',
meson.build +6 -4
@@ -372,9 +372,10 @@ if 'CONFIG_PLUGIN' in config_host libdl = cc.find_library('dl', required: true) endif libiscsi = not_found -if 'CONFIG_LIBISCSI' in config_host - libiscsi = declare_dependency(compile_args: config_host['LIBISCSI_CFLAGS'].split(), - link_args: config_host['LIBISCSI_LIBS'].split()) +if not get_option('libiscsi').auto() or have_block + libiscsi = dependency('libiscsi', version: '>=1.9.0', + required: get_option('libiscsi'), + method: 'pkg-config', static: enable_static) endif zstd = not_found if 'CONFIG_ZSTD' in config_host
@@ -928,6 +929,7 @@ if glusterfs.found() config_host_data.set('CONFIG_GLUSTERFS_FTRUNCATE_HAS_STAT', glusterfs_ftruncate_has_stat) config_host_data.set('CONFIG_GLUSTERFS_IOCB_HAS_STAT', glusterfs_iocb_has_stat) endif +config_host_data.set('CONFIG_LIBISCSI', libiscsi.found()) config_host_data.set('CONFIG_SDL', sdl.found()) config_host_data.set('CONFIG_SDL_IMAGE', sdl_image.found()) config_host_data.set('CONFIG_VHOST_USER_BLK_SERVER', have_vhost_user_blk_server)
@@ -2286,7 +2288,7 @@ summary_info += {'libusb': config_host.has_key('CONFIG_USB_LIBUSB')} summary_info += {'usb net redir': config_host.has_key('CONFIG_USB_REDIR')} summary_info += {'OpenGL support': config_host.has_key('CONFIG_OPENGL')} summary_info += {'OpenGL dmabufs': config_host.has_key('CONFIG_OPENGL_DMABUF')} -summary_info += {'libiscsi support': config_host.has_key('CONFIG_LIBISCSI')} +summary_info += {'libiscsi support': libiscsi.found()} summary_info += {'libnfs support': config_host.has_key('CONFIG_LIBNFS')} summary_info += {'build guest agent': config_host.has_key('CONFIG_GUEST_AGENT')} if targetos == 'windows'
meson_options.txt +2 -0
@@ -50,6 +50,8 @@ option('curl', type : 'feature', value : 'auto', description: 'CURL block device driver') option('glusterfs', type : 'feature', value : 'auto', description: 'Glusterfs block device driver') +option('libiscsi', type : 'feature', value : 'auto', + description: 'libiscsi userspace initiator') option('mpath', type : 'feature', value : 'auto', description: 'Multipath persistent reservation passthrough') option('iconv', type : 'feature', value : 'auto',
Signature · 1 line
2.29.2
[PULL 15/55] target/i386: Check privilege level for protected mode 'int N' task gate
In reply to Paolo BonziniFrom: Peter Maydell <[email protected]>
When the 'int N' instruction is executed in protected mode, the pseudocode in the architecture manual specifies that we need to check:
* vector number within IDT limits
* selected IDT descriptor is a valid type (interrupt, trap or task gate)
* if this was a software interrupt then gate DPL < CPL
The way we had structured the code meant that the privilege check for software interrupts ended up not in the code path taken for task gate handling, because all of the task gate handling code was in the 'case 5' of the switch which was checking "is this descriptor a valid type".
Move the task gate handling code out of that switch (so that it is now purely doing the "valid type?" check) and below the software interrupt privilege check.
The effect of this missing check was that in a guest userspace binary executing 'int 8' would cause a guest kernel panic rather than the userspace binary being handed a SEGV.
This is essentially the same bug fixed in VirtualBox in 2012:
https://www.halfdog.net/Security/2012/VirtualBoxSoftwareInterrupt0x8GuestCrash/
Note that for QEMU this is not a security issue because it is only present when using TCG.
Message-Id: <[email protected]>
--- target/i386/tcg/seg_helper.c | 35 +++++++++++++++++++++-------------- 1 file changed, 21 insertions(+), 14 deletions(-)
target/i386/tcg/seg_helper.c +21 -14
@@ -634,6 +634,24 @@ static void do_interrupt_protected(CPUX86State *env, int intno, int is_int, type = (e2 >>DESC_TYPE_SHIFT ) &0x1f ;switch (type) {case 5 :/* task gate */ +case 6 :/* 286 interrupt gate */ +case 7 :/* 286 trap gate */ +case 14 :/* 386 interrupt gate */ +case 15 :/* 386 trap gate */ +break ; +default : +raise_exception_err (env,EXCP0D_GPF , intno *8 +2 ); +break ; + } + dpl = (e2 >>DESC_DPL_SHIFT ) &3 ; + cpl = env->hflags &HF_CPL_MASK ; +/* check privilege if software int */ +if (is_int && dpl < cpl) { +raise_exception_err (env,EXCP0D_GPF , intno *8 +2 ); + } + +if (type ==5 ) { +/* task gate */ /* must do that check here to return the correct error code */ if (!(e2 &DESC_P_MASK )) {raise_exception_err (env,EXCP0B_NOSEG , intno *8 +2 );
@@ -661,21 +679,10 @@ static void do_interrupt_protected(CPUX86State *env, int intno, int is_int,SET_ESP (esp, mask); }return ; -case 6 :/* 286 interrupt gate */ -case 7 :/* 286 trap gate */ -case 14 :/* 386 interrupt gate */ -case 15 :/* 386 trap gate */ -break ; -default : -raise_exception_err (env,EXCP0D_GPF , intno *8 +2 ); -break ; - } - dpl = (e2 >>DESC_DPL_SHIFT ) &3 ; - cpl = env->hflags &HF_CPL_MASK ; -/* check privilege if software int */ -if (is_int && dpl < cpl) { -raise_exception_err (env,EXCP0D_GPF , intno *8 +2 ); } + +/* Otherwise, trap or interrupt gate */ +/* check valid bit */ if (!(e2 &DESC_P_MASK )) {raise_exception_err (env,EXCP0B_NOSEG , intno *8 +2 );
Signature · 1 line
2.29.2
[PULL 35/55] configure: remove CONFIG_FILEVERSION and CONFIG_PRODUCTVERSION
In reply to Paolo Bonziniversion.rc can just use existing preprocessor symbols.
--- configure | 9 --------- version.rc | 4 ++-- 2 files changed, 2 insertions(+), 11 deletions(-)
configure +0 -9
@@ -5927,15 +5927,6 @@ if test "$bigendian" = "yes" ; then fi if test "$mingw32" = "yes" ; then echo "CONFIG_WIN32=y" >> $config_host_mak - rc_version=$(cat $source_path/VERSION) - version_major=${rc_version%%.*} - rc_version=${rc_version#*.} - version_minor=${rc_version%%.*} - rc_version=${rc_version#*.} - version_subminor=${rc_version%%.*} - version_micro=0 - echo "CONFIG_FILEVERSION=$version_major,$version_minor,$version_subminor,$version_micro" >> $config_host_mak - echo "CONFIG_PRODUCTVERSION=$version_major,$version_minor,$version_subminor,$version_micro" >> $config_host_mak if test "$guest_agent_with_vss" = "yes" ; then echo "CONFIG_QGA_VSS=y" >> $config_host_mak echo "QGA_VSS_PROVIDER=$qga_vss_provider" >> $config_host_mak
version.rc +2 -2
@@ -2,8 +2,8 @@ #include "config-host.h" VS_VERSION_INFO VERSIONINFO -FILEVERSION CONFIG_FILEVERSION -PRODUCTVERSION CONFIG_PRODUCTVERSION +FILEVERSION QEMU_VERSION_MAJOR,QEMU_VERSION_MINOR,QEMU_VERSION_MICRO,0 +PRODUCTVERSION QEMU_VERSION_MAJOR,QEMU_VERSION_MINOR,QEMU_VERSION_MICRO,0 FILEFLAGSMASK VS_FFI_FILEFLAGSMASK FILEOS VOS_NT_WINDOWS32 FILETYPE VFT_APP
Signature · 1 line
2.29.2
[PULL 45/55] lzo: convert to meson
In reply to Paolo Bonzini--- configure | 32 ++++---------------------------- meson.build | 20 ++++++++++++++++---- meson_options.txt | 2 ++ 3 files changed, 22 insertions(+), 32 deletions(-)
configure +4 -28
@@ -393,7 +393,7 @@ opengl_dmabuf="no" cpuid_h="no" avx2_opt="$default_feature" capstone="auto" -lzo="$default_feature" +lzo="auto" snappy="$default_feature" bzip2="auto" lzfse="$default_feature"
@@ -1311,9 +1311,9 @@ for opt do ;; --disable-zlib-test) ;; - --disable-lzo) lzo="no" + --disable-lzo) lzo="disabled" ;; - --enable-lzo) lzo="yes" + --enable-lzo) lzo="enabled" ;; --disable-snappy) snappy="no" ;;
@@ -2456,25 +2456,6 @@ EOF fi fi -########################################## -# lzo check - -if test "$lzo" != "no" ; then - cat > $TMPC << EOF -#include <lzo/lzo1x.h> -int main(void) { lzo_version(); return 0; } -EOF - if compile_prog "" "-llzo2" ; then - lzo_libs="-llzo2" - lzo="yes" - else - if test "$lzo" = "yes"; then - feature_not_found "liblzo2" "Install liblzo2 devel" - fi - lzo="no" - fi -fi - ########################################## # snappy check
@@ -6124,11 +6105,6 @@ if test "$avx512f_opt" = "yes" ; then echo "CONFIG_AVX512F_OPT=y" >> $config_host_mak fi -if test "$lzo" = "yes" ; then - echo "CONFIG_LZO=y" >> $config_host_mak - echo "LZO_LIBS=$lzo_libs" >> $config_host_mak -fi - if test "$snappy" = "yes" ; then echo "CONFIG_SNAPPY=y" >> $config_host_mak echo "SNAPPY_LIBS=$snappy_libs" >> $config_host_mak
@@ -6697,7 +6673,7 @@ NINJA=$ninja $meson setup \ -Dcapstone=$capstone -Dslirp=$slirp -Dfdt=$fdt -Dbrlapi=$brlapi \ -Dcurl=$curl -Dglusterfs=$glusterfs -Dbzip2=$bzip2 -Dlibiscsi=$libiscsi \ -Dlibnfs=$libnfs -Diconv=$iconv -Dcurses=$curses -Dlibudev=$libudev\ - -Dlibssh=$libssh -Drbd=$rbd \ + -Dlibssh=$libssh -Drbd=$rbd -Dlzo=$lzo \ -Ddocs=$docs -Dsphinx_build=$sphinx_build -Dinstall_blobs=$blobs \ -Dvhost_user_blk_server=$vhost_user_blk_server \ -Dfuse=$fuse -Dfuse_lseek=$fuse_lseek \
meson.build +16 -4
@@ -757,10 +757,21 @@ snappy = not_found if 'CONFIG_SNAPPY' in config_host snappy = declare_dependency(link_args: config_host['SNAPPY_LIBS'].split()) endif -lzo = not_found -if 'CONFIG_LZO' in config_host - lzo = declare_dependency(link_args: config_host['LZO_LIBS'].split()) + +lzo = cc.find_library('lzo2', has_headers: ['lzo/lzo1x.h'], + required: get_option('lzo'), + static: enable_static) +if lzo.found() and not cc.links(''' + #include <lzo/lzo1x.h> + int main(void) { lzo_version(); return 0; }''', dependencies: lzo) + lzo = not_found + if get_option('lzo').enabled() + error('could not link liblzo2') + else + warning('could not link liblzo2, disabling') + endif endif + rdma = not_found if 'CONFIG_RDMA' in config_host rdma = declare_dependency(link_args: config_host['RDMA_LIBS'].split())
@@ -945,6 +956,7 @@ config_host_data.set_quoted('CONFIG_SYSCONFDIR', get_option('prefix') / get_opti config_host_data.set('CONFIG_BRLAPI', brlapi.found()) config_host_data.set('CONFIG_COCOA', cocoa.found()) 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_CURL', curl.found())
@@ -2346,7 +2358,7 @@ summary_info += {'TPM support': config_host.has_key('CONFIG_TPM')} summary_info += {'libssh support': libssh.found()} summary_info += {'QOM debugging': config_host.has_key('CONFIG_QOM_CAST_DEBUG')} summary_info += {'Live block migration': config_host.has_key('CONFIG_LIVE_BLOCK_MIGRATION')} -summary_info += {'lzo support': config_host.has_key('CONFIG_LZO')} +summary_info += {'lzo support': lzo.found()} summary_info += {'snappy support': config_host.has_key('CONFIG_SNAPPY')} summary_info += {'bzip2 support': libbzip2.found()} summary_info += {'lzfse support': config_host.has_key('CONFIG_LZFSE')}
meson_options.txt +2 -0
@@ -64,6 +64,8 @@ option('curses', type : 'feature', value : 'auto', description: 'curses UI') option('libudev', type : 'feature', value : 'auto', description: 'Use libudev to enumerate host devices') +option('lzo', type : 'feature', value : 'auto', + description: 'lzo compression support') option('rbd', type : 'feature', value : 'auto', description: 'Ceph block device driver') option('sdl', type : 'feature', value : 'auto',
Signature · 1 line
2.29.2
[PULL 44/55] rbd: convert to meson
In reply to Paolo Bonzini--- configure | 35 ++++------------------------------- meson.build | 22 +++++++++++++++++++--- meson_options.txt | 2 ++ 3 files changed, 25 insertions(+), 34 deletions(-)
configure +4 -31
@@ -383,7 +383,7 @@ qom_cast_debug="yes" trace_backends="log" trace_file="trace" spice="$default_feature" -rbd="$default_feature" +rbd="auto" smartcard="$default_feature" u2f="auto" libusb="$default_feature"
@@ -1285,9 +1285,9 @@ for opt do ;; --enable-opengl) opengl="yes" ;; - --disable-rbd) rbd="no" + --disable-rbd) rbd="disabled" ;; - --enable-rbd) rbd="yes" + --enable-rbd) rbd="enabled" ;; --disable-xfsctl) xfs="no" ;;
@@ -3605,29 +3605,6 @@ if compile_prog "" "$pthread_lib" ; then pthread_setname_np_wo_tid=yes fi -########################################## -# rbd probe -if test "$rbd" != "no" ; then - cat > $TMPC <<EOF -#include <stdio.h> -#include <rbd/librbd.h> -int main(void) { - rados_t cluster; - rados_create(&cluster, NULL); - return 0; -} -EOF - rbd_libs="-lrbd -lrados" - if compile_prog "" "$rbd_libs" ; then - rbd=yes - else - if test "$rbd" = "yes" ; then - feature_not_found "rados block device" "Install librbd/ceph devel" - fi - rbd=no - fi -fi - ########################################## # linux-aio probe
@@ -6182,10 +6159,6 @@ fi if test "$qom_cast_debug" = "yes" ; then echo "CONFIG_QOM_CAST_DEBUG=y" >> $config_host_mak fi -if test "$rbd" = "yes" ; then - echo "CONFIG_RBD=y" >> $config_host_mak - echo "RBD_LIBS=$rbd_libs" >> $config_host_mak -fi echo "CONFIG_COROUTINE_BACKEND=$coroutine" >> $config_host_mak if test "$coroutine_pool" = "yes" ; then
@@ -6724,7 +6697,7 @@ NINJA=$ninja $meson setup \ -Dcapstone=$capstone -Dslirp=$slirp -Dfdt=$fdt -Dbrlapi=$brlapi \ -Dcurl=$curl -Dglusterfs=$glusterfs -Dbzip2=$bzip2 -Dlibiscsi=$libiscsi \ -Dlibnfs=$libnfs -Diconv=$iconv -Dcurses=$curses -Dlibudev=$libudev\ - -Dlibssh=$libssh \ + -Dlibssh=$libssh -Drbd=$rbd \ -Ddocs=$docs -Dsphinx_build=$sphinx_build -Dinstall_blobs=$blobs \ -Dvhost_user_blk_server=$vhost_user_blk_server \ -Dfuse=$fuse -Dfuse_lseek=$fuse_lseek \
meson.build +19 -3
@@ -612,9 +612,24 @@ else endif rbd = not_found -if 'CONFIG_RBD' in config_host - rbd = declare_dependency(link_args: config_host['RBD_LIBS'].split()) +if not get_option('rbd').auto() or have_block + librados = cc.find_library('rados', required: get_option('rbd'), + static: enable_static) + librbd = cc.find_library('rbd', has_headers: ['rbd/librbd.h'], + required: get_option('rbd'), + static: enable_static) + if librados.found() and librbd.found() and cc.links(''' + #include <stdio.h> + #include <rbd/librbd.h> + int main(void) { + rados_t cluster; + rados_create(&cluster, NULL); + return 0; + }''', dependencies: [librbd, librados]) + rbd = declare_dependency(dependencies: [librbd, librados]) + endif endif + glusterfs = not_found glusterfs_ftruncate_has_stat = false glusterfs_iocb_has_stat = false
@@ -947,6 +962,7 @@ config_host_data.set('CONFIG_LIBISCSI', libiscsi.found()) config_host_data.set('CONFIG_LIBNFS', libnfs.found()) config_host_data.set('CONFIG_LIBSSH', libssh.found()) config_host_data.set('HAVE_LIBSSH_0_8', have_libssh_0_8) +config_host_data.set('CONFIG_RBD', rbd.found()) config_host_data.set('CONFIG_SDL', sdl.found()) config_host_data.set('CONFIG_SDL_IMAGE', sdl_image.found()) config_host_data.set('CONFIG_VHOST_USER_BLK_SERVER', have_vhost_user_blk_server)
@@ -2297,7 +2313,7 @@ if config_host['TRACE_BACKENDS'].split().contains('simple') endif # TODO: add back protocol and server version summary_info += {'spice support': config_host.has_key('CONFIG_SPICE')} -summary_info += {'rbd support': config_host.has_key('CONFIG_RBD')} +summary_info += {'rbd support': rbd.found()} summary_info += {'xfsctl support': config_host.has_key('CONFIG_XFS')} summary_info += {'smartcard support': config_host.has_key('CONFIG_SMARTCARD')} summary_info += {'U2F support': u2f.found()}
meson_options.txt +2 -0
@@ -64,6 +64,8 @@ option('curses', type : 'feature', value : 'auto', description: 'curses UI') option('libudev', type : 'feature', value : 'auto', description: 'Use libudev to enumerate host devices') +option('rbd', type : 'feature', value : 'auto', + description: 'Ceph block device driver') option('sdl', type : 'feature', value : 'auto', description: 'SDL user interface') option('sdl_image', type : 'feature', value : 'auto',
Signature · 1 line
2.29.2
[PULL 23/55] util: Extract flush_icache_range to cacheflush.c
In reply to Paolo BonziniFrom: Richard Henderson <[email protected]>
This has been a tcg-specific function, but is also in use by hardware accelerators via physmem.c. This can cause link errors when tcg is disabled.
Message-Id: <[email protected]>
--- MAINTAINERS | 2 ++ include/qemu/cacheflush.h | 24 +++++++++++++ softmmu/physmem.c | 1 + tcg/aarch64/tcg-target.h | 5 --- tcg/arm/tcg-target.h | 5 --- tcg/i386/tcg-target.h | 4 --- tcg/mips/tcg-target.h | 11 ------ tcg/ppc/tcg-target.c.inc | 22 ------------ tcg/ppc/tcg-target.h | 1 - tcg/riscv/tcg-target.h | 5 --- tcg/s390/tcg-target.h | 4 --- tcg/sparc/tcg-target.h | 8 ----- tcg/tcg.c | 1 + tcg/tci/tcg-target.h | 4 --- util/cacheflush.c | 71 +++++++++++++++++++++++++++++++++++++++ util/meson.build | 2 +- 16 files changed, 100 insertions(+), 70 deletions(-) create mode 100644 include/qemu/cacheflush.h create mode 100644 util/cacheflush.c
MAINTAINERS +2 -0
@@ -119,6 +119,8 @@ F: softmmu/cpus.c F: cpus-common.c F: accel/tcg/ F: accel/stubs/tcg-stub.c +F: util/cacheinfo.c +F: util/cacheflush.c F: scripts/decodetree.py F: docs/devel/decodetree.rst F: include/exec/cpu*.h
include/qemu/cacheflush.h new file +24 -0
@@ -0,0 +1,24 @@ +/* +* Flush the host cpu caches. +* +* This work is licensed under the terms of the GNU GPL, version 2 or later. +* See the COPYING file in the top-level directory. +*/ + +#ifndef QEMU_CACHEFLUSH_H +#define QEMU_CACHEFLUSH_H + +#if defined(__i386__) || defined(__x86_64__) || defined(__s390__) + +static inline void flush_icache_range (uintptr_t start,uintptr_t stop) +{ +/* icache is coherent and does not require flushing. */ +} + +#else + +void flush_icache_range (uintptr_t start,uintptr_t stop); + +#endif + +#endif /* QEMU_CACHEFLUSH_H */
softmmu/physmem.c +1 -0
@@ -22,6 +22,7 @@#include "qapi/error.h" #include "qemu/cutils.h" +#include "qemu/cacheflush.h" #include "cpu.h" #include "exec/exec-all.h" #include "exec/target_page.h"
tcg/aarch64/tcg-target.h +0 -5
@@ -148,11 +148,6 @@ typedef enum {#define TCG_TARGET_DEFAULT_MO (0)#define TCG_TARGET_HAS_MEMORY_BSWAP 1 -static inline void flush_icache_range (uintptr_t start,uintptr_t stop) -{ -__builtin___clear_cache ((char *)start, (char *)stop); -} -void tb_target_set_jmp_target (uintptr_t ,uintptr_t ,uintptr_t );#ifdef CONFIG_SOFTMMU
tcg/arm/tcg-target.h +0 -5
@@ -134,11 +134,6 @@ enum {#define TCG_TARGET_DEFAULT_MO (0)#define TCG_TARGET_HAS_MEMORY_BSWAP 1 -static inline void flush_icache_range (uintptr_t start,uintptr_t stop) -{ -__builtin___clear_cache ((char *) start, (char *) stop); -} -/* not defined -- call should be eliminated at compile time */ void tb_target_set_jmp_target (uintptr_t ,uintptr_t ,uintptr_t );
tcg/i386/tcg-target.h +0 -4
@@ -206,10 +206,6 @@ extern bool have_avx2;#define TCG_TARGET_extract_i64_valid (ofs, len) \ (((ofs) == 8 && (len) == 8) || ((ofs) + (len)) == 32) -static inline void flush_icache_range (uintptr_t start,uintptr_t stop) -{ -} -static inline void tb_target_set_jmp_target (uintptr_t tc_ptr,uintptr_t jmp_addr,uintptr_t addr) {
tcg/mips/tcg-target.h +0 -11
@@ -198,20 +198,9 @@ extern bool use_mips32r2_instructions;#define TCG_TARGET_HAS_ext16u_i64 0/* andi rt, rs, 0xffff */ #endif -#ifdef __OpenBSD__ -#include <machine/sysarch.h> -#else -#include <sys/cachectl.h> -#endif -#define TCG_TARGET_DEFAULT_MO (0)#define TCG_TARGET_HAS_MEMORY_BSWAP 1 -static inline void flush_icache_range (uintptr_t start,uintptr_t stop) -{ -cacheflush ((void *)start, stop-start,ICACHE ); -} -void tb_target_set_jmp_target (uintptr_t ,uintptr_t ,uintptr_t );#ifdef CONFIG_SOFTMMU
tcg/ppc/tcg-target.c.inc +0 -22
@@ -3863,25 +3863,3 @@ void tcg_register_jit(void *buf, size_t buf_size) tcg_register_jit_int(buf, buf_size, &debug_frame, sizeof(debug_frame)); } #endif /* __ELF__ */ - -void flush_icache_range(uintptr_t start, uintptr_t stop) -{ - uintptr_t p, start1, stop1; - size_t dsize = qemu_dcache_linesize; - size_t isize = qemu_icache_linesize; - - start1 = start & ~(dsize - 1); - stop1 = (stop + dsize - 1) & ~(dsize - 1); - for (p = start1; p < stop1; p += dsize) { - asm volatile ("dcbst 0,%0" : : "r"(p) : "memory"); - } - asm volatile ("sync" : : : "memory"); - - start &= start & ~(isize - 1); - stop1 = (stop + isize - 1) & ~(isize - 1); - for (p = start1; p < stop1; p += isize) { - asm volatile ("icbi 0,%0" : : "r"(p) : "memory"); - } - asm volatile ("sync" : : : "memory"); - asm volatile ("isync" : : : "memory"); -}
tcg/ppc/tcg-target.h +0 -1
@@ -175,7 +175,6 @@ extern bool have_vsx;#define TCG_TARGET_HAS_bitsel_vec have_vsx#define TCG_TARGET_HAS_cmpsel_vec 0 -void flush_icache_range (uintptr_t start,uintptr_t stop);void tb_target_set_jmp_target (uintptr_t ,uintptr_t ,uintptr_t );#define TCG_TARGET_DEFAULT_MO (0)
tcg/riscv/tcg-target.h +0 -5
@@ -159,11 +159,6 @@ typedef enum {#define TCG_TARGET_HAS_mulsh_i64 1#endif -static inline void flush_icache_range (uintptr_t start,uintptr_t stop) -{ -__builtin___clear_cache ((char *)start, (char *)stop); -} -/* not defined -- call should be eliminated at compile time */ void tb_target_set_jmp_target (uintptr_t ,uintptr_t ,uintptr_t );
tcg/s390/tcg-target.h +0 -4
@@ -145,10 +145,6 @@ enum { TCG_AREG0 = TCG_REG_R10, }; -static inline void flush_icache_range (uintptr_t start,uintptr_t stop) -{ -} -static inline void tb_target_set_jmp_target (uintptr_t tc_ptr,uintptr_t jmp_addr,uintptr_t addr) {
tcg/sparc/tcg-target.h +0 -8
@@ -168,14 +168,6 @@ extern bool use_vis3_instructions;#define TCG_TARGET_DEFAULT_MO (0)#define TCG_TARGET_HAS_MEMORY_BSWAP 1 -static inline void flush_icache_range (uintptr_t start,uintptr_t stop) -{ -uintptr_t p; -for (p = start &-8 ; p < ((stop +7 ) &-8 ); p +=8 ) { - __asm__ __volatile__("flush\t%0" : :"r" (p)); - } -} -void tb_target_set_jmp_target (uintptr_t ,uintptr_t ,uintptr_t );#define TCG_TARGET_NEED_POOL_LABELS
tcg/tcg.c +1 -0
@@ -35,6 +35,7 @@#include "qemu/host-utils.h" #include "qemu/qemu-print.h" #include "qemu/timer.h" +#include "qemu/cacheflush.h" /* Note: the long term plan is to reduce the dependencies on the QEMU CPU definitions. Currently they are used for qemu_ld/st
tcg/tci/tcg-target.h +0 -4
@@ -191,10 +191,6 @@ void tci_disas(uint8_t opc);#define HAVE_TCG_QEMU_TB_EXEC -static inline void flush_icache_range (uintptr_t start,uintptr_t stop) -{ -} -/* We could notice __i386__ or __s390x__ and reduce the barriers depending on the host. But if you want performance, you use the normal backend. We prefer consistency across hosts on this. */
util/cacheflush.c new file +71 -0
71 lines not on this page · raw message
util/meson.build +1 -1
@@ -21,7 +21,7 @@ util_ss.add(files('envlist.c', 'path.c', 'module.c')) util_ss.add(files('host-utils.c')) util_ss.add(files('bitmap.c', 'bitops.c')) util_ss.add(files('fifo8.c')) -util_ss.add(files('cacheinfo.c')) +util_ss.add(files('cacheinfo.c', 'cacheflush.c')) util_ss.add(files('error.c', 'qemu-error.c')) util_ss.add(files('qemu-print.c')) util_ss.add(files('id.c'))
Signature · 1 line
2.29.2
[PULL 24/55] trace: do not include TCG helper tracepoints in no-TCG builds
In reply to Paolo Bonzini--- trace/meson.build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
trace/meson.build +1 -1
@@ -71,7 +71,7 @@ foreach d : [ input: meson.source_root() / 'trace-events', command: [ tracetool, '--group=root', '--format=@0@'.format(d[1]), '@INPUT@' ], capture: true) - specific_ss.add(gen) + specific_ss.add(when: 'CONFIG_TCG', if_true: gen) endforeach if 'CONFIG_TRACE_UST' in config_host
Signature · 1 line
2.29.2
[PULL 46/55] snappy: convert to meson
In reply to Paolo Bonzini--- configure | 32 ++++---------------------------- meson.build | 19 +++++++++++++++---- meson_options.txt | 2 ++ 3 files changed, 21 insertions(+), 32 deletions(-)
configure +4 -28
@@ -394,7 +394,7 @@ cpuid_h="no" avx2_opt="$default_feature" capstone="auto" lzo="auto" -snappy="$default_feature" +snappy="auto" bzip2="auto" lzfse="$default_feature" zstd="$default_feature"
@@ -1315,9 +1315,9 @@ for opt do ;; --enable-lzo) lzo="enabled" ;; - --disable-snappy) snappy="no" + --disable-snappy) snappy="disabled" ;; - --enable-snappy) snappy="yes" + --enable-snappy) snappy="enabled" ;; --disable-bzip2) bzip2="disabled" ;;
@@ -2456,25 +2456,6 @@ EOF fi fi -########################################## -# snappy check - -if test "$snappy" != "no" ; then - cat > $TMPC << EOF -#include <snappy-c.h> -int main(void) { snappy_max_compressed_length(4096); return 0; } -EOF - if compile_prog "" "-lsnappy" ; then - snappy_libs='-lsnappy' - snappy="yes" - else - if test "$snappy" = "yes"; then - feature_not_found "libsnappy" "Install libsnappy devel" - fi - snappy="no" - fi -fi - ########################################## # lzfse check
@@ -6105,11 +6086,6 @@ if test "$avx512f_opt" = "yes" ; then echo "CONFIG_AVX512F_OPT=y" >> $config_host_mak fi -if test "$snappy" = "yes" ; then - echo "CONFIG_SNAPPY=y" >> $config_host_mak - echo "SNAPPY_LIBS=$snappy_libs" >> $config_host_mak -fi - if test "$lzfse" = "yes" ; then echo "CONFIG_LZFSE=y" >> $config_host_mak echo "LZFSE_LIBS=-llzfse" >> $config_host_mak
@@ -6673,7 +6649,7 @@ NINJA=$ninja $meson setup \ -Dcapstone=$capstone -Dslirp=$slirp -Dfdt=$fdt -Dbrlapi=$brlapi \ -Dcurl=$curl -Dglusterfs=$glusterfs -Dbzip2=$bzip2 -Dlibiscsi=$libiscsi \ -Dlibnfs=$libnfs -Diconv=$iconv -Dcurses=$curses -Dlibudev=$libudev\ - -Dlibssh=$libssh -Drbd=$rbd -Dlzo=$lzo \ + -Dlibssh=$libssh -Drbd=$rbd -Dlzo=$lzo -Dsnappy=$snappy \ -Ddocs=$docs -Dsphinx_build=$sphinx_build -Dinstall_blobs=$blobs \ -Dvhost_user_blk_server=$vhost_user_blk_server \ -Dfuse=$fuse -Dfuse_lseek=$fuse_lseek \
meson.build +15 -4
@@ -753,9 +753,19 @@ if get_option('vnc').enabled() compile_args: '-DSTRUCT_IOVEC_DEFINED') endif endif -snappy = not_found -if 'CONFIG_SNAPPY' in config_host - snappy = declare_dependency(link_args: config_host['SNAPPY_LIBS'].split()) + +snappy = cc.find_library('snappy', has_headers: ['snappy-c.h'], + required: get_option('snappy'), + static: enable_static) +if snappy.found() and not cc.links(''' + #include <snappy-c.h> + int main(void) { snappy_max_compressed_length(4096); return 0; }''', dependencies: snappy) + snappy = not_found + if get_option('snappy').enabled() + error('could not link libsnappy') + else + warning('could not link libsnappy, disabling') + endif endif lzo = cc.find_library('lzo2', has_headers: ['lzo/lzo1x.h'],
@@ -977,6 +987,7 @@ config_host_data.set('HAVE_LIBSSH_0_8', have_libssh_0_8) config_host_data.set('CONFIG_RBD', rbd.found()) config_host_data.set('CONFIG_SDL', sdl.found()) config_host_data.set('CONFIG_SDL_IMAGE', sdl_image.found()) +config_host_data.set('CONFIG_SNAPPY', snappy.found()) config_host_data.set('CONFIG_VHOST_USER_BLK_SERVER', have_vhost_user_blk_server) config_host_data.set('CONFIG_VNC', vnc.found()) config_host_data.set('CONFIG_VNC_JPEG', jpeg.found())
@@ -2359,7 +2370,7 @@ summary_info += {'libssh support': libssh.found()} summary_info += {'QOM debugging': config_host.has_key('CONFIG_QOM_CAST_DEBUG')} summary_info += {'Live block migration': config_host.has_key('CONFIG_LIVE_BLOCK_MIGRATION')} summary_info += {'lzo support': lzo.found()} -summary_info += {'snappy support': config_host.has_key('CONFIG_SNAPPY')} +summary_info += {'snappy support': snappy.found()} summary_info += {'bzip2 support': libbzip2.found()} summary_info += {'lzfse support': config_host.has_key('CONFIG_LZFSE')} summary_info += {'zstd support': config_host.has_key('CONFIG_ZSTD')}
meson_options.txt +2 -0
@@ -72,6 +72,8 @@ option('sdl', type : 'feature', value : 'auto', description: 'SDL user interface') option('sdl_image', type : 'feature', value : 'auto', description: 'SDL Image support for icons') +option('snappy', type : 'feature', value : 'auto', + description: 'snappy compression support') option('u2f', type : 'feature', value : 'auto', description: 'U2F emulation support') option('vnc', type : 'feature', value : 'enabled',
Signature · 1 line
2.29.2
[PULL 54/55] configure: move tests/qemu-iotests/common.env generation to meson
In reply to Paolo Bonzini--- configure | 7 ------- tests/qemu-iotests/common.env.in | 3 +++ tests/qemu-iotests/meson.build | 3 +++ 3 files changed, 6 insertions(+), 7 deletions(-) create mode 100644 tests/qemu-iotests/common.env.in
configure +0 -7
@@ -6394,13 +6394,6 @@ for rom in seabios; do echo "RANLIB=$ranlib" >> $config_mak done -# set up qemu-iotests in this build directory -iotests_common_env="tests/qemu-iotests/common.env" - -echo "# Automatically generated by configure - do not modify" > "$iotests_common_env" -echo >> "$iotests_common_env" -echo "export PYTHON='$python'" >> "$iotests_common_env" - if test "$skip_meson" = no; then cross="config-meson.cross.new" meson_quote() {
tests/qemu-iotests/common.env.in new file +3 -0
@@ -0,0 +1,3 @@ +# Automatically generated by configure - do not modify + +export PYTHON='@PYTHON@'
tests/qemu-iotests/meson.build +3 -0
@@ -3,3 +3,6 @@ if 'CONFIG_LINUX' in config_host else socket_scm_helper = [] endif +configure_file(output: 'common.env', + input: files('common.env.in'), + configuration: {'PYTHON': python.full_path()})
Signature · 1 line
2.29.2
[PULL 21/55] build-sys: fix -static linking of libvhost-user
In reply to Paolo BonziniFrom: Marc-André Lureau <[email protected]>
Fix linking vhost-user binaries with with ./configure -static, by overriding glib-2.0 dependency with configure results.
Message-Id: <[email protected]>
--- meson.build | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
meson.build +5 -1
@@ -268,7 +268,11 @@ endif # grandfathered in from the QEMU Makefiles. add_project_arguments(config_host['GLIB_CFLAGS'].split(), native: false, language: ['c', 'cpp', 'objc']) -glib = declare_dependency(link_args: config_host['GLIB_LIBS'].split()) +glib = declare_dependency(compile_args: config_host['GLIB_CFLAGS'].split(), + link_args: config_host['GLIB_LIBS'].split()) +# override glib dep with the configure results (for subprojects) +meson.override_dependency('glib-2.0', glib) + gio = not_found if 'CONFIG_GIO' in config_host gio = declare_dependency(compile_args: config_host['GIO_CFLAGS'].split(),
Signature · 1 line
2.29.2
[PULL 25/55] Makefile: add dummy target for build.ninja dependencies
In reply to Paolo BonziniThe dummy targets ensure that incremental build can be done after deleting a meson.build file.
--- Makefile | 1 + 1 file changed, 1 insertion(+)
Makefile +1 -0
@@ -133,6 +133,7 @@ Makefile.ninja: build.ninja # A separate rule is needed for Makefile dependencies to avoid -n build.ninja: build.ninja.stamp +$(build-files): build.ninja.stamp: meson.stamp $(build-files) $(NINJA) $(if $V,-v,) build.ninja && touch $@ endif
Signature · 1 line
2.29.2
[PULL 50/55] virtfs: convert to meson
In reply to Paolo Bonzini--- configure | 29 ++++------------------------- meson.build | 24 ++++++++++++++++++++++-- meson_options.txt | 11 +++++++---- 3 files changed, 33 insertions(+), 31 deletions(-)
configure +4 -25
@@ -315,7 +315,7 @@ netmap="no" sdl="auto" sdl_image="auto" virtiofsd="auto" -virtfs="$default_feature" +virtfs="auto" libudev="auto" mpath="auto" vnc="enabled"
@@ -1004,9 +1004,9 @@ for opt do ;; --enable-qom-cast-debug) qom_cast_debug="yes" ;; - --disable-virtfs) virtfs="no" + --disable-virtfs) virtfs="disabled" ;; - --enable-virtfs) virtfs="yes" + --enable-virtfs) virtfs="enabled" ;; --disable-libudev) libudev="disabled" ;;
@@ -5443,24 +5443,6 @@ if [ "$eventfd" = "yes" ]; then ivshmem=yes fi -if test "$softmmu" = yes ; then - if test "$linux" = yes; then - if test "$virtfs" != no && test "$cap_ng" = yes && test "$attr" = yes ; then - virtfs=yes - else - if test "$virtfs" = yes; then - error_exit "VirtFS requires libcap-ng devel and libattr devel" - fi - virtfs=no - fi - else - if test "$virtfs" = yes; then - error_exit "VirtFS is supported only on Linux" - fi - virtfs=no - fi -fi - # Probe for guest agent support/options if [ "$guest_agent" != "no" ]; then
@@ -5917,9 +5899,6 @@ fi if test "$libattr" = "yes" ; then echo "CONFIG_LIBATTR=y" >> $config_host_mak fi -if test "$virtfs" = "yes" ; then - echo "CONFIG_VIRTFS=y" >> $config_host_mak -fi if test "$vhost_scsi" = "yes" ; then echo "CONFIG_VHOST_SCSI=y" >> $config_host_mak fi
@@ -6580,7 +6559,7 @@ NINJA=$ninja $meson setup \ -Dcurl=$curl -Dglusterfs=$glusterfs -Dbzip2=$bzip2 -Dlibiscsi=$libiscsi \ -Dlibnfs=$libnfs -Diconv=$iconv -Dcurses=$curses -Dlibudev=$libudev\ -Dlibssh=$libssh -Drbd=$rbd -Dlzo=$lzo -Dsnappy=$snappy -Dlzfse=$lzfse \ - -Dzstd=$zstd -Dseccomp=$seccomp \ + -Dzstd=$zstd -Dseccomp=$seccomp -Dvirtfs=$virtfs \ -Ddocs=$docs -Dsphinx_build=$sphinx_build -Dinstall_blobs=$blobs \ -Dvhost_user_blk_server=$vhost_user_blk_server \ -Dfuse=$fuse -Dfuse_lseek=$fuse_lseek \
meson.build +22 -2
@@ -963,6 +963,25 @@ endif # config-host.h # ################# +have_virtfs = (targetos == 'linux' and + have_system and + libattr.found() and + libcap_ng.found()) + +if get_option('virtfs').enabled() + if not have_virtfs + if targetos != 'linux' + error('virtio-9p (virtfs) requires Linux') + elif not libcap_ng.found() or not libattr.found() + error('virtio-9p (virtfs) requires libcap-ng-devel and libattr-devel') + elif not have_system + error('virtio-9p (virtfs) needs system emulation support') + endif + endif +elif get_option('virtfs').disabled() + have_virtfs = false +endif + config_host_data.set_quoted('CONFIG_BINDIR', get_option('prefix') / get_option('bindir')) config_host_data.set_quoted('CONFIG_PREFIX', get_option('prefix')) config_host_data.set_quoted('CONFIG_QEMU_CONFDIR', get_option('prefix') / qemu_confdir)
@@ -1007,6 +1026,7 @@ config_host_data.set('CONFIG_VNC', vnc.found()) config_host_data.set('CONFIG_VNC_JPEG', jpeg.found()) config_host_data.set('CONFIG_VNC_PNG', png.found()) config_host_data.set('CONFIG_VNC_SASL', sasl.found()) +config_host_data.set('CONFIG_VIRTFS', have_virtfs) config_host_data.set('CONFIG_XKBCOMMON', xkbcommon.found()) config_host_data.set('CONFIG_KEYUTILS', keyutils.found()) config_host_data.set('CONFIG_GETTID', has_gettid)
@@ -1105,7 +1125,7 @@ host_kconfig = \ ('CONFIG_VHOST_USER' in config_host ? ['CONFIG_VHOST_USER=y'] : []) + \ ('CONFIG_VHOST_VDPA' in config_host ? ['CONFIG_VHOST_VDPA=y'] : []) + \ ('CONFIG_VHOST_KERNEL' in config_host ? ['CONFIG_VHOST_KERNEL=y'] : []) + \ - ('CONFIG_VIRTFS' in config_host ? ['CONFIG_VIRTFS=y'] : []) + \ + (have_virtfs ? ['CONFIG_VIRTFS=y'] : []) + \ ('CONFIG_LINUX' in config_host ? ['CONFIG_LINUX=y'] : []) + \ ('CONFIG_PVRDMA' in config_host ? ['CONFIG_PVRDMA=y'] : [])
@@ -2294,7 +2314,7 @@ summary_info += {'mingw32 support': targetos == 'windows'} summary_info += {'Audio drivers': config_host['CONFIG_AUDIO_DRIVERS']} summary_info += {'Block whitelist (rw)': config_host['CONFIG_BDRV_RW_WHITELIST']} summary_info += {'Block whitelist (ro)': config_host['CONFIG_BDRV_RO_WHITELIST']} -summary_info += {'VirtFS support': config_host.has_key('CONFIG_VIRTFS')} +summary_info += {'VirtFS support': have_virtfs} summary_info += {'build virtiofs daemon': have_virtiofsd} summary_info += {'Multipath support': mpathpersist.found()} summary_info += {'VNC support': vnc.found()}
meson_options.txt +7 -4
@@ -90,10 +90,6 @@ option('vnc_sasl', type : 'feature', value : 'auto', description: 'SASL authentication for VNC server') option('xkbcommon', type : 'feature', value : 'auto', description: 'xkbcommon support') -option('virtiofsd', type: 'feature', value: 'auto', - description: 'build virtiofs daemon (virtiofsd)') -option('vhost_user_blk_server', type: 'feature', value: 'auto', - description: 'build vhost-user-blk server') option('zstd', type : 'feature', value : 'auto', description: 'zstd compression support') option('fuse', type: 'feature', value: 'auto',
@@ -101,6 +97,13 @@ option('fuse', type: 'feature', value: 'auto', option('fuse_lseek', type : 'feature', value : 'auto', description: 'SEEK_HOLE/SEEK_DATA support for FUSE exports') +option('vhost_user_blk_server', type: 'feature', value: 'auto', + description: 'build vhost-user-blk server') +option('virtfs', type: 'feature', value: 'auto', + description: 'virtio-9p support') +option('virtiofsd', type: 'feature', value: 'auto', + description: 'build virtiofs daemon (virtiofsd)') + option('capstone', type: 'combo', value: 'auto', choices: ['disabled', 'enabled', 'auto', 'system', 'internal'], description: 'Whether and how to find the capstone library')
Signature · 1 line
2.29.2
Re: [PULL 50/55] virtfs: convert to meson
Quoted 176 lines · Paolo Bonzini
Signed-off-by Paolo Bonzini <[email protected]>---
configure | 29 ++++------------------------- meson.build | 24 ++++++++++++++++++++++-- meson_options.txt | 11 +++++++----3 files changed, 33 insertions(+), 31 deletions(-)configure +0
-0@@ -315,7 +315,7 @@ netmap="no"sdl="auto"
sdl_image="auto"
virtiofsd="auto"configure +1
-1-virtfs="$default_feature" +virtfs="auto"libudev="auto"
mpath="auto"
vnc="enabled"configure +0
-0@@ -1004,9 +1004,9 @@ for opt do ;;--enable-qom-cast-debug) qom_cast_debug="yes"
;;
- --disable-virtfs) virtfs="no"
+ --disable-virtfs) virtfs="disabled"
;;
- --enable-virtfs) virtfs="yes"
+ --enable-virtfs) virtfs="enabled"
;;
--disable-libudev) libudev="disabled"
;;configure +0
-0@@ -5443,24 +5443,6 @@ if [ "$eventfd" = "yes" ]; thenivshmem=yes
fi
-if test "$softmmu" = yes ; then
- if test "$linux" = yes; then
- if test "$virtfs" != no && test "$cap_ng" = yes && test "$attr" = yes ; then
- virtfs=yes
- else
- if test "$virtfs" = yes; then
-error_exit"VirtFS requires libcap-ng devel and libattr devel"
- fi
- virtfs=no
- fi
- else
- if test "$virtfs" = yes; then
-error_exit"VirtFS is supported only on Linux"
- fi
- virtfs=no
- ficonfigure +0
-2-fi -# Probe for guest agent support/options
if [ "$guest_agent" != "no" ]; thenconfigure +0
-0@@ -5917,9 +5899,6 @@ fiif test "$libattr" = "yes" ; then
echo "CONFIG_LIBATTR=y" >> $config_host_mak
ficonfigure +0
-3-if test "$virtfs" = "yes" ; then - echo "CONFIG_VIRTFS=y" >> $config_host_mak -fiif test "$vhost_scsi" = "yes" ; then
echo "CONFIG_VHOST_SCSI=y" >> $config_host_mak
ficonfigure +0
-0@@ -6580,7 +6559,7 @@ NINJA=$ninja $meson setup \-Dcurl=$curl -Dglusterfs=$glusterfs -Dbzip2=$bzip2 - Dlibiscsi=$libiscsi \
-Dlibnfs=$libnfs -Diconv=$iconv -Dcurses=$curses - Dlibudev=$libudev\
-Dlibssh=$libssh -Drbd=$rbd -Dlzo=$lzo -Dsnappy=$snappy - Dlzfse=$lzfse \
- -Dzstd=$zstd -Dseccomp=$seccomp \
+ -Dzstd=$zstd -Dseccomp=$seccomp -Dvirtfs=$virtfs \
-Ddocs=$docs -Dsphinx_build=$sphinx_build - Dinstall_blobs=$blobs \
-Dvhost_user_blk_server=$vhost_user_blk_server \
-Dfuse=$fuse -Dfuse_lseek=$fuse_lseek \meson.build +0
-0@@ -963,6 +963,25 @@ endif # config-host.h # #################meson.build +11
-0+have_virtfs = (targetos == 'linux' and + have_system and + libattr.found() and + libcap_ng.found()) + +if get_option('virtfs').enabled() + if not have_virtfs + if targetos != 'linux' + error('virtio-9p (virtfs) requires Linux') + elif not libcap_ng.found() or not libattr.found() + error('virtio-9p (virtfs) requires libcap-ng-devel andlibattr-devel')
+ elif nothave_system
+ error('virtio-9p (virtfs) needs system emulation support') + endif
+ endifmeson.build +4
-0+elif get_option('virtfs').disabled() + have_virtfs = false +endif +config_host_data.set_quoted('CONFIG_BINDIR',
get_option('prefix')/get_option('bindir'))config_host_data.set_quoted('CONFIG_PREFIX', get_option('prefix'))config_host_data.set_quoted('CONFIG_QEMU_CONFDIR', get_option('prefix') / qemu_confdir)meson.build +1
-0@@ -1007,6 +1026,7 @@ config_host_data.set('CONFIG_VNC', vnc.found()) config_host_data.set('CONFIG_VNC_JPEG', jpeg.found()) config_host_data.set('CONFIG_VNC_PNG', png.found()) config_host_data.set('CONFIG_VNC_SASL', sasl.found()) +config_host_data.set('CONFIG_VIRTFS', have_virtfs) config_host_data.set('CONFIG_XKBCOMMON', xkbcommon.found()) config_host_data.set('CONFIG_KEYUTILS', keyutils.found()) config_host_data.set('CONFIG_GETTID', has_gettid)@@ -1105,7 +1125,7 @@ host_kconfig = \('
CONFIG_VHOST_USER' inconfig_host? ['CONFIG_VHOST_USER=y'] :
[]) + \
('CONFIG_VHOST_VDPA' inconfig_host? ['CONFIG_VHOST_VDPA=y'] :
[]) + \
('CONFIG_VHOST_KERNEL' inconfig_host? ['CONFIG_VHOST_KERNEL=y'] : []) + \
- ('CONFIG_VIRTFS' inconfig_host? ['CONFIG_VIRTFS=y'] : []) + \
+ (have_virtfs? ['CONFIG_VIRTFS=y'] : []) + \
('CONFIG_LINUX' inconfig_host? ['CONFIG_LINUX=y'] : []) + \
('CONFIG_PVRDMA' inconfig_host? ['CONFIG_PVRDMA=y'] : [])meson.build +0
-0@@ -2294,7 +2314,7 @@ summary_info += {'mingw32 support': targetos == 'windows'}summary_info += {'Audio drivers':
config_host['CONFIG_AUDIO_DRIVERS']}
summary_info += {'Block whitelist (rw)':
config_host['CONFIG_BDRV_RW_WHITELIST']}summary_info+= {'Block whitelist (ro)':
config_host['CONFIG_BDRV_RO_WHITELIST']} -summary_info += {'VirtFS support':config_host.has_key('CONFIG_VIRTFS')} +summary_info += {'VirtFS support':have_virtfs}summary_info+= {'build virtiofs daemon':have_virtiofsd}summary_info+= {'Multipath support':mpathpersist.found()}summary_info+= {'VNC support':vnc.found()}meson_options.txt +0
-4@@ -90,10 +90,6 @@ option('vnc_sasl', type : 'feature', value : 'auto', description: 'SASL authentication for VNC server') option('xkbcommon', type : 'feature', value : 'auto', description: 'xkbcommon support') -option('virtiofsd', type: 'feature', value: 'auto', - description: 'build virtiofs daemon (virtiofsd)') -option('vhost_user_blk_server', type: 'feature', value: 'auto', - description: 'build vhost-user-blk server') option('zstd', type : 'feature', value : 'auto', description: 'zstd compression support')option('fuse', type: 'feature', value: 'auto',
meson_options.txt +0
-0@@ -101,6 +97,13 @@ option('fuse', type: 'feature', value: 'auto', option('fuse_lseek', type : 'feature', value : 'auto', description: 'SEEK_HOLE/SEEK_DATA support for FUSE exports')meson_options.txt +7
-0+option('vhost_user_blk_server', type: 'feature', value: 'auto', + description: 'build vhost-user-blk server') +option('virtfs', type: 'feature', value: 'auto', + description: 'virtio-9p support') +option('virtiofsd', type: 'feature', value: 'auto', + description: 'build virtiofs daemon (virtiofsd)') +
Quoted 4 lines
option('capstone', type: 'combo', value: 'auto',
choices: ['disabled', 'enabled', 'auto', 'system', 'internal'],
description: 'Whether and how to find the capstone library')
I noticed that for me, this broke the building of virtfs-proxy-helper. I've not yet figured out what the fix should be, but thought you'd want to know.
-Bruce
Re: [PULL 50/55] virtfs: convert to meson
Quoted 3 lines · Bruce Rogers
I noticed that for me, this broke the building of virtfs-proxy-helper. I've not yet figured out what the fix should be, but thought you'd want to know.
Possibly:
fsdev/meson.build +1 -1
@@ -8,7 +8,7 @@ fsdev_ss.add(when: ['CONFIG_FSDEV_9P'], if_true: files( ), if_false: files('qemu-fsdev-dummy.c')) softmmu_ss.add_all(when: 'CONFIG_LINUX', if_true: fsdev_ss) -have_virtfs_proxy_helper = have_tools and libattr.found() and libcap_ng.found() and 'CONFIG_VIRTFS' in config_host +have_virtfs_proxy_helper = have_tools and libattr.found() and libcap_ng.found() and have_virtfs if have_virtfs_proxy_helper executable('virtfs-proxy-helper', files('virtfs-proxy-helper.c', '9p-marshal.c',
'9p-iov-marshal.c'),
tests/qtest/meson.build +3 -1
@@ -199,7 +199,9 @@ qos_test_ss.add( 'virtio-serial-test.c', 'vmxnet3-test.c', ) -qos_test_ss.add(when: 'CONFIG_VIRTFS', if_true: files('virtio-9p-test.c')) +if have_virtfs + qos_test_ss.add(files('virtio-9p-test.c')) +endif qos_test_ss.add(when: 'CONFIG_VHOST_USER', if_true:
files('vhost-user-test.c'))
tpmemu_files = ['tpm-emu.c', 'tpm-util.c', 'tpm-tests.c']
Since CONFIG_VIRTFS does not exist anymore. Sorry.
Paolo
Re: [PULL 50/55] virtfs: convert to meson
Quoted 42 lines · Paolo Bonzini
Quoted 5 lines · Bruce Rogers
I noticed that for me, this broke the building of virtfs-proxy- helper.
I've not yet figured out what the fix should be, but thought you'd want
to know.Possibly:
fsdev/meson.build +0
-0@@ -8,7 +8,7 @@ fsdev_ss.add(when: ['CONFIG_FSDEV_9P'], if_true:files(
),if_false: files('qemu-fsdev-dummy.c'))softmmu_ss.add_all(when: 'CONFIG_LINUX', if_true: fsdev_ss)-have_virtfs_proxy_helper =
have_toolsandlibattr.found()andlibcap_ng.found()and 'CONFIG_VIRTFS' inconfig_host+have_virtfs_proxy_helper =have_toolsandlibattr.found()andlibcap_ng.found()andhave_virtfs
ifhave_virtfs_proxy_helperexecutable('virtfs-proxy-helper',files('virtfs-proxy-helper.c', '9p-marshal.c', '9p-iov-marshal.c'),tests/qtest/meson.build +3
-1@@ -199,7 +199,9 @@ qos_test_ss.add( 'virtio-serial-test.c', 'vmxnet3-test.c', ) -qos_test_ss.add(when: 'CONFIG_VIRTFS', if_true: files('virtio-9p- test.c')) +if have_virtfs + qos_test_ss.add(files('virtio-9p-test.c')) +endifqos_test_ss.add(when: '
CONFIG_VHOST_USER',if_true:
files('vhost-user-test.c'))
Quoted 6 lines
tpmemu_files= ['tpm-emu.c', 'tpm-util.c', 'tpm-tests.c']Since
CONFIG_VIRTFSdoes not exist anymore. Sorry.Paolo
Looks like that solves the issue. Thanks.
- Bruce
[PULL 32/55] configure: remove useless code to check for Xen PCI passthrough
In reply to Paolo Bonzinimeson.build is already doing the same check, so remove it from configure.
--- configure | 12 ------------ 1 file changed, 12 deletions(-)
configure +0 -12
@@ -2877,18 +2877,6 @@ EOF fi fi -if test "$xen_pci_passthrough" != "disabled"; then - if test "$xen" = "enabled" && test "$linux" = "yes"; then - xen_pci_passthrough=enabled - else - if test "$xen_pci_passthrough" = "enabled"; then - error_exit "User requested feature Xen PCI Passthrough" \ - " but this feature requires /sys from Linux" - fi - xen_pci_passthrough=disabled - fi -fi - ########################################## # X11 probe if $pkg_config --exists "x11"; then
Signature · 1 line
2.29.2
[PULL 37/55] curl: remove compatibility code, require 7.29.0
In reply to Paolo BonzinicURL 7.16.0 was released in October 2006. Just remove code that is in all likelihood not being used anywhere, and require the oldest version found in currently supported distros, which is 7.29.0 from CentOS 7.
pkg-config is enough for QEMU, since it does not need extra information such as the path for certicate authorities. All supported platforms today will all have pkg-config for curl, so we can drop curl-config.
--- block/curl.c | 28 ---------------------------- configure | 9 ++------- 2 files changed, 2 insertions(+), 35 deletions(-)
block/curl.c +0 -28
@@ -37,26 +37,6 @@// #define DEBUG_VERBOSE -#if LIBCURL_VERSION_NUM >=0x071000 -/* The multi interface timer callback was introduced in 7.16.0 */ -#define NEED_CURL_TIMER_CALLBACK -#define HAVE_SOCKET_ACTION -#endif - -#ifndef HAVE_SOCKET_ACTION -/* If curl_multi_socket_action isn't available, define it statically here in -* terms of curl_multi_socket. Note that ev_bitmask will be ignored, which is -* less efficient but still safe. */ -static CURLMcode __curl_multi_socket_action (CURLM *multi_handle, -curl_socket_t sockfd, -int ev_bitmask, -int *running_handles) -{ -return curl_multi_socket (multi_handle, sockfd, running_handles); -} -#define curl_multi_socket_action __curl_multi_socket_action -#endif -#define PROTOCOLS (CURLPROTO_HTTP | CURLPROTO_HTTPS | \ CURLPROTO_FTP | CURLPROTO_FTPS)
@@ -140,7 +120,6 @@ typedef struct BDRVCURLState {static void curl_clean_state (CURLState *s);static void curl_multi_do (void *arg); -#ifdef NEED_CURL_TIMER_CALLBACK /* Called from curl_multi_do_locked, with s->mutex held. */ static int curl_timer_cb (CURLM *multi,long timeout_ms,void *opaque) {
@@ -156,7 +135,6 @@ static int curl_timer_cb(CURLM *multi, long timeout_ms, void *opaque) }return 0 ; } -#endif /* Called from curl_multi_do_locked, with s->mutex held. */ static int curl_sock_cb(CURL *curl, curl_socket_t fd, int action,
@@ -433,7 +411,6 @@ static void curl_multi_do(void *arg)static void curl_multi_timeout_do (void *arg) { -#ifdef NEED_CURL_TIMER_CALLBACK BDRVCURLState *s = (BDRVCURLState *)arg;int running;
@@ -446,9 +423,6 @@ static void curl_multi_timeout_do(void *arg)curl_multi_check_completion (s);qemu_mutex_unlock (&s->mutex); -#else -abort (); -#endif }/* Called with s->mutex held. */
@@ -598,10 +572,8 @@ static void curl_attach_aio_context(BlockDriverState *bs, s->multi =curl_multi_init (); s->aio_context = new_context;curl_multi_setopt (s->multi,CURLMOPT_SOCKETFUNCTION , curl_sock_cb); -#ifdef NEED_CURL_TIMER_CALLBACK curl_multi_setopt (s->multi,CURLMOPT_TIMERDATA , s);curl_multi_setopt (s->multi,CURLMOPT_TIMERFUNCTION , curl_timer_cb); -#endif }static QemuOptsList runtime_opts = {
configure +2 -7
@@ -3426,17 +3426,12 @@ done ########################################## # curl probe if test "$curl" != "no" ; then - if $pkg_config libcurl --exists; then - curlconfig="$pkg_config libcurl" - else - curlconfig=curl-config - fi cat > $TMPC << EOF #include <curl/curl.h> int main(void) { curl_easy_init(); curl_multi_setopt(0, 0, 0); return 0; } EOF - curl_cflags=$($curlconfig --cflags 2>/dev/null) - curl_libs=$($curlconfig --libs 2>/dev/null) + curl_cflags=$($pkg_config libcurl --cflags 2>/dev/null) + curl_libs=$($pkg_config libcurl --libs 2>/dev/null) if compile_prog "$curl_cflags" "$curl_libs" ; then curl=yes else
Signature · 1 line
2.29.2
[PULL 51/55] cap_ng: convert to meson
In reply to Paolo Bonzini--- configure | 34 ++++------------------------------ meson.build | 24 ++++++++++++++++++++---- meson_options.txt | 2 ++ tools/meson.build | 4 ++-- 4 files changed, 28 insertions(+), 36 deletions(-)
configure +4 -30
@@ -330,7 +330,7 @@ xen_ctrl_version="$default_feature" xen_pci_passthrough="auto" linux_aio="$default_feature" linux_io_uring="$default_feature" -cap_ng="$default_feature" +cap_ng="auto" attr="$default_feature" libattr="$default_feature" xfs="$default_feature"
@@ -1122,9 +1122,9 @@ for opt do ;; --enable-tcg-interpreter) tcg_interpreter="yes" ;; - --disable-cap-ng) cap_ng="no" + --disable-cap-ng) cap_ng="disabled" ;; - --enable-cap-ng) cap_ng="yes" + --enable-cap-ng) cap_ng="enabled" ;; --disable-tcg) tcg="disabled" ;;
@@ -3191,28 +3191,6 @@ EOF fi fi -########################################## -# libcap-ng library probe -if test "$cap_ng" != "no" ; then - cap_libs="-lcap-ng" - cat > $TMPC << EOF -#include <cap-ng.h> -int main(void) -{ - capng_capability_to_name(CAPNG_EFFECTIVE); - return 0; -} -EOF - if compile_prog "" "$cap_libs" ; then - cap_ng=yes - else - if test "$cap_ng" = "yes" ; then - feature_not_found "cap_ng" "Install libcap-ng devel" - fi - cap_ng=no - fi -fi - ########################################## # Sound support libraries probe
@@ -5669,10 +5647,6 @@ fi if test "$gprof" = "yes" ; then echo "CONFIG_GPROF=y" >> $config_host_mak fi -if test "$cap_ng" = "yes" ; then - echo "CONFIG_LIBCAP_NG=y" >> $config_host_mak - echo "LIBCAP_NG_LIBS=$cap_libs" >> $config_host_mak -fi echo "CONFIG_AUDIO_DRIVERS=$audio_drv_list" >> $config_host_mak for drv in $audio_drv_list; do def=CONFIG_AUDIO_$(echo $drv | LC_ALL=C tr '[a-z]' '[A-Z]')
@@ -6559,7 +6533,7 @@ NINJA=$ninja $meson setup \ -Dcurl=$curl -Dglusterfs=$glusterfs -Dbzip2=$bzip2 -Dlibiscsi=$libiscsi \ -Dlibnfs=$libnfs -Diconv=$iconv -Dcurses=$curses -Dlibudev=$libudev\ -Dlibssh=$libssh -Drbd=$rbd -Dlzo=$lzo -Dsnappy=$snappy -Dlzfse=$lzfse \ - -Dzstd=$zstd -Dseccomp=$seccomp -Dvirtfs=$virtfs \ + -Dzstd=$zstd -Dseccomp=$seccomp -Dvirtfs=$virtfs -Dcap_ng=$cap_ng \ -Ddocs=$docs -Dsphinx_build=$sphinx_build -Dinstall_blobs=$blobs \ -Dvhost_user_blk_server=$vhost_user_blk_server \ -Dfuse=$fuse -Dfuse_lseek=$fuse_lseek \
meson.build +20 -4
@@ -334,10 +334,25 @@ if not get_option('libiscsi').auto() or have_system or have_tools required: get_option('seccomp'), method: 'pkg-config', static: enable_static) endif -libcap_ng = not_found -if 'CONFIG_LIBCAP_NG' in config_host - libcap_ng = declare_dependency(link_args: config_host['LIBCAP_NG_LIBS'].split()) + +libcap_ng = cc.find_library('cap-ng', has_headers: ['cap-ng.h'], + required: get_option('cap_ng'), + static: enable_static) +if libcap_ng.found() and not cc.links(''' + #include <cap-ng.h> + int main(void) + { + capng_capability_to_name(CAPNG_EFFECTIVE); + return 0; + }''', dependencies: libcap_ng) + libcap_ng = not_found + if get_option('cap_ng').enabled() + error('could not link libcap-ng') + else + warning('could not link libcap-ng, disabling') + endif endif + if get_option('xkbcommon').auto() and not have_system and not have_tools xkbcommon = not_found else
@@ -1012,6 +1027,7 @@ if glusterfs.found() config_host_data.set('CONFIG_GLUSTERFS_FTRUNCATE_HAS_STAT', glusterfs_ftruncate_has_stat) config_host_data.set('CONFIG_GLUSTERFS_IOCB_HAS_STAT', glusterfs_iocb_has_stat) endif +config_host_data.set('CONFIG_LIBCAP_NG', libcap_ng.found()) config_host_data.set('CONFIG_LIBISCSI', libiscsi.found()) config_host_data.set('CONFIG_LIBNFS', libnfs.found()) config_host_data.set('CONFIG_LIBSSH', libssh.found())
@@ -2355,7 +2371,7 @@ summary_info += {'fdatasync': config_host.has_key('CONFIG_FDATASYNC')} summary_info += {'madvise': config_host.has_key('CONFIG_MADVISE')} summary_info += {'posix_madvise': config_host.has_key('CONFIG_POSIX_MADVISE')} summary_info += {'posix_memalign': config_host.has_key('CONFIG_POSIX_MEMALIGN')} -summary_info += {'libcap-ng support': config_host.has_key('CONFIG_LIBCAP_NG')} +summary_info += {'libcap-ng support': libcap_ng.found()} summary_info += {'vhost-kernel support': config_host.has_key('CONFIG_VHOST_KERNEL')} summary_info += {'vhost-net support': config_host.has_key('CONFIG_VHOST_NET')} summary_info += {'vhost-crypto support': config_host.has_key('CONFIG_VHOST_CRYPTO')}
meson_options.txt +2 -0
@@ -44,6 +44,8 @@ option('brlapi', type : 'feature', value : 'auto', description: 'brlapi character device driver') option('bzip2', type : 'feature', value : 'auto', description: 'bzip2 support for DMG images') +option('cap_ng', type : 'feature', value : 'auto', + description: 'cap_ng support') option('cocoa', type : 'feature', value : 'auto', description: 'Cocoa user interface (macOS only)') option('curl', type : 'feature', value : 'auto',
tools/meson.build +2 -2
@@ -1,14 +1,14 @@ have_virtiofsd = (targetos == 'linux' and have_tools and seccomp.found() and - 'CONFIG_LIBCAP_NG' in config_host and + libcap_ng.found() and 'CONFIG_VHOST_USER' in config_host) if get_option('virtiofsd').enabled() if not have_virtiofsd if targetos != 'linux' error('virtiofsd requires Linux') - elif not seccomp.found() or 'CONFIG_LIBCAP_NG' not in config_host + elif not seccomp.found() or not libcap_ng.found() error('virtiofsd requires libcap-ng-devel and seccomp-devel') elif not have_tools or 'CONFIG_VHOST_USER' not in config_host error('virtiofsd needs tools and vhost-user support')
Signature · 1 line
2.29.2
[PULL 27/55] meson: switch minimum meson version to 0.56.0
In reply to Paolo BonziniMeson 0.56.0 does not need b_staticpic=$pie anymore, and has stabilized the keyval module. Remove the workaround and use a few replacements for features deprecated in that release cycle.
--- configure | 5 ---- docs/meson.build | 12 ++++---- meson.build | 54 ++++++++++++++++------------------- plugins/meson.build | 4 +-- tests/meson.build | 2 +- tests/qapi-schema/meson.build | 4 +-- tests/qtest/meson.build | 2 +- trace/meson.build | 4 +-- 8 files changed, 39 insertions(+), 48 deletions(-)
configure +0 -5
@@ -6963,10 +6963,6 @@ fi mv $cross config-meson.cross rm -rf meson-private meson-info meson-logs -unset staticpic -if ! version_ge "$($meson --version)" 0.56.0; then - staticpic=$(if test "$pie" = yes; then echo true; else echo false; fi) -fi NINJA=$ninja $meson setup \ --prefix "$prefix" \ --libdir "$libdir" \
@@ -6986,7 +6982,6 @@ NINJA=$ninja $meson setup \ -Dwerror=$(if test "$werror" = yes; then echo true; else echo false; fi) \ -Dstrip=$(if test "$strip_opt" = yes; then echo true; else echo false; fi) \ -Db_pie=$(if test "$pie" = yes; then echo true; else echo false; fi) \ - ${staticpic:+-Db_staticpic=$staticpic} \ -Db_coverage=$(if test "$gcov" = yes; then echo true; else echo false; fi) \ -Db_lto=$lto -Dcfi=$cfi -Dcfi_debug=$cfi_debug \ -Dmalloc=$malloc -Dmalloc_trim=$malloc_trim -Dsparse=$sparse \
docs/meson.build +6 -6
@@ -38,12 +38,12 @@ endif if build_docs SPHINX_ARGS += ['-Dversion=' + meson.project_version(), '-Drelease=' + config_host['PKGVERSION']] - sphinx_extn_depends = [ meson.source_root() / 'docs/sphinx/depfile.py', - meson.source_root() / 'docs/sphinx/hxtool.py', - meson.source_root() / 'docs/sphinx/kerneldoc.py', - meson.source_root() / 'docs/sphinx/kernellog.py', - meson.source_root() / 'docs/sphinx/qapidoc.py', - meson.source_root() / 'docs/sphinx/qmp_lexer.py', + sphinx_extn_depends = [ meson.current_source_dir() / 'sphinx/depfile.py', + meson.current_source_dir() / 'sphinx/hxtool.py', + meson.current_source_dir() / 'sphinx/kerneldoc.py', + meson.current_source_dir() / 'sphinx/kernellog.py', + meson.current_source_dir() / 'sphinx/qapidoc.py', + meson.current_source_dir() / 'sphinx/qmp_lexer.py', qapi_gen_depends ] configure_file(output: 'index.html',
meson.build +25 -29
95 lines not on this page · raw message
plugins/meson.build +2 -2
@@ -1,7 +1,7 @@ if 'CONFIG_HAS_LD_DYNAMIC_LIST' in config_host - plugin_ldflags = ['-Wl,--dynamic-list=' + (meson.build_root() / 'qemu-plugins-ld.symbols')] + plugin_ldflags = ['-Wl,--dynamic-list=' + (meson.project_build_root() / 'qemu-plugins-ld.symbols')] elif 'CONFIG_HAS_LD_EXPORTED_SYMBOLS_LIST' in config_host - plugin_ldflags = ['-Wl,-exported_symbols_list,' + (meson.build_root() / 'qemu-plugins-ld64.symbols')] + plugin_ldflags = ['-Wl,-exported_symbols_list,' + (meson.project_build_root() / 'qemu-plugins-ld64.symbols')] else plugin_ldflags = [] endif
tests/meson.build +1 -1
@@ -113,7 +113,7 @@ tests = { 'test-keyval': [testqapi], 'test-logging': [], 'test-uuid': [], - 'ptimer-test': ['ptimer-test-stubs.c', meson.source_root() / 'hw/core/ptimer.c'], + 'ptimer-test': ['ptimer-test-stubs.c', meson.project_source_root() / 'hw/core/ptimer.c'], 'test-qapi-util': [], }
tests/qapi-schema/meson.build +2 -2
@@ -1,5 +1,5 @@ test_env = environment() -test_env.set('PYTHONPATH', meson.source_root() / 'scripts') +test_env.set('PYTHONPATH', meson.project_source_root() / 'scripts') test_env.set('PYTHONIOENCODING', 'utf-8') schemas = [
@@ -240,7 +240,7 @@ if build_docs # clutter up the build dir with the cache. command: [SPHINX_ARGS, '-b', 'text', '-E', - '-c', meson.source_root() / 'docs', + '-c', meson.project_source_root() / 'docs', '-D', 'master_doc=doc-good', meson.current_source_dir(), meson.current_build_dir()])
tests/qtest/meson.build +1 -1
@@ -237,7 +237,7 @@ foreach dir : target_dirs qtest_env.set('QTEST_QEMU_IMG', './qemu-img') test_deps += [qemu_img] endif - qtest_env.set('G_TEST_DBUS_DAEMON', meson.source_root() / 'tests/dbus-vmstate-daemon.sh') + qtest_env.set('G_TEST_DBUS_DAEMON', meson.project_source_root() / 'tests/dbus-vmstate-daemon.sh') qtest_env.set('QTEST_QEMU_BINARY', './qemu-system-' + target_base) foreach test : target_qtests
trace/meson.build +2 -2
@@ -2,7 +2,7 @@ specific_ss.add(files('control-target.c')) trace_events_files = [] foreach dir : [ '.' ] + trace_events_subdirs - trace_events_file = meson.source_root() / dir / 'trace-events' + trace_events_file = meson.project_source_root() / dir / 'trace-events' trace_events_files += [ trace_events_file ] group_name = dir == '.' ? 'root' : dir.underscorify() group = '--group=' + group_name
@@ -68,7 +68,7 @@ foreach d : [ ] gen = custom_target(d[0], output: d[0], - input: meson.source_root() / 'trace-events', + input: meson.project_source_root() / 'trace-events', command: [ tracetool, '--group=root', '--format=@0@'.format(d[1]), '@INPUT@' ], capture: true) specific_ss.add(when: 'CONFIG_TCG', if_true: gen)
Signature · 1 line
2.29.2
[PULL 36/55] brlapi: convert to meson
In reply to Paolo Bonzini--- chardev/meson.build | 2 +- configure | 32 ++++---------------------------- meson.build | 20 +++++++++++++++++--- meson_options.txt | 2 ++ 4 files changed, 24 insertions(+), 32 deletions(-)
chardev/meson.build +1 -1
@@ -29,7 +29,7 @@ softmmu_ss.add(files('msmouse.c', 'wctablet.c', 'testdev.c')) chardev_modules = {} -if config_host.has_key('CONFIG_BRLAPI') +if brlapi.found() module_ss = ss.source_set() module_ss.add(when: [brlapi], if_true: [files('baum.c'), pixman]) chardev_modules += { 'baum': module_ss }
configure +4 -28
@@ -305,7 +305,7 @@ for opt do esac done -brlapi="$default_feature" +brlapi="auto" curl="$default_feature" iconv="auto" curses="auto"
@@ -1104,9 +1104,9 @@ for opt do ;; --enable-xen-pci-passthrough) xen_pci_passthrough="enabled" ;; - --disable-brlapi) brlapi="no" + --disable-brlapi) brlapi="disabled" ;; - --enable-brlapi) brlapi="yes" + --enable-brlapi) brlapi="enabled" ;; --disable-kvm) kvm="disabled" ;;
@@ -3423,26 +3423,6 @@ for drv in $audio_drv_list; do esac done -########################################## -# BrlAPI probe - -if test "$brlapi" != "no" ; then - brlapi_libs="-lbrlapi" - cat > $TMPC << EOF -#include <brlapi.h> -#include <stddef.h> -int main( void ) { return brlapi__openConnection (NULL, NULL, NULL); } -EOF - if compile_prog "" "$brlapi_libs" ; then - brlapi=yes - else - if test "$brlapi" = "yes" ; then - feature_not_found "brlapi" "Install brlapi devel" - fi - brlapi=no - fi -fi - ########################################## # curl probe if test "$curl" != "no" ; then
@@ -6132,10 +6112,6 @@ if test "$curl" = "yes" ; then echo "CURL_CFLAGS=$curl_cflags" >> $config_host_mak echo "CURL_LIBS=$curl_libs" >> $config_host_mak fi -if test "$brlapi" = "yes" ; then - echo "CONFIG_BRLAPI=y" >> $config_host_mak - echo "BRLAPI_LIBS=$brlapi_libs" >> $config_host_mak -fi if test "$gtk" = "yes" ; then echo "CONFIG_GTK=y" >> $config_host_mak echo "GTK_CFLAGS=$gtk_cflags" >> $config_host_mak
@@ -6969,7 +6945,7 @@ NINJA=$ninja $meson setup \ -Dcocoa=$cocoa -Dmpath=$mpath -Dsdl=$sdl -Dsdl_image=$sdl_image \ -Dvnc=$vnc -Dvnc_sasl=$vnc_sasl -Dvnc_jpeg=$vnc_jpeg -Dvnc_png=$vnc_png \ -Dgettext=$gettext -Dxkbcommon=$xkbcommon -Du2f=$u2f -Dvirtiofsd=$virtiofsd \ - -Dcapstone=$capstone -Dslirp=$slirp -Dfdt=$fdt \ + -Dcapstone=$capstone -Dslirp=$slirp -Dfdt=$fdt -Dbrlapi=$brlapi \ -Diconv=$iconv -Dcurses=$curses -Dlibudev=$libudev\ -Ddocs=$docs -Dsphinx_build=$sphinx_build -Dinstall_blobs=$blobs \ -Dvhost_user_blk_server=$vhost_user_blk_server \
meson.build +17 -3
@@ -570,8 +570,21 @@ if have_system and not get_option('curses').disabled() endif brlapi = not_found -if 'CONFIG_BRLAPI' in config_host - brlapi = declare_dependency(link_args: config_host['BRLAPI_LIBS'].split()) +if not get_option('brlapi').auto() or have_system + brlapi = cc.find_library('brlapi', has_headers: ['brlapi.h'], + required: get_option('brlapi'), + static: enable_static) + if brlapi.found() and not cc.links(''' + #include <brlapi.h> + #include <stddef.h> + int main(void) { return brlapi__openConnection (NULL, NULL, NULL); }''', dependencies: brlapi) + brlapi = not_found + if get_option('brlapi').enabled() + error('could not link brlapi') + else + warning('could not link brlapi, disabling') + endif + endif endif sdl = not_found
@@ -854,6 +867,7 @@ config_host_data.set_quoted('CONFIG_QEMU_LOCALSTATEDIR', get_option('prefix') / config_host_data.set_quoted('CONFIG_QEMU_MODDIR', get_option('prefix') / qemu_moddir) config_host_data.set_quoted('CONFIG_SYSCONFDIR', get_option('prefix') / get_option('sysconfdir')) +config_host_data.set('CONFIG_BRLAPI', brlapi.found()) config_host_data.set('CONFIG_COCOA', cocoa.found()) config_host_data.set('CONFIG_LIBUDEV', libudev.found()) config_host_data.set('CONFIG_MPATH', mpathpersist.found())
@@ -2165,7 +2179,7 @@ summary_info += {'xen support': config_host.has_key('CONFIG_XEN_BACKEND')} if config_host.has_key('CONFIG_XEN_BACKEND') summary_info += {'xen ctrl version': config_host['CONFIG_XEN_CTRL_INTERFACE_VERSION']} endif -summary_info += {'brlapi support': config_host.has_key('CONFIG_BRLAPI')} +summary_info += {'brlapi support': brlapi.found()} summary_info += {'Documentation': build_docs} summary_info += {'PIE': get_option('b_pie')} summary_info += {'vde support': config_host.has_key('CONFIG_VDE')}
meson_options.txt +2 -0
@@ -40,6 +40,8 @@ option('cfi', type: 'boolean', value: 'false', option('cfi_debug', type: 'boolean', value: 'false', description: 'Verbose errors in case of CFI violation') +option('brlapi', type : 'feature', value : 'auto', + description: 'brlapi character device driver') option('cocoa', type : 'feature', value : 'auto', description: 'Cocoa user interface (macOS only)') option('mpath', type : 'feature', value : 'auto',
Signature · 1 line
2.29.2
[PULL 52/55] libattr: convert to meson
In reply to Paolo Bonzini--- configure | 45 ++++----------------------------------------- meson.build | 38 +++++++++++++++++++++++++++++++++++--- meson_options.txt | 2 ++ 3 files changed, 41 insertions(+), 44 deletions(-)
configure +4 -41
@@ -331,8 +331,7 @@ xen_pci_passthrough="auto" linux_aio="$default_feature" linux_io_uring="$default_feature" cap_ng="auto" -attr="$default_feature" -libattr="$default_feature" +attr="auto" xfs="$default_feature" tcg="enabled" membarrier="$default_feature"
@@ -1229,9 +1228,9 @@ for opt do ;; --enable-linux-io-uring) linux_io_uring="yes" ;; - --disable-attr) attr="no" + --disable-attr) attr="disabled" ;; - --enable-attr) attr="yes" + --enable-attr) attr="enabled" ;; --disable-membarrier) membarrier="no" ;;
@@ -3542,36 +3541,6 @@ elif test "$tpm" = "yes"; then fi fi -########################################## -# attr probe - -libattr_libs= -if test "$attr" != "no" ; then - cat > $TMPC <<EOF -#include <stdio.h> -#include <sys/types.h> -#ifdef CONFIG_LIBATTR -#include <attr/xattr.h> -#else -#include <sys/xattr.h> -#endif -int main(void) { getxattr(NULL, NULL, NULL, 0); setxattr(NULL, NULL, NULL, 0, 0); return 0; } -EOF - if compile_prog "" "" ; then - attr=yes - # Older distros have <attr/xattr.h>, and need -lattr: - elif compile_prog "-DCONFIG_LIBATTR" "-lattr" ; then - attr=yes - libattr_libs="-lattr" - libattr=yes - else - if test "$attr" = "yes" ; then - feature_not_found "ATTR" "Install libc6 or libattr devel" - fi - attr=no - fi -fi - ########################################## # iovec probe cat > $TMPC <<EOF
@@ -5866,13 +5835,6 @@ if test "$linux_io_uring" = "yes" ; then echo "LINUX_IO_URING_CFLAGS=$linux_io_uring_cflags" >> $config_host_mak echo "LINUX_IO_URING_LIBS=$linux_io_uring_libs" >> $config_host_mak fi -if test "$attr" = "yes" ; then - echo "CONFIG_ATTR=y" >> $config_host_mak - echo "LIBATTR_LIBS=$libattr_libs" >> $config_host_mak -fi -if test "$libattr" = "yes" ; then - echo "CONFIG_LIBATTR=y" >> $config_host_mak -fi if test "$vhost_scsi" = "yes" ; then echo "CONFIG_VHOST_SCSI=y" >> $config_host_mak fi
@@ -6534,6 +6496,7 @@ NINJA=$ninja $meson setup \ -Dlibnfs=$libnfs -Diconv=$iconv -Dcurses=$curses -Dlibudev=$libudev\ -Dlibssh=$libssh -Drbd=$rbd -Dlzo=$lzo -Dsnappy=$snappy -Dlzfse=$lzfse \ -Dzstd=$zstd -Dseccomp=$seccomp -Dvirtfs=$virtfs -Dcap_ng=$cap_ng \ + -Dattr=$attr \ -Ddocs=$docs -Dsphinx_build=$sphinx_build -Dinstall_blobs=$blobs \ -Dvhost_user_blk_server=$vhost_user_blk_server \ -Dfuse=$fuse -Dfuse_lseek=$fuse_lseek \
meson.build +35 -3
@@ -324,10 +324,40 @@ if not get_option('libnfs').auto() or have_block required: get_option('libnfs'), method: 'pkg-config', static: enable_static) endif + +libattr_test = ''' + #include <stddef.h> + #include <sys/types.h> + #ifdef CONFIG_LIBATTR + #include <attr/xattr.h> + #else + #include <sys/xattr.h> + #endif + int main(void) { getxattr(NULL, NULL, NULL, 0); setxattr(NULL, NULL, NULL, 0, 0); return 0; }''' + libattr = not_found -if 'CONFIG_ATTR' in config_host - libattr = declare_dependency(link_args: config_host['LIBATTR_LIBS'].split()) +have_old_libattr = false +if not get_option('attr').disabled() + if cc.links(libattr_test) + libattr = declare_dependency() + else + libattr = cc.find_library('attr', has_headers: ['attr/xattr.h'], + required: get_option('attr'), + static: enable_static) + if libattr.found() and not \ + cc.links(libattr_test, dependencies: libattr, args: '-DCONFIG_LIBATTR') + libattr = not_found + if get_option('attr').enabled() + error('could not link libattr') + else + warning('could not link libattr, disabling') + endif + else + have_old_libattr = libattr.found() + endif + endif endif + seccomp = not_found if not get_option('libiscsi').auto() or have_system or have_tools seccomp = dependency('libseccomp', version: '>=2.3.0',
@@ -1010,6 +1040,7 @@ config_host_data.set_quoted('CONFIG_QEMU_LOCALSTATEDIR', get_option('prefix') / config_host_data.set_quoted('CONFIG_QEMU_MODDIR', get_option('prefix') / qemu_moddir) config_host_data.set_quoted('CONFIG_SYSCONFDIR', get_option('prefix') / get_option('sysconfdir')) +config_host_data.set('CONFIG_ATTR', libattr.found()) config_host_data.set('CONFIG_BRLAPI', brlapi.found()) config_host_data.set('CONFIG_COCOA', cocoa.found()) config_host_data.set('CONFIG_LIBUDEV', libudev.found())
@@ -1027,6 +1058,7 @@ if glusterfs.found() config_host_data.set('CONFIG_GLUSTERFS_FTRUNCATE_HAS_STAT', glusterfs_ftruncate_has_stat) config_host_data.set('CONFIG_GLUSTERFS_IOCB_HAS_STAT', glusterfs_iocb_has_stat) endif +config_host_data.set('CONFIG_LIBATTR', have_old_libattr) config_host_data.set('CONFIG_LIBCAP_NG', libcap_ng.found()) config_host_data.set('CONFIG_LIBISCSI', libiscsi.found()) config_host_data.set('CONFIG_LIBNFS', libnfs.found())
@@ -2350,7 +2382,7 @@ summary_info += {'vde support': config_host.has_key('CONFIG_VDE')} summary_info += {'netmap support': config_host.has_key('CONFIG_NETMAP')} summary_info += {'Linux AIO support': config_host.has_key('CONFIG_LINUX_AIO')} summary_info += {'Linux io_uring support': config_host.has_key('CONFIG_LINUX_IO_URING')} -summary_info += {'ATTR/XATTR support': config_host.has_key('CONFIG_ATTR')} +summary_info += {'ATTR/XATTR support': libattr.found()} summary_info += {'Install blobs': get_option('install_blobs')} summary_info += {'KVM support': config_all.has_key('CONFIG_KVM')} summary_info += {'HAX support': config_all.has_key('CONFIG_HAX')}
meson_options.txt +2 -0
@@ -40,6 +40,8 @@ option('cfi', type: 'boolean', value: 'false', option('cfi_debug', type: 'boolean', value: 'false', description: 'Verbose errors in case of CFI violation') +option('attr', type : 'feature', value : 'auto', + description: 'attr/xattr support') option('brlapi', type : 'feature', value : 'auto', description: 'brlapi character device driver') option('bzip2', type : 'feature', value : 'auto',
Signature · 1 line
2.29.2
[PULL 34/55] configure: accept --enable-slirp
In reply to Paolo BonziniMeson understands -Dslirp=enabled, so there is no reason not to accept the configure option as well.
--- configure | 2 ++ 1 file changed, 2 insertions(+)
configure +2 -0
@@ -1082,6 +1082,8 @@ for opt do ;; --disable-slirp) slirp="disabled" ;; + --enable-slirp) slirp="enabled" + ;; --enable-slirp=git) slirp="internal" ;; --enable-slirp=system) slirp="system"
Signature · 1 line
2.29.2
[PULL 43/55] libssh: convert to meson
In reply to Paolo Bonzini--- configure | 45 ++++----------------------------------------- meson.build | 22 ++++++++++++++++++---- meson_options.txt | 2 ++ 3 files changed, 24 insertions(+), 45 deletions(-)
configure +4 -41
@@ -429,7 +429,7 @@ auth_pam="$default_feature" vte="$default_feature" virglrenderer="$default_feature" tpm="$default_feature" -libssh="$default_feature" +libssh="auto" live_block_migration=${default_feature:-yes} numa="$default_feature" tcmalloc="no"
@@ -1423,9 +1423,9 @@ for opt do ;; --enable-tpm) tpm="yes" ;; - --disable-libssh) libssh="no" + --disable-libssh) libssh="disabled" ;; - --enable-libssh) libssh="yes" + --enable-libssh) libssh="enabled" ;; --disable-live-block-migration) live_block_migration="no" ;;
@@ -3628,38 +3628,6 @@ EOF fi fi -########################################## -# libssh probe -if test "$libssh" != "no" ; then - if $pkg_config --exists libssh; then - libssh_cflags=$($pkg_config libssh --cflags) - libssh_libs=$($pkg_config libssh --libs) - libssh=yes - else - if test "$libssh" = "yes" ; then - error_exit "libssh required for --enable-libssh" - fi - libssh=no - fi -fi - -########################################## -# Check for libssh 0.8 -# This is done like this instead of using the LIBSSH_VERSION_* and -# SSH_VERSION_* macros because some distributions in the past shipped -# snapshots of the future 0.8 from Git, and those snapshots did not -# have updated version numbers (still referring to 0.7.0). - -if test "$libssh" = "yes"; then - cat > $TMPC <<EOF -#include <libssh/libssh.h> -int main(void) { return ssh_get_server_publickey(NULL, NULL); } -EOF - if compile_prog "$libssh_cflags" "$libssh_libs"; then - libssh_cflags="-DHAVE_LIBSSH_0_8 $libssh_cflags" - fi -fi - ########################################## # linux-aio probe
@@ -6286,12 +6254,6 @@ if test "$getauxval" = "yes" ; then echo "CONFIG_GETAUXVAL=y" >> $config_host_mak fi -if test "$libssh" = "yes" ; then - echo "CONFIG_LIBSSH=y" >> $config_host_mak - echo "LIBSSH_CFLAGS=$libssh_cflags" >> $config_host_mak - echo "LIBSSH_LIBS=$libssh_libs" >> $config_host_mak -fi - if test "$live_block_migration" = "yes" ; then echo "CONFIG_LIVE_BLOCK_MIGRATION=y" >> $config_host_mak fi
@@ -6762,6 +6724,7 @@ NINJA=$ninja $meson setup \ -Dcapstone=$capstone -Dslirp=$slirp -Dfdt=$fdt -Dbrlapi=$brlapi \ -Dcurl=$curl -Dglusterfs=$glusterfs -Dbzip2=$bzip2 -Dlibiscsi=$libiscsi \ -Dlibnfs=$libnfs -Diconv=$iconv -Dcurses=$curses -Dlibudev=$libudev\ + -Dlibssh=$libssh \ -Ddocs=$docs -Dsphinx_build=$sphinx_build -Dinstall_blobs=$blobs \ -Dvhost_user_blk_server=$vhost_user_blk_server \ -Dfuse=$fuse -Dfuse_lseek=$fuse_lseek \
meson.build +18 -4
@@ -652,9 +652,21 @@ if not get_option('glusterfs').auto() or have_block endif endif libssh = not_found -if 'CONFIG_LIBSSH' in config_host - libssh = declare_dependency(compile_args: config_host['LIBSSH_CFLAGS'].split(), - link_args: config_host['LIBSSH_LIBS'].split()) +have_libssh_0_8 = false +if not get_option('libssh').auto() or have_block + libssh = dependency('libssh', + required: get_option('libssh'), + method: 'pkg-config', static: enable_static) + # This is done like this instead of using the LIBSSH_VERSION_* and + # SSH_VERSION_* macros because some distributions in the past shipped + # snapshots of the future 0.8 from Git, and those snapshots did not + # have updated version numbers (still referring to 0.7.0). + if libssh.found() + have_libssh_0_8 = cc.links(''' + #include <libssh/libssh.h> + int main(void) { return ssh_get_server_publickey(NULL, NULL); } + ''', dependencies: libssh) + endif endif libbzip2 = not_found if not get_option('bzip2').auto() or have_block
@@ -933,6 +945,8 @@ if glusterfs.found() endif config_host_data.set('CONFIG_LIBISCSI', libiscsi.found()) config_host_data.set('CONFIG_LIBNFS', libnfs.found()) +config_host_data.set('CONFIG_LIBSSH', libssh.found()) +config_host_data.set('HAVE_LIBSSH_0_8', have_libssh_0_8) config_host_data.set('CONFIG_SDL', sdl.found()) config_host_data.set('CONFIG_SDL_IMAGE', sdl_image.found()) config_host_data.set('CONFIG_VHOST_USER_BLK_SERVER', have_vhost_user_blk_server)
@@ -2313,7 +2327,7 @@ summary_info += {'crypto afalg': config_host.has_key('CONFIG_AF_ALG')} summary_info += {'GlusterFS support': glusterfs.found()} summary_info += {'gcov': get_option('b_coverage')} summary_info += {'TPM support': config_host.has_key('CONFIG_TPM')} -summary_info += {'libssh support': config_host.has_key('CONFIG_LIBSSH')} +summary_info += {'libssh support': libssh.found()} summary_info += {'QOM debugging': config_host.has_key('CONFIG_QOM_CAST_DEBUG')} summary_info += {'Live block migration': config_host.has_key('CONFIG_LIVE_BLOCK_MIGRATION')} summary_info += {'lzo support': config_host.has_key('CONFIG_LZO')}
meson_options.txt +2 -0
@@ -54,6 +54,8 @@ option('libiscsi', type : 'feature', value : 'auto', description: 'libiscsi userspace initiator') option('libnfs', type : 'feature', value : 'auto', description: 'libnfs block device driver') +option('libssh', type : 'feature', value : 'auto', + description: 'libssh block device driver') option('mpath', type : 'feature', value : 'auto', description: 'Multipath persistent reservation passthrough') option('iconv', type : 'feature', value : 'auto',
Signature · 1 line
2.29.2
[PULL 55/55] win32: drop fd registration to the main-loop on setting non-block
In reply to Paolo BonziniFrom: Marc-André Lureau <[email protected]>
Low-level fd users from QEMU use aio_set_fd_handler(), which handles event registration with the main loop; qemu_fd_register() is only needed together with the main loop's poll notifiers, of which SLIRP is the only user.
This removes a dependency from oslib-win32.c to main-loop.c.
Message-Id: <[email protected]>
--- util/oslib-win32.c | 1 - 1 file changed, 1 deletion(-)
util/oslib-win32.c +0 -1
@@ -221,7 +221,6 @@ int qemu_try_set_nonblock(int fd)if (ioctlsocket (fd,FIONBIO , &opt) !=NO_ERROR ) {return -socket_error (); } -qemu_fd_register (fd);return 0 ; }
Signature · 1 line
2.29.2
[PULL 40/55] bzip2: convert to meson
In reply to Paolo Bonzini--- configure | 31 ++++--------------------------- meson.build | 18 +++++++++++++++--- meson_options.txt | 2 ++ 3 files changed, 21 insertions(+), 30 deletions(-)
configure +4 -27
@@ -395,7 +395,7 @@ avx2_opt="$default_feature" capstone="auto" lzo="$default_feature" snappy="$default_feature" -bzip2="$default_feature" +bzip2="auto" lzfse="$default_feature" zstd="$default_feature" guest_agent="$default_feature"
@@ -1319,9 +1319,9 @@ for opt do ;; --enable-snappy) snappy="yes" ;; - --disable-bzip2) bzip2="no" + --disable-bzip2) bzip2="disabled" ;; - --enable-bzip2) bzip2="yes" + --enable-bzip2) bzip2="enabled" ;; --enable-lzfse) lzfse="yes" ;;
@@ -2494,24 +2494,6 @@ EOF fi fi -########################################## -# bzip2 check - -if test "$bzip2" != "no" ; then - cat > $TMPC << EOF -#include <bzlib.h> -int main(void) { BZ2_bzlibVersion(); return 0; } -EOF - if compile_prog "" "-lbz2" ; then - bzip2="yes" - else - if test "$bzip2" = "yes"; then - feature_not_found "libbzip2" "Install libbzip2 devel" - fi - bzip2="no" - fi -fi - ########################################## # lzfse check
@@ -6236,11 +6218,6 @@ if test "$snappy" = "yes" ; then echo "SNAPPY_LIBS=$snappy_libs" >> $config_host_mak fi -if test "$bzip2" = "yes" ; then - echo "CONFIG_BZIP2=y" >> $config_host_mak - echo "BZIP2_LIBS=-lbz2" >> $config_host_mak -fi - if test "$lzfse" = "yes" ; then echo "CONFIG_LZFSE=y" >> $config_host_mak echo "LZFSE_LIBS=-llzfse" >> $config_host_mak
@@ -6823,7 +6800,7 @@ NINJA=$ninja $meson setup \ -Dvnc=$vnc -Dvnc_sasl=$vnc_sasl -Dvnc_jpeg=$vnc_jpeg -Dvnc_png=$vnc_png \ -Dgettext=$gettext -Dxkbcommon=$xkbcommon -Du2f=$u2f -Dvirtiofsd=$virtiofsd \ -Dcapstone=$capstone -Dslirp=$slirp -Dfdt=$fdt -Dbrlapi=$brlapi \ - -Dcurl=$curl -Dglusterfs=$glusterfs \ + -Dcurl=$curl -Dglusterfs=$glusterfs -Dbzip2=$bzip2 \ -Diconv=$iconv -Dcurses=$curses -Dlibudev=$libudev\ -Ddocs=$docs -Dsphinx_build=$sphinx_build -Dinstall_blobs=$blobs \ -Dvhost_user_blk_server=$vhost_user_blk_server \
meson.build +15 -3
@@ -654,8 +654,20 @@ if 'CONFIG_LIBSSH' in config_host link_args: config_host['LIBSSH_LIBS'].split()) endif libbzip2 = not_found -if 'CONFIG_BZIP2' in config_host - libbzip2 = declare_dependency(link_args: config_host['BZIP2_LIBS'].split()) +if not get_option('bzip2').auto() or have_block + libbzip2 = cc.find_library('bz2', has_headers: ['bzlib.h'], + required: get_option('bzip2'), + static: enable_static) + if libbzip2.found() and not cc.links(''' + #include <bzlib.h> + int main(void) { BZ2_bzlibVersion(); return 0; }''', dependencies: libbzip2) + libbzip2 = not_found + if get_option('bzip2').enabled() + error('could not link libbzip2') + else + warning('could not link libbzip2, disabling') + endif + endif endif liblzfse = not_found if 'CONFIG_LZFSE' in config_host
@@ -2301,7 +2313,7 @@ summary_info += {'QOM debugging': config_host.has_key('CONFIG_QOM_CAST_DEBUG summary_info += {'Live block migration': config_host.has_key('CONFIG_LIVE_BLOCK_MIGRATION')} summary_info += {'lzo support': config_host.has_key('CONFIG_LZO')} summary_info += {'snappy support': config_host.has_key('CONFIG_SNAPPY')} -summary_info += {'bzip2 support': config_host.has_key('CONFIG_BZIP2')} +summary_info += {'bzip2 support': libbzip2.found()} summary_info += {'lzfse support': config_host.has_key('CONFIG_LZFSE')} summary_info += {'zstd support': config_host.has_key('CONFIG_ZSTD')} summary_info += {'NUMA host support': config_host.has_key('CONFIG_NUMA')}
meson_options.txt +2 -0
@@ -42,6 +42,8 @@ option('cfi_debug', type: 'boolean', value: 'false', option('brlapi', type : 'feature', value : 'auto', description: 'brlapi character device driver') +option('bzip2', type : 'feature', value : 'auto', + description: 'bzip2 support for DMG images') option('cocoa', type : 'feature', value : 'auto', description: 'Cocoa user interface (macOS only)') option('curl', type : 'feature', value : 'auto',
Signature · 1 line
2.29.2
[PULL 49/55] seccomp: convert to meson
In reply to Paolo Bonzini--- configure | 32 ++++---------------------------- meson.build | 10 ++++++---- meson_options.txt | 2 ++ softmmu/meson.build | 2 +- softmmu/qemu-seccomp.c | 2 -- tools/meson.build | 4 ++-- 6 files changed, 15 insertions(+), 37 deletions(-)
configure +4 -28
@@ -413,7 +413,7 @@ debug_stack_usage="no" crypto_afalg="no" cfi="false" cfi_debug="false" -seccomp="$default_feature" +seccomp="auto" glusterfs="auto" gtk="$default_feature" gtk_gl="no"
@@ -1355,9 +1355,9 @@ for opt do ;; --disable-tools) want_tools="no" ;; - --enable-seccomp) seccomp="yes" + --enable-seccomp) seccomp="enabled" ;; - --disable-seccomp) seccomp="no" + --disable-seccomp) seccomp="disabled" ;; --disable-glusterfs) glusterfs="disabled" ;;
@@ -2456,24 +2456,6 @@ EOF fi fi -########################################## -# libseccomp check - -if test "$seccomp" != "no" ; then - libseccomp_minver="2.3.0" - if $pkg_config --atleast-version=$libseccomp_minver libseccomp ; then - seccomp_cflags="$($pkg_config --cflags libseccomp)" - seccomp_libs="$($pkg_config --libs libseccomp)" - seccomp="yes" - else - if test "$seccomp" = "yes" ; then - feature_not_found "libseccomp" \ - "Install libseccomp devel >= $libseccomp_minver" - fi - seccomp="no" - fi -fi - ########################################## # xen probe
@@ -6051,12 +6033,6 @@ if test "$avx512f_opt" = "yes" ; then echo "CONFIG_AVX512F_OPT=y" >> $config_host_mak fi -if test "$seccomp" = "yes"; then - echo "CONFIG_SECCOMP=y" >> $config_host_mak - echo "SECCOMP_CFLAGS=$seccomp_cflags" >> $config_host_mak - echo "SECCOMP_LIBS=$seccomp_libs" >> $config_host_mak -fi - # XXX: suppress that if [ "$bsd" = "yes" ] ; then echo "CONFIG_BSD=y" >> $config_host_mak
@@ -6604,7 +6580,7 @@ NINJA=$ninja $meson setup \ -Dcurl=$curl -Dglusterfs=$glusterfs -Dbzip2=$bzip2 -Dlibiscsi=$libiscsi \ -Dlibnfs=$libnfs -Diconv=$iconv -Dcurses=$curses -Dlibudev=$libudev\ -Dlibssh=$libssh -Drbd=$rbd -Dlzo=$lzo -Dsnappy=$snappy -Dlzfse=$lzfse \ - -Dzstd=$zstd \ + -Dzstd=$zstd -Dseccomp=$seccomp \ -Ddocs=$docs -Dsphinx_build=$sphinx_build -Dinstall_blobs=$blobs \ -Dvhost_user_blk_server=$vhost_user_blk_server \ -Dfuse=$fuse -Dfuse_lseek=$fuse_lseek \
meson.build +6 -4
@@ -329,9 +329,10 @@ if 'CONFIG_ATTR' in config_host libattr = declare_dependency(link_args: config_host['LIBATTR_LIBS'].split()) endif seccomp = not_found -if 'CONFIG_SECCOMP' in config_host - seccomp = declare_dependency(compile_args: config_host['SECCOMP_CFLAGS'].split(), - link_args: config_host['SECCOMP_LIBS'].split()) +if not get_option('libiscsi').auto() or have_system or have_tools + seccomp = dependency('libseccomp', version: '>=2.3.0', + required: get_option('seccomp'), + method: 'pkg-config', static: enable_static) endif libcap_ng = not_found if 'CONFIG_LIBCAP_NG' in config_host
@@ -999,6 +1000,7 @@ config_host_data.set('HAVE_LIBSSH_0_8', have_libssh_0_8) config_host_data.set('CONFIG_RBD', rbd.found()) config_host_data.set('CONFIG_SDL', sdl.found()) config_host_data.set('CONFIG_SDL_IMAGE', sdl_image.found()) +config_host_data.set('CONFIG_SECCOMP', seccomp.found()) config_host_data.set('CONFIG_SNAPPY', snappy.found()) config_host_data.set('CONFIG_VHOST_USER_BLK_SERVER', have_vhost_user_blk_server) config_host_data.set('CONFIG_VNC', vnc.found())
@@ -2368,7 +2370,7 @@ if targetos == 'windows' summary_info += {'QGA w32 disk info': config_host.has_key('CONFIG_QGA_NTDDSCSI')} summary_info += {'QGA MSI support': config_host.has_key('CONFIG_QGA_MSI')} endif -summary_info += {'seccomp support': config_host.has_key('CONFIG_SECCOMP')} +summary_info += {'seccomp support': seccomp.found()} summary_info += {'CFI support': get_option('cfi')} summary_info += {'CFI debug support': get_option('cfi_debug')} summary_info += {'coroutine backend': config_host['CONFIG_COROUTINE_BACKEND']}
meson_options.txt +2 -0
@@ -74,6 +74,8 @@ option('sdl', type : 'feature', value : 'auto', description: 'SDL user interface') option('sdl_image', type : 'feature', value : 'auto', description: 'SDL Image support for icons') +option('seccomp', type : 'feature', value : 'auto', + description: 'seccomp support') option('snappy', type : 'feature', value : 'auto', description: 'snappy compression support') option('u2f', type : 'feature', value : 'auto',
softmmu/meson.build +1 -1
@@ -28,5 +28,5 @@ softmmu_ss.add(files( ), sdl, libpmem, libdaxctl) softmmu_ss.add(when: 'CONFIG_TPM', if_true: files('tpm.c')) -softmmu_ss.add(when: 'CONFIG_SECCOMP', if_true: [files('qemu-seccomp.c'), seccomp]) +softmmu_ss.add(when: seccomp, if_true: files('qemu-seccomp.c')) softmmu_ss.add(when: fdt, if_true: files('device_tree.c'))
softmmu/qemu-seccomp.c +0 -2
@@ -202,7 +202,6 @@ static int seccomp_start(uint32_t seccomp_opts, Error **errp)return rc <0 ?-1 :0 ; } -#ifdef CONFIG_SECCOMP int parse_sandbox (void *opaque,QemuOpts *opts,Error **errp) {if (qemu_opt_get_bool (opts,"enable" , false)) {
@@ -328,4 +327,3 @@ static void seccomp_register(void) } }opts_init (seccomp_register); -#endif
tools/meson.build +2 -2
@@ -1,6 +1,6 @@ have_virtiofsd = (targetos == 'linux' and have_tools and - 'CONFIG_SECCOMP' in config_host and + seccomp.found() and 'CONFIG_LIBCAP_NG' in config_host and 'CONFIG_VHOST_USER' in config_host)
@@ -8,7 +8,7 @@ if get_option('virtiofsd').enabled() if not have_virtiofsd if targetos != 'linux' error('virtiofsd requires Linux') - elif 'CONFIG_SECCOMP' not in config_host or 'CONFIG_LIBCAP_NG' not in config_host + elif not seccomp.found() or 'CONFIG_LIBCAP_NG' not in config_host error('virtiofsd requires libcap-ng-devel and seccomp-devel') elif not have_tools or 'CONFIG_VHOST_USER' not in config_host error('virtiofsd needs tools and vhost-user support')
Signature · 1 line
2.29.2
[PULL 39/55] glusterfs: convert to meson
In reply to Paolo Bonzini--- configure | 102 ++-------------------------------------------- meson.build | 48 ++++++++++++++++++++-- meson_options.txt | 2 + 3 files changed, 50 insertions(+), 102 deletions(-)
configure +4 -98
@@ -414,13 +414,7 @@ crypto_afalg="no" cfi="false" cfi_debug="false" seccomp="$default_feature" -glusterfs="$default_feature" -glusterfs_xlator_opt="no" -glusterfs_discard="no" -glusterfs_fallocate="no" -glusterfs_zerofill="no" -glusterfs_ftruncate_has_stat="no" -glusterfs_iocb_has_stat="no" +glusterfs="auto" gtk="$default_feature" gtk_gl="no" tls_priority="NORMAL"
@@ -1365,7 +1359,7 @@ for opt do ;; --disable-seccomp) seccomp="no" ;; - --disable-glusterfs) glusterfs="no" + --disable-glusterfs) glusterfs="disabled" ;; --disable-avx2) avx2_opt="no" ;;
@@ -1376,7 +1370,7 @@ for opt do --enable-avx512f) avx512f_opt="yes" ;; - --enable-glusterfs) glusterfs="yes" + --enable-glusterfs) glusterfs="enabled" ;; --disable-virtio-blk-data-plane|--enable-virtio-blk-data-plane) echo "$0: $opt is obsolete, virtio-blk data-plane is always on" >&2
@@ -3869,64 +3863,6 @@ if test "$libxml2" != "no" ; then fi fi -########################################## -# glusterfs probe -if test "$glusterfs" != "no" ; then - if $pkg_config --atleast-version=3 glusterfs-api; then - glusterfs="yes" - glusterfs_cflags=$($pkg_config --cflags glusterfs-api) - glusterfs_libs=$($pkg_config --libs glusterfs-api) - if $pkg_config --atleast-version=4 glusterfs-api; then - glusterfs_xlator_opt="yes" - fi - if $pkg_config --atleast-version=5 glusterfs-api; then - glusterfs_discard="yes" - fi - if $pkg_config --atleast-version=6 glusterfs-api; then - glusterfs_fallocate="yes" - glusterfs_zerofill="yes" - fi - cat > $TMPC << EOF -#include <glusterfs/api/glfs.h> - -int -main(void) -{ - /* new glfs_ftruncate() passes two additional args */ - return glfs_ftruncate(NULL, 0, NULL, NULL); -} -EOF - if compile_prog "$glusterfs_cflags" "$glusterfs_libs" ; then - glusterfs_ftruncate_has_stat="yes" - fi - cat > $TMPC << EOF -#include <glusterfs/api/glfs.h> - -/* new glfs_io_cbk() passes two additional glfs_stat structs */ -static void -glusterfs_iocb(glfs_fd_t *fd, ssize_t ret, struct glfs_stat *prestat, struct glfs_stat *poststat, void *data) -{} - -int -main(void) -{ - glfs_io_cbk iocb = &glusterfs_iocb; - iocb(NULL, 0 , NULL, NULL, NULL); - return 0; -} -EOF - if compile_prog "$glusterfs_cflags" "$glusterfs_libs" ; then - glusterfs_iocb_has_stat="yes" - fi - else - if test "$glusterfs" = "yes" ; then - feature_not_found "GlusterFS backend support" \ - "Install glusterfs-api devel >= 3" - fi - glusterfs="no" - fi -fi - # Check for inotify functions when we are building linux-user # emulator. This is done because older glibc versions don't # have syscall stubs for these implemented. In that case we
@@ -6413,36 +6349,6 @@ if test "$getauxval" = "yes" ; then echo "CONFIG_GETAUXVAL=y" >> $config_host_mak fi -if test "$glusterfs" = "yes" ; then - echo "CONFIG_GLUSTERFS=y" >> $config_host_mak - echo "GLUSTERFS_CFLAGS=$glusterfs_cflags" >> $config_host_mak - echo "GLUSTERFS_LIBS=$glusterfs_libs" >> $config_host_mak -fi - -if test "$glusterfs_xlator_opt" = "yes" ; then - echo "CONFIG_GLUSTERFS_XLATOR_OPT=y" >> $config_host_mak -fi - -if test "$glusterfs_discard" = "yes" ; then - echo "CONFIG_GLUSTERFS_DISCARD=y" >> $config_host_mak -fi - -if test "$glusterfs_fallocate" = "yes" ; then - echo "CONFIG_GLUSTERFS_FALLOCATE=y" >> $config_host_mak -fi - -if test "$glusterfs_zerofill" = "yes" ; then - echo "CONFIG_GLUSTERFS_ZEROFILL=y" >> $config_host_mak -fi - -if test "$glusterfs_ftruncate_has_stat" = "yes" ; then - echo "CONFIG_GLUSTERFS_FTRUNCATE_HAS_STAT=y" >> $config_host_mak -fi - -if test "$glusterfs_iocb_has_stat" = "yes" ; then - echo "CONFIG_GLUSTERFS_IOCB_HAS_STAT=y" >> $config_host_mak -fi - if test "$libssh" = "yes" ; then echo "CONFIG_LIBSSH=y" >> $config_host_mak echo "LIBSSH_CFLAGS=$libssh_cflags" >> $config_host_mak
@@ -6917,7 +6823,7 @@ NINJA=$ninja $meson setup \ -Dvnc=$vnc -Dvnc_sasl=$vnc_sasl -Dvnc_jpeg=$vnc_jpeg -Dvnc_png=$vnc_png \ -Dgettext=$gettext -Dxkbcommon=$xkbcommon -Du2f=$u2f -Dvirtiofsd=$virtiofsd \ -Dcapstone=$capstone -Dslirp=$slirp -Dfdt=$fdt -Dbrlapi=$brlapi \ - -Dcurl=$curl \ + -Dcurl=$curl -Dglusterfs=$glusterfs \ -Diconv=$iconv -Dcurses=$curses -Dlibudev=$libudev\ -Ddocs=$docs -Dsphinx_build=$sphinx_build -Dinstall_blobs=$blobs \ -Dvhost_user_blk_server=$vhost_user_blk_server \
meson.build +44 -4
66 lines not on this page · raw message
meson_options.txt +2 -0
@@ -46,6 +46,8 @@ option('cocoa', type : 'feature', value : 'auto', description: 'Cocoa user interface (macOS only)') option('curl', type : 'feature', value : 'auto', description: 'CURL block device driver') +option('glusterfs', type : 'feature', value : 'auto', + description: 'Glusterfs block device driver') option('mpath', type : 'feature', value : 'auto', description: 'Multipath persistent reservation passthrough') option('iconv', type : 'feature', value : 'auto',
Signature · 1 line
2.29.2
[PULL 28/55] meson: fix detection of curses with pkgconfig
In reply to Paolo Bonzini--- meson.build | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
meson.build +3 -3
@@ -500,16 +500,16 @@ if have_system and not get_option('curses').disabled() endif endforeach msg = get_option('curses').enabled() ? 'curses library not found' : '' + curses_compile_args = ['-DNCURSES_WIDECHAR'] if curses.found() - if cc.links(curses_test, dependencies: [curses]) - curses = declare_dependency(compile_args: '-DNCURSES_WIDECHAR', dependencies: [curses]) + if cc.links(curses_test, args: curses_compile_args, dependencies: [curses]) + curses = declare_dependency(compile_args: curses_compile_args, dependencies: [curses]) else msg = 'curses package not usable' curses = not_found endif endif if not curses.found() - curses_compile_args = ['-DNCURSES_WIDECHAR'] has_curses_h = cc.has_header('curses.h', args: curses_compile_args) if targetos != 'windows' and not has_curses_h message('Trying with /usr/include/ncursesw')
Signature · 1 line
2.29.2
[PULL 26/55] meson: update submodule to 0.56.0
In reply to Paolo Bonzini--- configure | 2 +- meson | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
configure +1 -1
@@ -1936,7 +1936,7 @@ python_version=$($python -c 'import sys; print("%d.%d.%d" % (sys.version_info[0] python="$python -B" if test -z "$meson"; then - if test "$explicit_python" = no && has meson && version_ge "$(meson --version)" 0.55.3; then + if test "$explicit_python" = no && has meson && version_ge "$(meson --version)" 0.56.0; then meson=meson elif test -e "${source_path}/.git" && test $git_update = 'yes' ; then meson=git
meson +1 -1
@@ -1 +1 @@ -Subproject commit 776acd2a805c9b42b4f0375150977df42130317f +Subproject commit f16d31607eb3cd0f281758bd0944e206ef6be387
Signature · 1 line
2.29.2
[PULL 42/55] libnfs: convert to meson
In reply to Paolo Bonzini--- configure | 27 ++++----------------------- meson.build | 9 ++++++--- meson_options.txt | 2 ++ 3 files changed, 12 insertions(+), 26 deletions(-)
configure +4 -23
@@ -406,7 +406,7 @@ vss_win32_sdk="$default_feature" win_sdk="no" want_tools="$default_feature" libiscsi="auto" -libnfs="$default_feature" +libnfs="auto" coroutine="" coroutine_pool="$default_feature" debug_stack_usage="no"
@@ -1142,9 +1142,9 @@ for opt do ;; --enable-libiscsi) libiscsi="enabled" ;; - --disable-libnfs) libnfs="no" + --disable-libnfs) libnfs="disabled" ;; - --enable-libnfs) libnfs="yes" + --enable-libnfs) libnfs="enabled" ;; --enable-profiler) profiler="yes" ;;
@@ -5559,20 +5559,6 @@ if test "$have_ubsan" = "yes"; then QEMU_LDFLAGS="-fsanitize=undefined $QEMU_LDFLAGS" fi -########################################## -# Do we have libnfs -if test "$libnfs" != "no" ; then - if $pkg_config --atleast-version=1.9.3 libnfs; then - libnfs="yes" - libnfs_libs=$($pkg_config --libs libnfs) - else - if test "$libnfs" = "yes" ; then - feature_not_found "libnfs" "Install libnfs devel >= 1.9.3" - fi - libnfs="no" - fi -fi - ########################################## # Exclude --warn-common with TSan to suppress warnings from the TSan libraries.
@@ -6214,11 +6200,6 @@ if test "$zstd" = "yes" ; then echo "ZSTD_LIBS=$zstd_libs" >> $config_host_mak fi -if test "$libnfs" = "yes" ; then - echo "CONFIG_LIBNFS=y" >> $config_host_mak - echo "LIBNFS_LIBS=$libnfs_libs" >> $config_host_mak -fi - if test "$seccomp" = "yes"; then echo "CONFIG_SECCOMP=y" >> $config_host_mak echo "SECCOMP_CFLAGS=$seccomp_cflags" >> $config_host_mak
@@ -6780,7 +6761,7 @@ NINJA=$ninja $meson setup \ -Dgettext=$gettext -Dxkbcommon=$xkbcommon -Du2f=$u2f -Dvirtiofsd=$virtiofsd \ -Dcapstone=$capstone -Dslirp=$slirp -Dfdt=$fdt -Dbrlapi=$brlapi \ -Dcurl=$curl -Dglusterfs=$glusterfs -Dbzip2=$bzip2 -Dlibiscsi=$libiscsi \ - -Diconv=$iconv -Dcurses=$curses -Dlibudev=$libudev\ + -Dlibnfs=$libnfs -Diconv=$iconv -Dcurses=$curses -Dlibudev=$libudev\ -Ddocs=$docs -Dsphinx_build=$sphinx_build -Dinstall_blobs=$blobs \ -Dvhost_user_blk_server=$vhost_user_blk_server \ -Dfuse=$fuse -Dfuse_lseek=$fuse_lseek \
meson.build +6 -3
@@ -319,8 +319,10 @@ if 'CONFIG_LIBXML2' in config_host link_args: config_host['LIBXML2_LIBS'].split()) endif libnfs = not_found -if 'CONFIG_LIBNFS' in config_host - libnfs = declare_dependency(link_args: config_host['LIBNFS_LIBS'].split()) +if not get_option('libnfs').auto() or have_block + libnfs = dependency('libnfs', version: '>=1.9.3', + required: get_option('libnfs'), + method: 'pkg-config', static: enable_static) endif libattr = not_found if 'CONFIG_ATTR' in config_host
@@ -930,6 +932,7 @@ if glusterfs.found() config_host_data.set('CONFIG_GLUSTERFS_IOCB_HAS_STAT', glusterfs_iocb_has_stat) endif config_host_data.set('CONFIG_LIBISCSI', libiscsi.found()) +config_host_data.set('CONFIG_LIBNFS', libnfs.found()) config_host_data.set('CONFIG_SDL', sdl.found()) config_host_data.set('CONFIG_SDL_IMAGE', sdl_image.found()) config_host_data.set('CONFIG_VHOST_USER_BLK_SERVER', have_vhost_user_blk_server)
@@ -2289,7 +2292,7 @@ summary_info += {'usb net redir': config_host.has_key('CONFIG_USB_REDIR')} summary_info += {'OpenGL support': config_host.has_key('CONFIG_OPENGL')} summary_info += {'OpenGL dmabufs': config_host.has_key('CONFIG_OPENGL_DMABUF')} summary_info += {'libiscsi support': libiscsi.found()} -summary_info += {'libnfs support': config_host.has_key('CONFIG_LIBNFS')} +summary_info += {'libnfs support': libnfs.found()} summary_info += {'build guest agent': config_host.has_key('CONFIG_GUEST_AGENT')} if targetos == 'windows' if 'WIN_SDK' in config_host
meson_options.txt +2 -0
@@ -52,6 +52,8 @@ option('glusterfs', type : 'feature', value : 'auto', description: 'Glusterfs block device driver') option('libiscsi', type : 'feature', value : 'auto', description: 'libiscsi userspace initiator') +option('libnfs', type : 'feature', value : 'auto', + description: 'libnfs block device driver') option('mpath', type : 'feature', value : 'auto', description: 'Multipath persistent reservation passthrough') option('iconv', type : 'feature', value : 'auto',
Signature · 1 line
2.29.2
[PULL 47/55] lzfse: convert to meson
In reply to Paolo Bonzini--- configure | 31 ++++--------------------------- meson.build | 19 +++++++++++++++---- meson_options.txt | 2 ++ 3 files changed, 21 insertions(+), 31 deletions(-)
configure +4 -27
@@ -396,7 +396,7 @@ capstone="auto" lzo="auto" snappy="auto" bzip2="auto" -lzfse="$default_feature" +lzfse="auto" zstd="$default_feature" guest_agent="$default_feature" guest_agent_with_vss="no"
@@ -1323,9 +1323,9 @@ for opt do ;; --enable-bzip2) bzip2="enabled" ;; - --enable-lzfse) lzfse="yes" + --enable-lzfse) lzfse="enabled" ;; - --disable-lzfse) lzfse="no" + --disable-lzfse) lzfse="disabled" ;; --disable-zstd) zstd="no" ;;
@@ -2456,24 +2456,6 @@ EOF fi fi -########################################## -# lzfse check - -if test "$lzfse" != "no" ; then - cat > $TMPC << EOF -#include <lzfse.h> -int main(void) { lzfse_decode_scratch_size(); return 0; } -EOF - if compile_prog "" "-llzfse" ; then - lzfse="yes" - else - if test "$lzfse" = "yes"; then - feature_not_found "lzfse" "Install lzfse devel" - fi - lzfse="no" - fi -fi - ########################################## # zstd check
@@ -6086,11 +6068,6 @@ if test "$avx512f_opt" = "yes" ; then echo "CONFIG_AVX512F_OPT=y" >> $config_host_mak fi -if test "$lzfse" = "yes" ; then - echo "CONFIG_LZFSE=y" >> $config_host_mak - echo "LZFSE_LIBS=-llzfse" >> $config_host_mak -fi - if test "$zstd" = "yes" ; then echo "CONFIG_ZSTD=y" >> $config_host_mak echo "ZSTD_CFLAGS=$zstd_cflags" >> $config_host_mak
@@ -6649,7 +6626,7 @@ NINJA=$ninja $meson setup \ -Dcapstone=$capstone -Dslirp=$slirp -Dfdt=$fdt -Dbrlapi=$brlapi \ -Dcurl=$curl -Dglusterfs=$glusterfs -Dbzip2=$bzip2 -Dlibiscsi=$libiscsi \ -Dlibnfs=$libnfs -Diconv=$iconv -Dcurses=$curses -Dlibudev=$libudev\ - -Dlibssh=$libssh -Drbd=$rbd -Dlzo=$lzo -Dsnappy=$snappy \ + -Dlibssh=$libssh -Drbd=$rbd -Dlzo=$lzo -Dsnappy=$snappy -Dlzfse=$lzfse \ -Ddocs=$docs -Dsphinx_build=$sphinx_build -Dinstall_blobs=$blobs \ -Dvhost_user_blk_server=$vhost_user_blk_server \ -Dfuse=$fuse -Dfuse_lseek=$fuse_lseek \
meson.build +15 -4
@@ -699,10 +699,21 @@ if not get_option('bzip2').auto() or have_block endif endif endif -liblzfse = not_found -if 'CONFIG_LZFSE' in config_host - liblzfse = declare_dependency(link_args: config_host['LZFSE_LIBS'].split()) + +liblzfse = cc.find_library('lzfse', has_headers: ['lzfse.h'], + required: get_option('lzfse'), + static: enable_static) +if liblzfse.found() and not cc.links(''' + #include <lzfse.h> + int main(void) { lzfse_decode_scratch_size(); return 0; }''', dependencies: liblzfse) + liblzfse = not_found + if get_option('lzfse').enabled() + error('could not link liblzfse') + else + warning('could not link liblzfse, disabling') + endif endif + oss = not_found if 'CONFIG_AUDIO_OSS' in config_host oss = declare_dependency(link_args: config_host['OSS_LIBS'].split())
@@ -2372,7 +2383,7 @@ summary_info += {'Live block migration': config_host.has_key('CONFIG_LIVE_BLOCK_ summary_info += {'lzo support': lzo.found()} summary_info += {'snappy support': snappy.found()} summary_info += {'bzip2 support': libbzip2.found()} -summary_info += {'lzfse support': config_host.has_key('CONFIG_LZFSE')} +summary_info += {'lzfse support': liblzfse.found()} summary_info += {'zstd support': config_host.has_key('CONFIG_ZSTD')} summary_info += {'NUMA host support': config_host.has_key('CONFIG_NUMA')} summary_info += {'libxml2': config_host.has_key('CONFIG_LIBXML2')}
meson_options.txt +2 -0
@@ -64,6 +64,8 @@ option('curses', type : 'feature', value : 'auto', description: 'curses UI') option('libudev', type : 'feature', value : 'auto', description: 'Use libudev to enumerate host devices') +option('lzfse', type : 'feature', value : 'auto', + description: 'lzfse support for DMG images') option('lzo', type : 'feature', value : 'auto', description: 'lzo compression support') option('rbd', type : 'feature', value : 'auto',
Signature · 1 line
2.29.2
[PULL 48/55] zstd: convert to meson
In reply to Paolo Bonzini--- configure | 30 ++++-------------------------- meson.build | 10 ++++++---- meson_options.txt | 2 ++ migration/meson.build | 2 +- 4 files changed, 13 insertions(+), 31 deletions(-)
configure +4 -26
@@ -397,7 +397,7 @@ lzo="auto" snappy="auto" bzip2="auto" lzfse="auto" -zstd="$default_feature" +zstd="auto" guest_agent="$default_feature" guest_agent_with_vss="no" guest_agent_ntddscsi="no"
@@ -1327,9 +1327,9 @@ for opt do ;; --disable-lzfse) lzfse="disabled" ;; - --disable-zstd) zstd="no" + --disable-zstd) zstd="disabled" ;; - --enable-zstd) zstd="yes" + --enable-zstd) zstd="enabled" ;; --enable-guest-agent) guest_agent="yes" ;;
@@ -2456,23 +2456,6 @@ EOF fi fi -########################################## -# zstd check - -if test "$zstd" != "no" ; then - libzstd_minver="1.4.0" - if $pkg_config --atleast-version=$libzstd_minver libzstd ; then - zstd_cflags="$($pkg_config --cflags libzstd)" - zstd_libs="$($pkg_config --libs libzstd)" - zstd="yes" - else - if test "$zstd" = "yes" ; then - feature_not_found "libzstd" "Install libzstd devel" - fi - zstd="no" - fi -fi - ########################################## # libseccomp check
@@ -6068,12 +6051,6 @@ if test "$avx512f_opt" = "yes" ; then echo "CONFIG_AVX512F_OPT=y" >> $config_host_mak fi -if test "$zstd" = "yes" ; then - echo "CONFIG_ZSTD=y" >> $config_host_mak - echo "ZSTD_CFLAGS=$zstd_cflags" >> $config_host_mak - echo "ZSTD_LIBS=$zstd_libs" >> $config_host_mak -fi - if test "$seccomp" = "yes"; then echo "CONFIG_SECCOMP=y" >> $config_host_mak echo "SECCOMP_CFLAGS=$seccomp_cflags" >> $config_host_mak
@@ -6627,6 +6604,7 @@ NINJA=$ninja $meson setup \ -Dcurl=$curl -Dglusterfs=$glusterfs -Dbzip2=$bzip2 -Dlibiscsi=$libiscsi \ -Dlibnfs=$libnfs -Diconv=$iconv -Dcurses=$curses -Dlibudev=$libudev\ -Dlibssh=$libssh -Drbd=$rbd -Dlzo=$lzo -Dsnappy=$snappy -Dlzfse=$lzfse \ + -Dzstd=$zstd \ -Ddocs=$docs -Dsphinx_build=$sphinx_build -Dinstall_blobs=$blobs \ -Dvhost_user_blk_server=$vhost_user_blk_server \ -Dfuse=$fuse -Dfuse_lseek=$fuse_lseek \
meson.build +6 -4
@@ -380,9 +380,10 @@ if not get_option('libiscsi').auto() or have_block method: 'pkg-config', static: enable_static) endif zstd = not_found -if 'CONFIG_ZSTD' in config_host - zstd = declare_dependency(compile_args: config_host['ZSTD_CFLAGS'].split(), - link_args: config_host['ZSTD_LIBS'].split()) +if not get_option('zstd').auto() or have_block + zstd = dependency('libzstd', version: '>=1.4.0', + required: get_option('zstd'), + method: 'pkg-config', static: enable_static) endif gbm = not_found if 'CONFIG_GBM' in config_host
@@ -1009,6 +1010,7 @@ config_host_data.set('CONFIG_KEYUTILS', keyutils.found()) config_host_data.set('CONFIG_GETTID', has_gettid) config_host_data.set('CONFIG_MALLOC_TRIM', has_malloc_trim) config_host_data.set('CONFIG_STATX', has_statx) +config_host_data.set('CONFIG_ZSTD', zstd.found()) config_host_data.set('CONFIG_FUSE', fuse.found()) config_host_data.set('CONFIG_FUSE_LSEEK', fuse_lseek.found()) config_host_data.set('CONFIG_CFI', get_option('cfi'))
@@ -2384,7 +2386,7 @@ summary_info += {'lzo support': lzo.found()} summary_info += {'snappy support': snappy.found()} summary_info += {'bzip2 support': libbzip2.found()} summary_info += {'lzfse support': liblzfse.found()} -summary_info += {'zstd support': config_host.has_key('CONFIG_ZSTD')} +summary_info += {'zstd support': zstd.found()} summary_info += {'NUMA host support': config_host.has_key('CONFIG_NUMA')} summary_info += {'libxml2': config_host.has_key('CONFIG_LIBXML2')} summary_info += {'memory allocator': get_option('malloc')}
meson_options.txt +2 -0
@@ -92,6 +92,8 @@ option('virtiofsd', type: 'feature', value: 'auto', description: 'build virtiofs daemon (virtiofsd)') option('vhost_user_blk_server', type: 'feature', value: 'auto', description: 'build vhost-user-blk server') +option('zstd', type : 'feature', value : 'auto', + description: 'zstd compression support') option('fuse', type: 'feature', value: 'auto', description: 'FUSE block device export') option('fuse_lseek', type : 'feature', value : 'auto',
migration/meson.build +1 -1
@@ -29,6 +29,6 @@ softmmu_ss.add(files( softmmu_ss.add(when: ['CONFIG_RDMA', rdma], if_true: files('rdma.c')) softmmu_ss.add(when: 'CONFIG_LIVE_BLOCK_MIGRATION', if_true: files('block.c')) -softmmu_ss.add(when: 'CONFIG_ZSTD', if_true: [files('multifd-zstd.c'), zstd]) +softmmu_ss.add(when: zstd, if_true: files('multifd-zstd.c')) specific_ss.add(when: 'CONFIG_SOFTMMU', if_true: files('dirtyrate.c', 'ram.c'))
Signature · 1 line
2.29.2
[PULL 53/55] meson.build: convert --with-default-devices to meson
In reply to Paolo BonziniPass the boolean option directly instead of writing CONFIG_MINIKCONF_MODE to config-host.mak.
--- configure | 13 ++++--------- meson.build | 5 +++-- meson_options.txt | 2 ++ 3 files changed, 9 insertions(+), 11 deletions(-)
configure +4 -9
@@ -446,7 +446,7 @@ sheepdog="no" libxml2="$default_feature" debug_mutex="no" libpmem="$default_feature" -default_devices="yes" +default_devices="true" plugins="no" fuzzing="no" rng_none="no"
@@ -943,9 +943,9 @@ for opt do ;; --with-trace-file=*) trace_file="$optarg" ;; - --with-default-devices) default_devices="yes" + --with-default-devices) default_devices="true" ;; - --without-default-devices) default_devices="no" + --without-default-devices) default_devices="false" ;; --without-default-features) # processed above ;;
@@ -5539,11 +5539,6 @@ echo "GIT_UPDATE=$git_update" >> $config_host_mak echo "ARCH=$ARCH" >> $config_host_mak -if test "$default_devices" = "yes" ; then - echo "CONFIG_MINIKCONF_MODE=--defconfig" >> $config_host_mak -else - echo "CONFIG_MINIKCONF_MODE=--allnoconfig" >> $config_host_mak -fi if test "$debug_tcg" = "yes" ; then echo "CONFIG_DEBUG_TCG=y" >> $config_host_mak fi
@@ -6496,7 +6491,7 @@ NINJA=$ninja $meson setup \ -Dlibnfs=$libnfs -Diconv=$iconv -Dcurses=$curses -Dlibudev=$libudev\ -Dlibssh=$libssh -Drbd=$rbd -Dlzo=$lzo -Dsnappy=$snappy -Dlzfse=$lzfse \ -Dzstd=$zstd -Dseccomp=$seccomp -Dvirtfs=$virtfs -Dcap_ng=$cap_ng \ - -Dattr=$attr \ + -Dattr=$attr -Ddefault_devices=$default_devices \ -Ddocs=$docs -Dsphinx_build=$sphinx_build -Dinstall_blobs=$blobs \ -Dvhost_user_blk_server=$vhost_user_blk_server \ -Dfuse=$fuse -Dfuse_lseek=$fuse_lseek \
meson.build +3 -2
@@ -1282,7 +1282,8 @@ foreach target : target_dirs output: config_devices_mak, depfile: config_devices_mak + '.d', capture: true, - command: [minikconf, config_host['CONFIG_MINIKCONF_MODE'], + command: [minikconf, + get_option('default_devices') ? '--defconfig' : '--allnoconfig', config_devices_mak, '@DEPFILE@', '@INPUT@', host_kconfig, accel_kconfig])
@@ -2476,7 +2477,7 @@ summary_info += {'capstone': capstone_opt == 'disabled' ? false : capst summary_info += {'libpmem support': config_host.has_key('CONFIG_LIBPMEM')} summary_info += {'libdaxctl support': config_host.has_key('CONFIG_LIBDAXCTL')} summary_info += {'libudev': libudev.found()} -summary_info += {'default devices': config_host['CONFIG_MINIKCONF_MODE'] == '--defconfig'} +summary_info += {'default devices': get_option('default_devices')} summary_info += {'plugin support': config_host.has_key('CONFIG_PLUGIN')} summary_info += {'fuzzing support': config_host.has_key('CONFIG_FUZZ')} if config_host.has_key('HAVE_GDB_BIN')
meson_options.txt +2 -0
@@ -7,6 +7,8 @@ option('qemu_firmwarepath', type : 'string', value : '', option('sphinx_build', type : 'string', value : '', description: 'Use specified sphinx-build [$sphinx_build] for building document (default to be empty)') +option('default_devices', type : 'boolean', value : true, + description: 'Include a default selection of devices in emulators') option('docs', type : 'feature', value : 'auto', description: 'Documentations build support') option('gettext', type : 'feature', value : 'auto',
Signature · 1 line
2.29.2
Quoted 23 lines · Paolo Bonzini
The following changes since commit
a05f8ecd88f15273d033b6f044b850a8af84a5b8:Merge remote-tracking branch 'remotes/alistair/tags/pull-riscv-to-apply-20201217-1' into staging (2020-12-18 11:12:35 +0000)
are available in the Git repository at:
https://gitlab.com/bonzini/qemu.git tags/for-upstream
for you to fetch changes up to
16efbeeb765944fdda71862b40d60f0abeb1e200:win32: drop fd registration to the main-loop on setting non-block (2020-12-21 13:53:24 +0100)
----------------------------------------------------------------
From Alex's pull request:
* improve cross-build KVM coverage
* new --without-default-features configure flag
* add__repr__for ConsoleSocket for debugging
* build tcg tests with -Werror
* test 32 bit builds with fedora
* remove last traces of debian9
* hotfix for centos8 powertools repo
Quoted 7 lines
* Move lots of feature detection code to meson (Alex, myself)
* CFI and LTO support (Daniele)
* test-char dangling pointer (Eduardo)
* Build system and win32 fixes (Marc-André)
* Initialization fixes (myself)
* TCG include cleanup (Richard, myself)
* x86 'int N' fix (Peter)
Fails to build, all hosts:
make: Entering directory '/home/ubuntu/qemu/build/all' (cd /home/ubuntu/qemu && GIT="git" ./scripts/git-submodule.sh update ui/keycodemapdb tests/fp/berkeley-testfloat-3 te sts/fp/berkeley-softfloat-3 meson dtc capstone slirp roms/SLOF) config-host.mak is out-of-date, running configure
cross containers no
NOTE: guest cross-compilers enabled: cc cc /usr/bin/ninja -v build.ninja && touch build.ninja.stamp [0/1] /usr/bin/python3 /home/ubuntu/qemu/meson/meson.py --internal regenerate /home/ubuntu/qemu /home/ubuntu/qemu/bui ld/all --backend ninja
WARNING: Regenerating configuration from scratch.
Reason: Coredata file '/home/ubuntu/qemu/build/all/meson-private/coredata.dat' references functions or classes that d
on't exist. This probably means that it was generated with an old version of meson.
The Meson build system
Version: 0.56.0
Source dir: /home/ubuntu/qemu
Build dir: /home/ubuntu/qemu/build/all
Build type: native build
../../meson.build:1:0: ERROR: Value "true" (of type "string") for combo option "Localization of the GTK+ user interface" is not one of the choices. Possible choices are (as string): "enabled", "disabled", "auto".
A full log can be found at /home/ubuntu/qemu/build/all/meson-logs/meson-log.txt
FAILED: build.ninja/usr/bin/python3 /home/ubuntu/qemu/meson/meson.py --internal regenerate /home/ubuntu/qemu /home/ubuntu/qemu/build/all --backend ninja
ninja: error: rebuilding 'build.ninja': subcommand failed /usr/bin/ninja -v build.ninja && touch build.ninja.stamp
[0/1] /usr/bin/python3 /home/ubuntu/qemu/meson/meson.py --internal regenerate /home/ubuntu/qemu /home/ubuntu/qemu/build/all --backend ninja
WARNING: Regenerating configuration from scratch.
Reason: Coredata file '/home/ubuntu/qemu/build/all/meson-private/coredata.dat' references functions or classes that don't exist. This probably means that it was generated with an old version of meson.
The Meson build system
Version: 0.56.0
Source dir: /home/ubuntu/qemu
Build dir: /home/ubuntu/qemu/build/all
Build type: native build
../../meson.build:1:0: ERROR: Value "true" (of type "string") for combo option "Localization of the GTK+ user interface" is not one of the choices. Possible choices are (as string): "enabled", "disabled", "auto".
A full log can be found at /home/ubuntu/qemu/build/all/meson-logs/meson-log.txt
FAILED: build.ninja/usr/bin/python3 /home/ubuntu/qemu/meson/meson.py --internal regenerate /home/ubuntu/qemu /home/ubuntu/qemu/build/all --backend ninja
ninja: error: rebuilding 'build.ninja': subcommand failed/usr/bin/ninja -v all | cat
make -C pc-bios/s390-ccw/ V="1" TARGET_DIR="pc-bios/s390-ccw/" all make[1]: Entering directory '/home/ubuntu/qemu/build/all/pc-bios/s390-ccw' make[1]: Leaving directory '/home/ubuntu/qemu/build/all/pc-bios/s390-ccw' [0/1] /usr/bin/python3 /home/ubuntu/qemu/meson/meson.py --internal regenerate /home/ubuntu/qemu /home/ubuntu/qemu/build/all --backend ninja
WARNING: Regenerating configuration from scratch.
Reason: Coredata file '/home/ubuntu/qemu/build/all/meson-private/coredata.dat' references functions or classes that don't exist. This probably means that it was generated with an old version of meson.
The Meson build system
Version: 0.56.0
Source dir: /home/ubuntu/qemu
Build dir: /home/ubuntu/qemu/build/all
Build type: native build
../../meson.build:1:0: ERROR: Value "true" (of type "string") for combo option "Localization of the GTK+ user interface" is not one of the choices. Possible choices are (as string): "enabled", "disabled", "auto".
A full log can be found at /home/ubuntu/qemu/build/all/meson-logs/meson-log.txt
ninja: error: rebuilding 'build.ninja': subcommand failed
FAILED: build.ninja/usr/bin/python3 /home/ubuntu/qemu/meson/meson.py --internal regenerate /home/ubuntu/qemu /home/ubuntu/qemu/build/all --backend ninja
Makefile:172: recipe for target 'run-ninja' failed
make: *** [run-ninja] Error 1
make: Leaving directory '/home/ubuntu/qemu/build/all'
(why does it print the same failure three times rather than stopping after the first one?)
thanks
-- PMM
Il ven 1 gen 2021, 18:05 Peter Maydell <[email protected]> ha scritto:
Quoted 3 lines
(why does it print the same failure three times rather than stopping after the first one?)
It probably has something to do with how make processes rules to rebuild makefiles.
I will remove the patch that moves xgettext from boolean to feature and then try to reproduce the failure.
Paolo
Quoted 4 lines
thanks
-- PMM