From fb730c8683807d549c4aa8dfc98e3d1d470fd784 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alex=20Benn=C3=A9e?= Date: Tue, 15 Sep 2020 14:43:10 +0100 Subject: [PATCH 1/8] linux-user: test, don't assert addr != test in pgb_reserved_va MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit On older kernels which don't implement MAP_FIXED_NOREPLACE the kernel may still fail to give us the address we asked for despite having already probed the map for a valid hole. Asserting isn't particularly useful to the user so let us move the check up and expand the error_report a little to give them a fighting chance of working around the problem. Signed-off-by: Alex Bennée Reviewed-by: Laurent Vivier Reviewed-by: Richard Henderson Cc: Bug 1895080 <1895080@bugs.launchpad.net> Ameliorates: ee94743034 Message-Id: <20200915134317.11110-2-alex.bennee@linaro.org> --- linux-user/elfload.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/linux-user/elfload.c b/linux-user/elfload.c index 4961e6119e..f6022fd704 100644 --- a/linux-user/elfload.c +++ b/linux-user/elfload.c @@ -2331,14 +2331,13 @@ static void pgb_reserved_va(const char *image_name, abi_ulong guest_loaddr, assert(guest_base != 0); test = g2h(0); addr = mmap(test, reserved_va, PROT_NONE, flags, -1, 0); - if (addr == MAP_FAILED) { + if (addr == MAP_FAILED || addr != test) { error_report("Unable to reserve 0x%lx bytes of virtual address " - "space (%s) for use as guest address space (check your " - "virtual memory ulimit setting or reserve less " - "using -R option)", reserved_va, strerror(errno)); + "space at %p (%s) for use as guest address space (check your" + "virtual memory ulimit setting, min_mmap_addr or reserve less " + "using -R option)", reserved_va, test, strerror(errno)); exit(EXIT_FAILURE); } - assert(addr == test); } void probe_guest_base(const char *image_name, abi_ulong guest_loaddr, From b8761cfdd6a1fb0393dc0aa3737f9a01795ae4b0 Mon Sep 17 00:00:00 2001 From: Max Reitz Date: Tue, 15 Sep 2020 14:43:11 +0100 Subject: [PATCH 2/8] iotests: Drop readlink -f MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit On macOS, (out of the box) readlink does not have -f. We do not really need readlink here, though, it was just a replacement for realpath (which is not available on our BSD test systems), which we needed to make the $(dirname) into an absolute path. Instead of using either, just use "cd; pwd" like is done for $source_iotests. ("iotests: Allow running from different directory") Fixes: b1cbc33a3971b6bb005d5ac3569feae35a71de0f Reported-by: Claudio Fontana Reported-by: Thomas Huth Suggested-by: Peter Maydell Signed-off-by: Max Reitz Signed-off-by: Alex Bennée Reviewed-by: Richard Henderson Message-Id: <20200914145606.94620-1-mreitz@redhat.com> Message-Id: <20200915134317.11110-3-alex.bennee@linaro.org> --- tests/qemu-iotests/check | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/qemu-iotests/check b/tests/qemu-iotests/check index e14a1f354d..678b6e4910 100755 --- a/tests/qemu-iotests/check +++ b/tests/qemu-iotests/check @@ -44,7 +44,7 @@ then _init_error "failed to obtain source tree name from check symlink" fi source_iotests=$(cd "$source_iotests"; pwd) || _init_error "failed to enter source tree" - build_iotests=$(readlink -f $(dirname "$0")) + build_iotests=$(cd "$(dirname "$0")"; pwd) else # called from the source tree source_iotests=$PWD From 94ce373aa430117a2e42dfd9e7e316f518ee47b4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alex=20Benn=C3=A9e?= Date: Tue, 15 Sep 2020 14:43:12 +0100 Subject: [PATCH 3/8] configure: move deprecated feature processing to supported_target MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This is the common point at which we validate targets so it makes sense to add_to deprecated_features here. It will make future target deprecation easier as we only need to tweak one list. Signed-off-by: Alex Bennée Message-Id: <20200915134317.11110-4-alex.bennee@linaro.org> --- configure | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/configure b/configure index ce27eafb0a..51d03a8d34 100755 --- a/configure +++ b/configure @@ -280,6 +280,9 @@ supported_whpx_target() { return 1 } +deprecated_targets_list=ppc64abi32-linux-user +deprecated_features="" + supported_target() { case "$1" in *-softmmu) @@ -301,6 +304,12 @@ supported_target() { return 1 ;; esac + + # if a deprecated target is enabled we note it here + if echo "$deprecated_targets_list" | grep -q "$1"; then + add_to deprecated_features $1 + fi + test "$tcg" = "yes" && return 0 supported_kvm_target "$1" && return 0 supported_xen_target "$1" && return 0 @@ -542,8 +551,6 @@ gettext="" bogus_os="no" malloc_trim="" -deprecated_features="" - # parse CC options first for opt do optarg=$(expr "x$opt" : 'x[^=]*=\(.*\)') @@ -1724,7 +1731,7 @@ fi if test -z "$target_list_exclude" -a -z "$target_list"; then # if the user doesn't specify anything lets skip deprecating stuff - target_list_exclude=ppc64abi32-linux-user + target_list_exclude=$deprecated_targets_list fi exclude_list=$(echo "$target_list_exclude" | sed -e 's/,/ /g') @@ -7668,7 +7675,6 @@ case "$target_name" in TARGET_SYSTBL_ABI=common,nospu,32 echo "TARGET_ABI32=y" >> $config_target_mak gdb_xml_files="power64-core.xml power-fpu.xml power-altivec.xml power-spe.xml power-vsx.xml" - deprecated_features="ppc64abi32 ${deprecated_features}" ;; riscv32) TARGET_BASE_ARCH=riscv From 3a5ae4a936c9b80ec137b569d08662ddbbd0c1a8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alex=20Benn=C3=A9e?= Date: Tue, 15 Sep 2020 14:43:13 +0100 Subject: [PATCH 4/8] configure: also skip deprecated targets with target-list-exclude MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Now the user has to make an even more deliberate decision to enable a deprecated target rather than getting it as a side effect of using --target-exclude-list. Signed-off-by: Alex Bennée Reviewed-by: Richard Henderson Message-Id: <20200915134317.11110-5-alex.bennee@linaro.org> --- configure | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/configure b/configure index 51d03a8d34..f5fe48d6dd 100755 --- a/configure +++ b/configure @@ -1729,9 +1729,14 @@ if [ "$bsd_user" = "yes" ]; then mak_wilds="${mak_wilds} $source_path/default-configs/*-bsd-user.mak" fi -if test -z "$target_list_exclude" -a -z "$target_list"; then - # if the user doesn't specify anything lets skip deprecating stuff - target_list_exclude=$deprecated_targets_list +# If the user doesn't explicitly specify a deprecated target we will +# skip it. +if test -z "$target_list"; then + if test -z "$target_list_exclude"; then + target_list_exclude="$deprecated_targets_list" + else + target_list_exclude="$target_list_exclude,$deprecated_targets_list" + fi fi exclude_list=$(echo "$target_list_exclude" | sed -e 's/,/ /g') From 98db9a066748fdbbd4131fd874c04d40fd0aca4b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alex=20Benn=C3=A9e?= Date: Tue, 15 Sep 2020 14:43:14 +0100 Subject: [PATCH 5/8] configure: clean-up the target-list-exclude logic MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Rather than sed and loop just do a grep. Signed-off-by: Alex Bennée Reviewed-by: Richard Henderson Message-Id: <20200915134317.11110-6-alex.bennee@linaro.org> --- configure | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/configure b/configure index f5fe48d6dd..58be974065 100755 --- a/configure +++ b/configure @@ -1739,17 +1739,9 @@ if test -z "$target_list"; then fi fi -exclude_list=$(echo "$target_list_exclude" | sed -e 's/,/ /g') for config in $mak_wilds; do target="$(basename "$config" .mak)" - exclude="no" - for excl in $exclude_list; do - if test "$excl" = "$target"; then - exclude="yes" - break; - fi - done - if test "$exclude" = "no"; then + if echo "$target_list_exclude" | grep -vq "$target"; then default_target_list="${default_target_list} $target" fi done From 44bf7a3464f2249c585169667b85c0451d6b6bc3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alex=20Benn=C3=A9e?= Date: Tue, 15 Sep 2020 14:43:15 +0100 Subject: [PATCH 6/8] configure: include tilegx-linux-user in the deprecation logic MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The target is already marked as deprecated in the documentation. Signed-off-by: Alex Bennée Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson Message-Id: <20200915134317.11110-7-alex.bennee@linaro.org> --- configure | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure b/configure index 58be974065..dfd7f18dcb 100755 --- a/configure +++ b/configure @@ -280,7 +280,7 @@ supported_whpx_target() { return 1 } -deprecated_targets_list=ppc64abi32-linux-user +deprecated_targets_list=ppc64abi32-linux-user,tilegx-linux-user deprecated_features="" supported_target() { From 1c0c06b1ea29d6f81424011f9b69b77cb0ea87ce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alex=20Benn=C3=A9e?= Date: Tue, 15 Sep 2020 14:43:16 +0100 Subject: [PATCH 7/8] gitlab: create a build-deprecated target MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit These targets might be deprecated but we should keep them building before the final axe comes down. Lets keep them all in one place and don't hold up the CI if they do fail. They are either poorly tested or already flaky anyway. Signed-off-by: Alex Bennée Reviewed-by: Philippe Mathieu-Daudé Acked-by: Thomas Huth Message-Id: <20200915134317.11110-8-alex.bennee@linaro.org> --- .gitlab-ci.yml | 10 ++++++++++ .travis.yml | 3 +-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 72e8604579..f027b55aef 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -254,6 +254,16 @@ build-clang: ppc-softmmu s390x-softmmu arm-linux-user MAKE_CHECK_ARGS: check +# These targets are on the way out +build-deprecated: + <<: *native_build_job_definition + variables: + IMAGE: debian-all-test-cross + CONFIGURE_ARGS: --disable-docs --disable-tools --disable-system + MAKE_CHECK_ARGS: check-tcg + TARGETS: ppc64abi32-linux-user tilegx-linux-user + allow_failure: true + build-oss-fuzz: <<: *native_build_job_definition variables: diff --git a/.travis.yml b/.travis.yml index 65341634d0..c75221dca3 100644 --- a/.travis.yml +++ b/.travis.yml @@ -344,10 +344,9 @@ jobs: # Run check-tcg against linux-user (with plugins) # we skip sparc64-linux-user until it has been fixed somewhat # we skip cris-linux-user as it doesn't use the common run loop - # we skip ppc64abi32-linux-user as it seems to have a broken libc - name: "GCC plugins check-tcg (user)" env: - - CONFIG="--disable-system --enable-plugins --enable-debug-tcg --target-list-exclude=sparc64-linux-user,cris-linux-user,ppc64abi32-linux-user" + - CONFIG="--disable-system --enable-plugins --enable-debug-tcg --target-list-exclude=sparc64-linux-user,cris-linux-user" - TEST_BUILD_CMD="make build-tcg" - TEST_CMD="make check-tcg" - CACHE_NAME="${TRAVIS_BRANCH}-linux-gcc-debug-tcg" From 3ffc7f013763bf4fc50c3b403cbacca2bee68cfa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alex=20Benn=C3=A9e?= Date: Tue, 15 Sep 2020 14:43:17 +0100 Subject: [PATCH 8/8] configure: add [lm32|unicore32]-softmmu to deprecation logic MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit While we are at it move the few places where they are into the deprecation build bucket. Signed-off-by: Alex Bennée Reviewed-by: Richard Henderson Message-Id: <20200915134317.11110-9-alex.bennee@linaro.org> --- .gitlab-ci.yml | 9 +++++---- .shippable.yml | 2 +- configure | 2 +- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index f027b55aef..a18e18b57e 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -134,7 +134,7 @@ build-system-fedora: variables: IMAGE: fedora CONFIGURE_ARGS: --disable-gcrypt --enable-nettle - TARGETS: tricore-softmmu unicore32-softmmu microblaze-softmmu mips-softmmu + TARGETS: tricore-softmmu microblaze-softmmu mips-softmmu xtensa-softmmu m68k-softmmu riscv32-softmmu ppc-softmmu sparc64-softmmu MAKE_CHECK_ARGS: check-build artifacts: @@ -166,7 +166,7 @@ build-system-centos: variables: IMAGE: centos8 CONFIGURE_ARGS: --disable-nettle --enable-gcrypt - TARGETS: ppc64-softmmu lm32-softmmu or1k-softmmu s390x-softmmu + TARGETS: ppc64-softmmu or1k-softmmu s390x-softmmu x86_64-softmmu rx-softmmu sh4-softmmu nios2-softmmu MAKE_CHECK_ARGS: check-build artifacts: @@ -259,9 +259,10 @@ build-deprecated: <<: *native_build_job_definition variables: IMAGE: debian-all-test-cross - CONFIGURE_ARGS: --disable-docs --disable-tools --disable-system + CONFIGURE_ARGS: --disable-docs --disable-tools MAKE_CHECK_ARGS: check-tcg - TARGETS: ppc64abi32-linux-user tilegx-linux-user + TARGETS: ppc64abi32-linux-user tilegx-linux-user lm32-softmmu + unicore32-softmmu allow_failure: true build-oss-fuzz: diff --git a/.shippable.yml b/.shippable.yml index 89d8be4291..0b4fd6df1d 100644 --- a/.shippable.yml +++ b/.shippable.yml @@ -8,7 +8,7 @@ env: - IMAGE=debian-amd64 TARGET_LIST=x86_64-softmmu,x86_64-linux-user - IMAGE=debian-win32-cross - TARGET_LIST=arm-softmmu,i386-softmmu,lm32-softmmu + TARGET_LIST=arm-softmmu,i386-softmmu - IMAGE=debian-win64-cross TARGET_LIST=aarch64-softmmu,sparc64-softmmu,x86_64-softmmu - IMAGE=debian-armel-cross diff --git a/configure b/configure index dfd7f18dcb..7564479008 100755 --- a/configure +++ b/configure @@ -280,7 +280,7 @@ supported_whpx_target() { return 1 } -deprecated_targets_list=ppc64abi32-linux-user,tilegx-linux-user +deprecated_targets_list=ppc64abi32-linux-user,tilegx-linux-user,lm32-softmmu,unicore32-softmmu deprecated_features="" supported_target() {